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

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

Issue 957643002: Fix clipping of content outside the bounds of the window. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 | « sky/engine/core/rendering/RenderBox.h ('k') | sky/tests/clipping/clipping-transforms.sky » ('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 f63f0343b21cce9a293cc781f57e20863003b459..d97b921c5b138d3576e7737a8451761dc49b1021 100644
--- a/sky/engine/core/rendering/RenderBox.cpp
+++ b/sky/engine/core/rendering/RenderBox.cpp
@@ -687,19 +687,17 @@ static inline bool forwardCompareZIndex(RenderBox* first, RenderBox* second)
return first->style()->zIndex() < second->style()->zIndex();
}
-void RenderBox::paintLayer(GraphicsContext* context, RenderLayer* rootLayer, const IntRect& rect)
+void RenderBox::paintLayer(GraphicsContext* context, const LayerPaintingInfo& paintingInfo)
{
// If this layer is totally invisible then there is nothing to paint.
// TODO(ojan): Return false from isSelfPainting and then ASSERT(!opacity()) here.
if (!opacity())
return;
- LayerPaintingInfo paintingInfo(rootLayer, rect, LayoutSize());
-
TransformationMatrix* layerTransform = layer()->transform();
if (!layerTransform) {
- paintLayerContents(context, paintingInfo, rect);
+ paintLayerContents(context, paintingInfo);
return;
}
@@ -737,13 +735,13 @@ void RenderBox::paintLayer(GraphicsContext* context, RenderLayer* rootLayer, con
// Now do a paint with the root layer shifted to be us.
LayerPaintingInfo transformedPaintingInfo(layer(), enclosingIntRect(transform.inverse().mapRect(paintingInfo.paintDirtyRect)),
adjustedSubPixelAccumulation);
- paintLayerContents(context, transformedPaintingInfo, rect);
+ paintLayerContents(context, transformedPaintingInfo);
// Restore the clip.
layer()->parent()->restoreClip(context, paintingInfo.paintDirtyRect, clipRect);
}
-void RenderBox::paintLayerContents(GraphicsContext* context, const LayerPaintingInfo& paintingInfo, const IntRect& rect)
+void RenderBox::paintLayerContents(GraphicsContext* context, const LayerPaintingInfo& paintingInfo)
{
float deviceScaleFactor = blink::deviceScaleFactor(frame());
context->setDeviceScaleFactor(deviceScaleFactor);
@@ -815,7 +813,7 @@ void RenderBox::paintLayerContents(GraphicsContext* context, const LayerPainting
std::stable_sort(layers.begin(), layers.end(), forwardCompareZIndex);
for (auto& box : layers) {
- box->paintLayer(context, paintingInfo.rootLayer, rect);
+ box->paintLayer(context, paintingInfo);
}
if (filterPainter.hasStartedFilterEffect())
« no previous file with comments | « sky/engine/core/rendering/RenderBox.h ('k') | sky/tests/clipping/clipping-transforms.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698