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

Side by Side Diff: Source/core/rendering/InlineFlowBox.cpp

Issue 23643003: ImageBuffer-less SVG masking and clipping. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix the Win build. Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after
1359 compositeOp = CompositeSourceOver; 1359 compositeOp = CompositeSourceOver;
1360 } 1360 }
1361 } 1361 }
1362 1362
1363 LayoutRect paintRect = LayoutRect(adjustedPaintOffset, frameRect.size()); 1363 LayoutRect paintRect = LayoutRect(adjustedPaintOffset, frameRect.size());
1364 paintFillLayers(paintInfo, Color(), renderer()->style()->maskLayers(), paint Rect, compositeOp); 1364 paintFillLayers(paintInfo, Color(), renderer()->style()->maskLayers(), paint Rect, compositeOp);
1365 1365
1366 bool hasBoxImage = maskBoxImage && maskBoxImage->canRender(renderer(), rende rer()->style()->effectiveZoom()); 1366 bool hasBoxImage = maskBoxImage && maskBoxImage->canRender(renderer(), rende rer()->style()->effectiveZoom());
1367 if (!hasBoxImage || !maskBoxImage->isLoaded()) { 1367 if (!hasBoxImage || !maskBoxImage->isLoaded()) {
1368 if (pushTransparencyLayer) 1368 if (pushTransparencyLayer)
1369 paintInfo.context->endTransparencyLayer(); 1369 paintInfo.context->endLayer();
1370 return; // Don't paint anything while we wait for the image to load. 1370 return; // Don't paint anything while we wait for the image to load.
1371 } 1371 }
1372 1372
1373 // The simple case is where we are the only box for this object. In those 1373 // The simple case is where we are the only box for this object. In those
1374 // cases only a single call to draw is required. 1374 // cases only a single call to draw is required.
1375 if (!prevLineBox() && !nextLineBox()) { 1375 if (!prevLineBox() && !nextLineBox()) {
1376 boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(adju stedPaintOffset, frameRect.size()), renderer()->style(), maskNinePieceImage, com positeOp); 1376 boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(adju stedPaintOffset, frameRect.size()), renderer()->style(), maskNinePieceImage, com positeOp);
1377 } else { 1377 } else {
1378 // We have a mask image that spans multiple lines. 1378 // We have a mask image that spans multiple lines.
1379 // We need to adjust _tx and _ty by the width of all previous lines. 1379 // We need to adjust _tx and _ty by the width of all previous lines.
1380 LayoutUnit logicalOffsetOnLine = 0; 1380 LayoutUnit logicalOffsetOnLine = 0;
1381 for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox ()) 1381 for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox ())
1382 logicalOffsetOnLine += curr->logicalWidth(); 1382 logicalOffsetOnLine += curr->logicalWidth();
1383 LayoutUnit totalLogicalWidth = logicalOffsetOnLine; 1383 LayoutUnit totalLogicalWidth = logicalOffsetOnLine;
1384 for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox()) 1384 for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
1385 totalLogicalWidth += curr->logicalWidth(); 1385 totalLogicalWidth += curr->logicalWidth();
1386 LayoutUnit stripX = adjustedPaintOffset.x() - (isHorizontal() ? logicalO ffsetOnLine : LayoutUnit()); 1386 LayoutUnit stripX = adjustedPaintOffset.x() - (isHorizontal() ? logicalO ffsetOnLine : LayoutUnit());
1387 LayoutUnit stripY = adjustedPaintOffset.y() - (isHorizontal() ? LayoutUn it() : logicalOffsetOnLine); 1387 LayoutUnit stripY = adjustedPaintOffset.y() - (isHorizontal() ? LayoutUn it() : logicalOffsetOnLine);
1388 LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.w idth(); 1388 LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.w idth();
1389 LayoutUnit stripHeight = isHorizontal() ? frameRect.height() : totalLogi calWidth; 1389 LayoutUnit stripHeight = isHorizontal() ? frameRect.height() : totalLogi calWidth;
1390 1390
1391 LayoutRect clipRect = clipRectForNinePieceImageStrip(this, maskNinePiece Image, paintRect); 1391 LayoutRect clipRect = clipRectForNinePieceImageStrip(this, maskNinePiece Image, paintRect);
1392 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1392 GraphicsContextStateSaver stateSaver(*paintInfo.context);
1393 paintInfo.context->clip(clipRect); 1393 paintInfo.context->clip(clipRect);
1394 boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(stri pX, stripY, stripWidth, stripHeight), renderer()->style(), maskNinePieceImage, c ompositeOp); 1394 boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(stri pX, stripY, stripWidth, stripHeight), renderer()->style(), maskNinePieceImage, c ompositeOp);
1395 } 1395 }
1396 1396
1397 if (pushTransparencyLayer) 1397 if (pushTransparencyLayer)
1398 paintInfo.context->endTransparencyLayer(); 1398 paintInfo.context->endLayer();
1399 } 1399 }
1400 1400
1401 InlineBox* InlineFlowBox::firstLeafChild() const 1401 InlineBox* InlineFlowBox::firstLeafChild() const
1402 { 1402 {
1403 InlineBox* leaf = 0; 1403 InlineBox* leaf = 0;
1404 for (InlineBox* child = firstChild(); child && !leaf; child = child->nextOnL ine()) 1404 for (InlineBox* child = firstChild(); child && !leaf; child = child->nextOnL ine())
1405 leaf = child->isLeaf() ? child : toInlineFlowBox(child)->firstLeafChild( ); 1405 leaf = child->isLeaf() ? child : toInlineFlowBox(child)->firstLeafChild( );
1406 return leaf; 1406 return leaf;
1407 } 1407 }
1408 1408
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1636 ASSERT(child->prevOnLine() == prev); 1636 ASSERT(child->prevOnLine() == prev);
1637 prev = child; 1637 prev = child;
1638 } 1638 }
1639 ASSERT(prev == m_lastChild); 1639 ASSERT(prev == m_lastChild);
1640 #endif 1640 #endif
1641 } 1641 }
1642 1642
1643 #endif 1643 #endif
1644 1644
1645 } // namespace WebCore 1645 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/filters/SkiaImageFilterBuilder.cpp ('k') | Source/core/rendering/RenderBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698