[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

simon.fraser at apple.com simon.fraser at apple.com
Wed Dec 22 13:35:23 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit a54b1e832cf847544263d0cde9b6bf95c9ec2284
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 21 00:42:52 2010 +0000

    2010-09-20  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Dan Bernstein.
    
            When PDF image is directly composited, it does not display
            https://bugs.webkit.org/show_bug.cgi?id=46144
    
            In the "direct image compositing" code path, we set the image directly
            as the contents of the GraphicsLayer. However, this only works with
            bitmap images, so we have to check that the image is a bitmap image.
    
            Test: compositing/images/direct-pdf-image.html
    
            * rendering/RenderLayerBacking.cpp:
            (WebCore::RenderLayerBacking::isDirectlyCompositedImage):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67900 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 9d4841c..e6c0fd3 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,19 @@
 2010-09-20  Simon Fraser  <simon.fraser at apple.com>
 
+        Reviewed by Dan Bernstein.
+
+        When PDF image is directly composited, it does not display
+        https://bugs.webkit.org/show_bug.cgi?id=46144
+        
+        Testcase with an unadorned PDF image on a layer.
+        
+        * compositing/images/direct-pdf-image-expected.checksum: Added.
+        * compositing/images/direct-pdf-image-expected.png: Added.
+        * compositing/images/direct-pdf-image-expected.txt: Added.
+        * compositing/images/direct-pdf-image.html: Added.
+
+2010-09-20  Simon Fraser  <simon.fraser at apple.com>
+
         Reviewed by Darin Adler.
 
         Crash when div with content set to image gets composited (Vimeo).
diff --git a/LayoutTests/compositing/images/direct-pdf-image-expected.checksum b/LayoutTests/compositing/images/direct-pdf-image-expected.checksum
new file mode 100644
index 0000000..89a349f
--- /dev/null
+++ b/LayoutTests/compositing/images/direct-pdf-image-expected.checksum
@@ -0,0 +1 @@
+eddaa4019c3d4209bb75de7520dbc03d
\ No newline at end of file
diff --git a/LayoutTests/compositing/images/direct-pdf-image-expected.png b/LayoutTests/compositing/images/direct-pdf-image-expected.png
new file mode 100644
index 0000000..e42bc7b
Binary files /dev/null and b/LayoutTests/compositing/images/direct-pdf-image-expected.png differ
diff --git a/LayoutTests/compositing/images/direct-pdf-image-expected.txt b/LayoutTests/compositing/images/direct-pdf-image-expected.txt
new file mode 100644
index 0000000..8bac2ad
--- /dev/null
+++ b/LayoutTests/compositing/images/direct-pdf-image-expected.txt
@@ -0,0 +1,11 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (0,0) size 800x600
+layer at (0,0) size 100x200
+  RenderBlock (positioned) {DIV} at (0,0) size 100x200 [bgcolor=#FF0000]
+layer at (0,0) size 100x100
+  RenderImage {IMG} at (0,0) size 100x100
+layer at (0,100) size 100x100
+  RenderImage {IMG} at (0,100) size 100x100
diff --git a/LayoutTests/compositing/images/direct-pdf-image.html b/LayoutTests/compositing/images/direct-pdf-image.html
new file mode 100644
index 0000000..50090f3
--- /dev/null
+++ b/LayoutTests/compositing/images/direct-pdf-image.html
@@ -0,0 +1,40 @@
+<!DOCTYPE>
+
+<html>
+<head>
+  <style type="text/css" media="screen">
+    body {
+        margin: 0;
+    }
+
+    img {
+        position: relative;
+        display: block;
+        width: 100px;
+        height: 100px;
+    }
+    
+    .composited {
+        -webkit-transform: translateZ(0);
+    }
+    
+    #indicator {
+        position: absolute;
+        top: 0;
+        background-color: red;
+        width: 100px;
+        height: 200px;
+    }
+  </style>
+</head>
+<body>
+
+    <div id="indicator"></div>
+
+    <img src="../../fast/images/resources/green_rectangle.pdf">
+    <img class="composited" src="../../fast/images/resources/green_rectangle.pdf">
+
+    <!-- You should see two no red above -->
+
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9f141d2..05b3ee3 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,21 @@
 2010-09-20  Simon Fraser  <simon.fraser at apple.com>
 
+        Reviewed by Dan Bernstein.
+
+        When PDF image is directly composited, it does not display
+        https://bugs.webkit.org/show_bug.cgi?id=46144
+        
+        In the "direct image compositing" code path, we set the image directly
+        as the contents of the GraphicsLayer. However, this only works with
+        bitmap images, so we have to check that the image is a bitmap image.
+
+        Test: compositing/images/direct-pdf-image.html
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::isDirectlyCompositedImage):
+
+2010-09-20  Simon Fraser  <simon.fraser at apple.com>
+
         Reviewed by Darin Adler.
 
         Crash when div with content set to image gets composited (Vimeo).
diff --git a/WebCore/rendering/RenderLayerBacking.cpp b/WebCore/rendering/RenderLayerBacking.cpp
index 6c58e0d..15a5b2f 100644
--- a/WebCore/rendering/RenderLayerBacking.cpp
+++ b/WebCore/rendering/RenderLayerBacking.cpp
@@ -777,7 +777,17 @@ bool RenderLayerBacking::containsPaintedContent() const
 bool RenderLayerBacking::isDirectlyCompositedImage() const
 {
     RenderObject* renderObject = renderer();
-    return renderObject->isImage() && !hasBoxDecorationsOrBackground(renderObject) && !renderObject->hasClip();
+    
+    if (!renderObject->isImage() || hasBoxDecorationsOrBackground(renderObject) || renderObject->hasClip())
+        return false;
+
+    RenderImage* imageRenderer = toRenderImage(renderObject);
+    if (CachedImage* cachedImage = imageRenderer->cachedImage()) {
+        if (Image* image = cachedImage->image())
+            return image->isBitmapImage();
+    }
+
+    return false;
 }
 
 void RenderLayerBacking::rendererContentChanged()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list