Title: [115596] trunk/Source/WebCore
Revision
115596
Author
[email protected]
Date
2012-04-29 08:20:12 -0700 (Sun, 29 Apr 2012)

Log Message

[Texmap] Leaves demo: wrong geometry when opacity animation kicks in
https://bugs.webkit.org/show_bug.cgi?id=85096

Reviewed by Kenneth Rohde Christiansen.

We should use combined() instead of combinedForChildren() since we don't allow
intermediate surfaces for preserves-3d. Also, we should apply the offset before
multiplying the transforms, otherwise the transform-origin is incorrect.

Covered by existing compositing tests.

* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelf):
(WebCore::TextureMapperLayer::paintRecursive):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (115595 => 115596)


--- trunk/Source/WebCore/ChangeLog	2012-04-29 08:58:05 UTC (rev 115595)
+++ trunk/Source/WebCore/ChangeLog	2012-04-29 15:20:12 UTC (rev 115596)
@@ -1,3 +1,20 @@
+2012-04-29  No'am Rosenthal  <[email protected]>
+
+        [Texmap] Leaves demo: wrong geometry when opacity animation kicks in
+        https://bugs.webkit.org/show_bug.cgi?id=85096
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        We should use combined() instead of combinedForChildren() since we don't allow
+        intermediate surfaces for preserves-3d. Also, we should apply the offset before
+        multiplying the transforms, otherwise the transform-origin is incorrect.
+
+        Covered by existing compositing tests.
+
+        * platform/graphics/texmap/TextureMapperLayer.cpp:
+        (WebCore::TextureMapperLayer::paintSelf):
+        (WebCore::TextureMapperLayer::paintRecursive):
+
 2012-04-29  Mark Pilgrim  <[email protected]>
 
         [Chromium] Call highUsageDeltaMB directly

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp (115595 => 115596)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp	2012-04-29 08:58:05 UTC (rev 115595)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp	2012-04-29 15:20:12 UTC (rev 115596)
@@ -147,10 +147,10 @@
 void TextureMapperLayer::paintSelf(const TextureMapperPaintOptions& options)
 {
     // We apply the following transform to compensate for painting into a surface, and then apply the offset so that the painting fits in the target rect.
-    TransformationMatrix transform =
-            TransformationMatrix(options.transform)
-            .multiply(m_transform.combined())
-            .translate(options.offset.width(), options.offset.height());
+    TransformationMatrix transform;
+    transform.translate(options.offset.width(), options.offset.height());
+    transform.multiply(options.transform);
+    transform.multiply(m_transform.combined());
 
     float opacity = options.opacity;
     RefPtr<BitmapTexture> mask = options.mask;
@@ -319,8 +319,7 @@
     options.textureMapper->bindSurface(surface.get());
     paintOptions.opacity = 1;
 
-    // We have to use combinedForChildren() and not combined(), otherwise preserve-3D doesn't work.
-    paintOptions.transform = m_transform.combinedForChildren().inverse();
+    paintOptions.transform = m_transform.combined().inverse();
     paintOptions.offset = -IntSize(surfaceRect.x(), surfaceRect.y());
 
     paintSelfAndChildrenWithReplica(paintOptions);
@@ -334,10 +333,11 @@
 #endif
 
     options.textureMapper->bindSurface(options.surface.get());
-    TransformationMatrix targetTransform =
-            TransformationMatrix(options.transform)
-                .multiply(m_transform.combined())
-                .translate(options.offset.width(), options.offset.height());
+    TransformationMatrix targetTransform;
+    targetTransform.translate(options.offset.width(), options.offset.height());
+    targetTransform.multiply(options.transform);
+    targetTransform.multiply(m_transform.combined());
+
     options.textureMapper->drawTexture(*surface.get(), surfaceRect, targetTransform, opacity, maskTexture.get());
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to