Index: ui/gfx/skia_paint_util.cc |
diff --git a/ui/gfx/skia_paint_util.cc b/ui/gfx/skia_paint_util.cc |
index dcaea71be1e1ea9e55fa1bd5a9c5cb507f5bd41c..cf96dbe2d397abdc8c3673aed4ffd17c7820f224 100644 |
--- a/ui/gfx/skia_paint_util.cc |
+++ b/ui/gfx/skia_paint_util.cc |
@@ -4,6 +4,7 @@ |
#include "ui/gfx/skia_paint_util.h" |
+#include "base/memory/ptr_util.h" |
#include "third_party/skia/include/core/SkColorFilter.h" |
#include "third_party/skia/include/effects/SkBlurMaskFilter.h" |
#include "third_party/skia/include/effects/SkGradientShader.h" |
@@ -12,16 +13,17 @@ |
namespace gfx { |
-sk_sp<cc::PaintShader> CreateImageRepShader(const gfx::ImageSkiaRep& image_rep, |
- cc::PaintShader::TileMode tile_mode, |
- const SkMatrix& local_matrix) { |
- return cc::WrapSkShader(CreateImageRepShaderForScale( |
- image_rep, tile_mode, local_matrix, image_rep.scale())); |
+std::unique_ptr<cc::PaintShader> CreateImageRepShader( |
+ const gfx::ImageSkiaRep& image_rep, |
+ SkShader::TileMode tile_mode, |
+ const SkMatrix& local_matrix) { |
+ return CreateImageRepShaderForScale(image_rep, tile_mode, local_matrix, |
+ image_rep.scale()); |
} |
-sk_sp<cc::PaintShader> CreateImageRepShaderForScale( |
+std::unique_ptr<cc::PaintShader> CreateImageRepShaderForScale( |
const gfx::ImageSkiaRep& image_rep, |
- cc::PaintShader::TileMode tile_mode, |
+ SkShader::TileMode tile_mode, |
const SkMatrix& local_matrix, |
SkScalar scale) { |
// Unscale matrix by |scale| such that the bitmap is drawn at the |
@@ -36,21 +38,22 @@ sk_sp<cc::PaintShader> CreateImageRepShaderForScale( |
shader_scale.setScaleX(local_matrix.getScaleX() / scale); |
shader_scale.setScaleY(local_matrix.getScaleY() / scale); |
- return cc::PaintShader::MakeBitmapShader(image_rep.sk_bitmap(), tile_mode, |
- tile_mode, &shader_scale); |
+ return base::MakeUnique<cc::PaintShader>( |
+ SkImage::MakeFromBitmap(image_rep.sk_bitmap()), tile_mode, tile_mode, |
+ &shader_scale); |
} |
-sk_sp<cc::PaintShader> CreateGradientShader(int start_point, |
- int end_point, |
- SkColor start_color, |
- SkColor end_color) { |
+std::unique_ptr<cc::PaintShader> CreateGradientShader(int start_point, |
+ int end_point, |
+ SkColor start_color, |
+ SkColor end_color) { |
SkColor grad_colors[2] = {start_color, end_color}; |
SkPoint grad_points[2]; |
grad_points[0].iset(0, start_point); |
grad_points[1].iset(0, end_point); |
- return cc::WrapSkShader(SkGradientShader::MakeLinear( |
- grad_points, grad_colors, NULL, 2, cc::PaintShader::kClamp_TileMode)); |
+ return base::MakeUnique<cc::PaintShader>(grad_points, grad_colors, nullptr, 2, |
+ SkShader::kClamp_TileMode); |
} |
// This is copied from |