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

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

Issue 2893083002: cc: Move SkShader construction to a single spot in PaintShader (Closed)
Patch Set: update Created 3 years, 7 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 2df17f64f1eb1bd67b8b4b26c7f66780a1c45681..6a27e1dffd61e53e4dbbd7f0ea608a0654ed776a 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -355,13 +355,13 @@ void SVGImage::DrawPatternForContainer(GraphicsContext& context,
phase.Y() + spaced_tile.Y());
PaintFlags flags;
- flags.setShader(MakePaintShaderRecord(record, SkShader::kRepeat_TileMode,
- SkShader::kRepeat_TileMode,
- &pattern_transform, nullptr));
+ flags.setShader(WTF::MakeUnique<PaintShader>(
+ record, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode,
+ &pattern_transform, nullptr));
// If the shader could not be instantiated (e.g. non-invertible matrix),
// draw transparent.
// Note: we can't simply bail, because of arbitrary blend mode.
- if (!flags.getShader())
+ if (!flags.HasShader())
flags.setColor(SK_ColorTRANSPARENT);
flags.setBlendMode(composite_op);
@@ -404,7 +404,7 @@ bool SVGImage::ApplyShaderInternal(PaintFlags& flags,
FloatRect float_bounds(FloatPoint(), size);
const SkRect bounds(float_bounds);
- flags.setShader(MakePaintShaderRecord(
+ flags.setShader(WTF::MakeUnique<PaintShader>(
PaintRecordForCurrentFrame(float_bounds, url), SkShader::kRepeat_TileMode,
SkShader::kRepeat_TileMode, &local_matrix, &bounds));

Powered by Google App Engine
This is Rietveld 408576698