+2012-04-29 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [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 <pilgrim@chromium.org>
[Chromium] Call highUsageDeltaMB directly
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;
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);
#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());
}