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

Unified Diff: include/core/SkShader.h

Issue 1934313002: move colorshader into its own .cpp, add color4f variant (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: register for serialization, amend GM view for future picture expansion Created 4 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
« no previous file with comments | « gyp/core.gypi ('k') | samplecode/GMSampleView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkShader.h
diff --git a/include/core/SkShader.h b/include/core/SkShader.h
index 0de53ad65240a839e7889a838cdca2c02561e561..60aa7cd6c9a585c58cd7d1ad6ef531d60f39dcd4 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -17,6 +17,7 @@
#include "../gpu/GrColor.h"
class SkColorFilter;
+class SkColorSpace;
class SkPath;
class SkPicture;
class SkXfermode;
@@ -375,6 +376,14 @@ public:
*/
static sk_sp<SkShader> MakeColorShader(SkColor);
+ /**
+ * Create a shader that draws the specified color (in the specified colorspace).
+ *
+ * This works around the limitation that SkPaint::setColor() only takes byte values, and does
+ * not support specific colorspaces.
+ */
+ static sk_sp<SkShader> MakeColorShader(const SkColor4f&, sk_sp<SkColorSpace>);
+
static sk_sp<SkShader> MakeComposeShader(sk_sp<SkShader> dst, sk_sp<SkShader> src,
SkXfermode::Mode);
« no previous file with comments | « gyp/core.gypi ('k') | samplecode/GMSampleView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698