Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: sky/engine/core/rendering/RenderBox.cpp

Issue 958463002: Cleanup transform-related methods in RenderLayer. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: improve test Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sky/engine/core/rendering/RenderLayer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderBox.cpp
diff --git a/sky/engine/core/rendering/RenderBox.cpp b/sky/engine/core/rendering/RenderBox.cpp
index 91602ba31eb6884bfeb999252a6405330864631e..e19b36a4dc36c34693f5b7ca8cd4b38da48848b0 100644
--- a/sky/engine/core/rendering/RenderBox.cpp
+++ b/sky/engine/core/rendering/RenderBox.cpp
@@ -696,7 +696,9 @@ void RenderBox::paintLayer(GraphicsContext* context, RenderLayer* rootLayer, con
LayerPaintingInfo paintingInfo(rootLayer, rect, LayoutSize());
- if (!layer()->paintsWithTransform()) {
+ TransformationMatrix* layerTransform = layer()->transform();
+
+ if (!layerTransform) {
paintLayerContents(context, paintingInfo, rect);
return;
}
@@ -704,20 +706,14 @@ void RenderBox::paintLayer(GraphicsContext* context, RenderLayer* rootLayer, con
// The RenderView can't be transformed in Sky.
ASSERT(layer()->parent());
- TransformationMatrix layerTransform = layer()->renderableTransform();
// If the transform can't be inverted, then don't paint anything.
- if (!layerTransform.isInvertible())
+ if (!layerTransform->isInvertible())
return;
// If we have a transparency layer enclosing us and we are the root of a transform, then we need to establish the transparency
// layer from the parent now, assuming there is a parent
if (layer()->isTransparent()) {
- // TODO(ojan): This should ASSERT(layer()->parent()) instead of branching since the
- // RenderView can't be transformed in sky.
- if (layer()->parent())
- layer()->parent()->beginTransparencyLayers(context, paintingInfo.rootLayer, paintingInfo.paintDirtyRect, paintingInfo.subPixelAccumulation);
- else
- layer()->beginTransparencyLayers(context, paintingInfo.rootLayer, paintingInfo.paintDirtyRect, paintingInfo.subPixelAccumulation);
+ layer()->parent()->beginTransparencyLayers(context, paintingInfo.rootLayer, paintingInfo.paintDirtyRect, paintingInfo.subPixelAccumulation);
}
// Make sure the parent's clip rects have been calculated.
@@ -732,7 +728,7 @@ void RenderBox::paintLayer(GraphicsContext* context, RenderLayer* rootLayer, con
// the accumulated error for sub-pixel layout.
LayoutPoint delta;
layer()->convertToLayerCoords(paintingInfo.rootLayer, delta);
- TransformationMatrix transform(layer()->renderableTransform());
+ TransformationMatrix transform(*layerTransform);
IntPoint roundedDelta = roundedIntPoint(delta);
transform.translateRight(roundedDelta.x(), roundedDelta.y());
LayoutSize adjustedSubPixelAccumulation = paintingInfo.subPixelAccumulation + (delta - roundedDelta);
@@ -2984,7 +2980,7 @@ LayoutRect RenderBox::layoutOverflowRectForPropagation() const
rect.unite(layoutOverflowRect());
if (hasLayer() && layer()->transform())
- rect = layer()->currentTransform().mapRect(rect);
+ rect = layer()->transform()->mapRect(rect);
return rect;
}
« no previous file with comments | « no previous file | sky/engine/core/rendering/RenderLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698