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

Side by Side Diff: Source/core/svg/graphics/SVGImage.cpp

Issue 1160183003: Use SkPictureBuilder in SVGShapePainter, and generalize SkPictureBuilder. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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
« no previous file with comments | « Source/core/paint/SVGShapePainter.cpp ('k') | Source/platform/blink_platform.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 const IntSize& repeatSpacing) 237 const IntSize& repeatSpacing)
238 { 238 {
239 // Tile adjusted for scaling/stretch. 239 // Tile adjusted for scaling/stretch.
240 FloatRect tile(srcRect); 240 FloatRect tile(srcRect);
241 tile.scale(tileScale.width(), tileScale.height()); 241 tile.scale(tileScale.width(), tileScale.height());
242 242
243 // Expand the tile to account for repeat spacing. 243 // Expand the tile to account for repeat spacing.
244 FloatRect spacedTile(tile); 244 FloatRect spacedTile(tile);
245 spacedTile.expand(repeatSpacing); 245 spacedTile.expand(repeatSpacing);
246 246
247 SkPictureBuilder patternPicture(spacedTile); 247 SkPictureBuilder patternPicture(spacedTile, nullptr, context);
248 { 248 {
249 DrawingRecorder patternPictureRecorder(patternPicture.context(), *this, DisplayItem::Type::SVGImage, spacedTile); 249 DrawingRecorder patternPictureRecorder(patternPicture.context(), *this, DisplayItem::Type::SVGImage, spacedTile);
250 if (!patternPictureRecorder.canUseCachedDrawing()) { 250 if (!patternPictureRecorder.canUseCachedDrawing()) {
251 // When generating an expanded tile, make sure we don't draw into th e spacing area. 251 // When generating an expanded tile, make sure we don't draw into th e spacing area.
252 if (tile != spacedTile) 252 if (tile != spacedTile)
253 patternPicture.context().clip(tile); 253 patternPicture.context().clip(tile);
254 SkPaint paint; 254 SkPaint paint;
255 drawForContainer(patternPicture.context().canvas(), paint, container Size, zoom, tile, srcRect); 255 drawForContainer(patternPicture.context().canvas(), paint, container Size, zoom, tile, srcRect);
256 } 256 }
257 } 257 }
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 483
484 return m_page; 484 return m_page;
485 } 485 }
486 486
487 String SVGImage::filenameExtension() const 487 String SVGImage::filenameExtension() const
488 { 488 {
489 return "svg"; 489 return "svg";
490 } 490 }
491 491
492 } 492 }
OLDNEW
« no previous file with comments | « Source/core/paint/SVGShapePainter.cpp ('k') | Source/platform/blink_platform.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698