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

Unified Diff: third_party/WebKit/Source/platform/graphics/ImagePattern.cpp

Issue 2928703005: Revert of cc: Move SkShader construction to a single spot in PaintShader (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/ImagePattern.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp b/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp
index dbf9de5067e462548a1189ec1b2972fa824ccc4c..b913790757bca9c8ffa42f44d0f09f4ad9aca498 100644
--- a/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp
@@ -29,16 +29,14 @@
return local_matrix != previous_local_matrix_;
}
-std::unique_ptr<PaintShader> ImagePattern::CreateShader(
- const SkMatrix& local_matrix) {
- if (!tile_image_) {
- return PaintShader::MakeColor(SK_ColorTRANSPARENT);
- }
+sk_sp<PaintShader> ImagePattern::CreateShader(const SkMatrix& local_matrix) {
+ if (!tile_image_)
+ return WrapSkShader(SkShader::MakeColorShader(SK_ColorTRANSPARENT));
if (IsRepeatXY()) {
// Fast path: for repeatXY we just return a shader from the original image.
- return PaintShader::MakeImage(tile_image_, SkShader::kRepeat_TileMode,
- SkShader::kRepeat_TileMode, &local_matrix);
+ return MakePaintShaderImage(tile_image_, SkShader::kRepeat_TileMode,
+ SkShader::kRepeat_TileMode, &local_matrix);
}
// Skia does not have a "draw the tile only once" option. Clamp_TileMode
@@ -75,8 +73,8 @@
SkMatrix adjusted_matrix(local_matrix);
adjusted_matrix.postTranslate(-border_pixel_x, -border_pixel_y);
- return PaintShader::MakeImage(std::move(tile_image), tile_mode_x, tile_mode_y,
- &adjusted_matrix);
+ return MakePaintShaderImage(std::move(tile_image), tile_mode_x, tile_mode_y,
+ &adjusted_matrix);
}
bool ImagePattern::IsTextureBacked() const {

Powered by Google App Engine
This is Rietveld 408576698