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

Unified Diff: third_party/WebKit/Source/platform/graphics/Gradient.h

Issue 2893083002: cc: Move SkShader construction to a single spot in PaintShader (Closed)
Patch Set: update 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/Gradient.h
diff --git a/third_party/WebKit/Source/platform/graphics/Gradient.h b/third_party/WebKit/Source/platform/graphics/Gradient.h
index 8eb54c198ae7ba8bd60f7a5750eb4bb63b1eb8c8..b7a1c6a5c0fe6e84d61179b2b00a3438fbf256d5 100644
--- a/third_party/WebKit/Source/platform/graphics/Gradient.h
+++ b/third_party/WebKit/Source/platform/graphics/Gradient.h
@@ -102,14 +102,16 @@ class PLATFORM_EXPORT Gradient : public RefCounted<Gradient> {
using ColorBuffer = Vector<SkColor, 8>;
using OffsetBuffer = Vector<SkScalar, 8>;
- virtual sk_sp<SkShader> CreateShader(const ColorBuffer&,
- const OffsetBuffer&,
- SkShader::TileMode,
- uint32_t flags,
- const SkMatrix&) const = 0;
+ virtual std::unique_ptr<PaintShader> CreateShader(const ColorBuffer&,
+ const OffsetBuffer&,
+ SkShader::TileMode,
+ uint32_t flags,
+ const SkMatrix&,
+ SkColor) const = 0;
private:
- sk_sp<PaintShader> CreateShaderInternal(const SkMatrix& local_matrix);
+ std::unique_ptr<PaintShader> CreateShaderInternal(
+ const SkMatrix& local_matrix);
void SortStopsIfNecessary();
void FillSkiaStops(ColorBuffer&, OffsetBuffer&) const;
@@ -121,7 +123,7 @@ class PLATFORM_EXPORT Gradient : public RefCounted<Gradient> {
Vector<ColorStop, 2> stops_;
bool stops_sorted_;
- mutable sk_sp<PaintShader> cached_shader_;
+ mutable std::unique_ptr<PaintShader> cached_shader_;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698