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

Unified Diff: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp

Issue 1931133002: Let SkPictureBuilder be DisplayItemClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
Index: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
index e31906fb813d1567178119d7c7d585e46fb49e4a..525ee8c9a0279b03e1184b6255214832ca2158ff 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -79,12 +79,6 @@ SVGImage::~SVGImage()
ASSERT(!m_chromeClient || !m_chromeClient->image());
}
-LayoutRect SVGImage::visualRect() const
-{
- // TODO(chrishtr): fix this.
- return LayoutRect();
-}
-
bool SVGImage::isInSVGImage(const Node* node)
{
ASSERT(node);
@@ -283,8 +277,8 @@ void SVGImage::drawPatternForContainer(GraphicsContext& context, const FloatSize
spacedTile.expand(FloatSize(repeatSpacing));
SkPictureBuilder patternPicture(spacedTile, nullptr, &context);
- if (!DrawingRecorder::useCachedDrawingIfPossible(patternPicture.context(), *this, DisplayItem::Type::SVGImage)) {
- DrawingRecorder patternPictureRecorder(patternPicture.context(), *this, DisplayItem::Type::SVGImage, spacedTile);
+ {
+ DrawingRecorder patternPictureRecorder(patternPicture.context(), patternPicture, DisplayItem::Type::SVGImage, spacedTile);
// When generating an expanded tile, make sure we don't draw into the spacing area.
if (tile != spacedTile)
patternPicture.context().clip(tile);
@@ -352,7 +346,7 @@ void SVGImage::drawInternal(SkCanvas* canvas, const SkPaint& paint, const FloatR
SkPictureBuilder imagePicture(dstRect);
{
- ClipRecorder clipRecorder(imagePicture.context(), *this, DisplayItem::ClipNodeImage, LayoutRect(enclosingIntRect(dstRect)));
+ ClipRecorder clipRecorder(imagePicture.context(), imagePicture, DisplayItem::ClipNodeImage, LayoutRect(enclosingIntRect(dstRect)));
// We can only draw the entire frame, clipped to the rect we want. So compute where the top left
// of the image would be if we were drawing without clipping, and translate accordingly.
@@ -361,7 +355,7 @@ void SVGImage::drawInternal(SkCanvas* canvas, const SkPaint& paint, const FloatR
FloatPoint destOffset = dstRect.location() - topLeftOffset;
AffineTransform transform = AffineTransform::translation(destOffset.x(), destOffset.y());
transform.scale(scale.width(), scale.height());
- TransformRecorder transformRecorder(imagePicture.context(), *this, transform);
+ TransformRecorder transformRecorder(imagePicture.context(), imagePicture, transform);
view->updateAllLifecyclePhasesExceptPaint();
view->paint(imagePicture.context(), CullRect(enclosingIntRect(srcRect)));

Powered by Google App Engine
This is Rietveld 408576698