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

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

Issue 766943003: Remove uses of PaintBehaviorFlattenCompositingLayers (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: patch for landing Created 6 years 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/engine/core/rendering/RenderBoxModelObject.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 083e1a6deb8987959230d99ec2ed3e911cde2392..f8ef8758e9a72afce6bae0d7ce1f82af22c5d068 100644
--- a/sky/engine/core/rendering/RenderBox.cpp
+++ b/sky/engine/core/rendering/RenderBox.cpp
@@ -674,7 +674,7 @@ void RenderBox::paintRootBoxFillLayers(const PaintInfo& paintInfo)
const FillLayer& bgLayer = style()->backgroundLayers();
Color bgColor = resolveColor(CSSPropertyBackgroundColor);
- paintFillLayers(paintInfo, bgColor, bgLayer, view()->backgroundRect(this), BackgroundBleedNone, CompositeSourceOver, this);
+ paintFillLayers(paintInfo, bgColor, bgLayer, view()->backgroundRect(this), BackgroundBleedNone, this);
}
BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance(GraphicsContext* context, const BoxDecorationData& boxDecorationData) const
@@ -921,40 +921,12 @@ void RenderBox::paintClippingMask(PaintInfo& paintInfo, const LayoutPoint& paint
void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& paintRect)
{
- // Figure out if we need to push a transparency layer to render our mask.
- bool pushTransparencyLayer = false;
- bool flattenCompositingLayers = view()->frameView() && view()->frameView()->paintBehavior() & PaintBehaviorFlattenCompositingLayers;
- CompositeOperator compositeOp = CompositeSourceOver;
-
- bool allMaskImagesLoaded = true;
-
- if (flattenCompositingLayers) {
- pushTransparencyLayer = true;
- StyleImage* maskBoxImage = style()->maskBoxImage().image();
- const FillLayer& maskLayers = style()->maskLayers();
-
- // Don't render a masked element until all the mask images have loaded, to prevent a flash of unmasked content.
- if (maskBoxImage)
- allMaskImagesLoaded &= maskBoxImage->isLoaded();
-
- allMaskImagesLoaded &= maskLayers.imagesAreLoaded();
-
- paintInfo.context->setCompositeOperation(CompositeDestinationIn);
- paintInfo.context->beginTransparencyLayer(1);
- compositeOp = CompositeSourceOver;
- }
-
- if (allMaskImagesLoaded) {
- paintFillLayers(paintInfo, Color::transparent, style()->maskLayers(), paintRect, BackgroundBleedNone, compositeOp);
- paintNinePieceImage(paintInfo.context, paintRect, style(), style()->maskBoxImage(), compositeOp);
- }
-
- if (pushTransparencyLayer)
- paintInfo.context->endLayer();
+ paintFillLayers(paintInfo, Color::transparent, style()->maskLayers(), paintRect, BackgroundBleedNone);
+ paintNinePieceImage(paintInfo.context, paintRect, style(), style()->maskBoxImage());
}
void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, const FillLayer& fillLayer, const LayoutRect& rect,
- BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject* backgroundObject)
+ BackgroundBleedAvoidance bleedAvoidance, RenderObject* backgroundObject)
{
Vector<const FillLayer*, 8> layers;
const FillLayer* curLayer = &fillLayer;
@@ -1001,16 +973,16 @@ void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, cons
Vector<const FillLayer*>::const_reverse_iterator topLayer = layers.rend();
for (Vector<const FillLayer*>::const_reverse_iterator it = layers.rbegin(); it != topLayer; ++it)
- paintFillLayer(paintInfo, c, **it, rect, bleedAvoidance, op, backgroundObject, skipBaseColor);
+ paintFillLayer(paintInfo, c, **it, rect, bleedAvoidance, backgroundObject, skipBaseColor);
if (shouldDrawBackgroundInSeparateBuffer)
context->endLayer();
}
void RenderBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer& fillLayer, const LayoutRect& rect,
- BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject* backgroundObject, bool skipBaseColor)
+ BackgroundBleedAvoidance bleedAvoidance, RenderObject* backgroundObject, bool skipBaseColor)
{
- paintFillLayerExtended(paintInfo, c, fillLayer, rect, bleedAvoidance, 0, LayoutSize(), op, backgroundObject, skipBaseColor);
+ paintFillLayerExtended(paintInfo, c, fillLayer, rect, bleedAvoidance, 0, LayoutSize(), backgroundObject, skipBaseColor);
}
void RenderBox::imageChanged(WrappedImagePtr image, const IntRect*)
« no previous file with comments | « sky/engine/core/rendering/RenderBox.h ('k') | sky/engine/core/rendering/RenderBoxModelObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698