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

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

Issue 886263003: Remove mask painting. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix comment Created 5 years, 11 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/InlineFlowBox.h ('k') | sky/engine/core/rendering/PaintPhase.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/InlineFlowBox.cpp
diff --git a/sky/engine/core/rendering/InlineFlowBox.cpp b/sky/engine/core/rendering/InlineFlowBox.cpp
index 0f713dee0d5d6305cd526343cd6320f27b53e20c..f4d9a5e2286a684ded5ca5148b94f56b43c8daa5 100644
--- a/sky/engine/core/rendering/InlineFlowBox.cpp
+++ b/sky/engine/core/rendering/InlineFlowBox.cpp
@@ -997,11 +997,6 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,
if (!paintInfo.rect.intersects(pixelSnappedIntRect(overflowRect)))
return;
- if (paintInfo.phase == PaintPhaseMask) {
- paintMask(paintInfo, paintOffset);
- return;
- }
-
paintBoxDecorationBackground(paintInfo, paintOffset);
for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
@@ -1168,51 +1163,6 @@ void InlineFlowBox::paintBoxDecorationBackground(PaintInfo& paintInfo, const Lay
}
}
-void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
-{
- // Pixel snap mask painting.
- LayoutRect frameRect = roundedFrameRect();
-
- // Move x/y to our coordinates.
- LayoutRect localRect(frameRect);
- LayoutPoint adjustedPaintOffset = paintOffset + localRect.location();
-
- const NinePieceImage& maskNinePieceImage = renderer().style()->maskBoxImage();
- StyleImage* maskBoxImage = renderer().style()->maskBoxImage().image();
-
- LayoutRect paintRect = LayoutRect(adjustedPaintOffset, frameRect.size());
- paintFillLayers(paintInfo, Color::transparent, renderer().style()->maskLayers(), paintRect);
-
- bool hasBoxImage = maskBoxImage && maskBoxImage->canRender(renderer());
- if (!hasBoxImage || !maskBoxImage->isLoaded()) {
- return; // Don't paint anything while we wait for the image to load.
- }
-
- // The simple case is where we are the only box for this object. In those
- // cases only a single call to draw is required.
- if (!prevLineBox() && !nextLineBox()) {
- boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(adjustedPaintOffset, frameRect.size()), renderer().style(), maskNinePieceImage);
- } else {
- // We have a mask image that spans multiple lines.
- // We need to adjust _tx and _ty by the width of all previous lines.
- LayoutUnit logicalOffsetOnLine = 0;
- for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
- logicalOffsetOnLine += curr->logicalWidth();
- LayoutUnit totalLogicalWidth = logicalOffsetOnLine;
- for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
- totalLogicalWidth += curr->logicalWidth();
- LayoutUnit stripX = adjustedPaintOffset.x() - logicalOffsetOnLine;
- LayoutUnit stripY = adjustedPaintOffset.y();
- LayoutUnit stripWidth = totalLogicalWidth;
- LayoutUnit stripHeight = frameRect.height();
-
- LayoutRect clipRect = clipRectForNinePieceImageStrip(this, maskNinePieceImage, paintRect);
- GraphicsContextStateSaver stateSaver(*paintInfo.context);
- paintInfo.context->clip(clipRect);
- boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(stripX, stripY, stripWidth, stripHeight), renderer().style(), maskNinePieceImage);
- }
-}
-
InlineBox* InlineFlowBox::firstLeafChild() const
{
InlineBox* leaf = 0;
« no previous file with comments | « sky/engine/core/rendering/InlineFlowBox.h ('k') | sky/engine/core/rendering/PaintPhase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698