aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar reed <reed@chromium.org>2016-01-23 10:15:39 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-23 10:15:39 -0800
commitfac684502b6047ffc7dc2e59bd7e5a7cbfa5bf78 (patch)
tree998fc0005b8d04c1fd27422d0c78afd55383c454 /include/core
parent55d49053d1b6db42e013eb3409ffcfc7e235c685 (diff)
expand unitests for color4f
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkColor.h2
-rw-r--r--include/core/SkColorFilter.h4
-rw-r--r--include/core/SkShader.h4
3 files changed, 10 insertions, 0 deletions
diff --git a/include/core/SkColor.h b/include/core/SkColor.h
index f18fb7ee5e..3ebd18b7aa 100644
--- a/include/core/SkColor.h
+++ b/include/core/SkColor.h
@@ -169,6 +169,8 @@ struct SkPM4f {
float fVec[4];
float a() const { return fVec[SK_A32_SHIFT/8]; }
+
+ static SkPM4f FromPMColor(SkPMColor);
};
/*
diff --git a/include/core/SkColorFilter.h b/include/core/SkColorFilter.h
index 211aae6962..aece22e05a 100644
--- a/include/core/SkColorFilter.h
+++ b/include/core/SkColorFilter.h
@@ -81,6 +81,10 @@ public:
*/
virtual uint32_t getFlags() const { return 0; }
+ bool supports4f() const {
+ return SkToBool(this->getFlags() & kSupports4f_Flag);
+ }
+
/**
* If this subclass can optimally createa composition with the inner filter, return it as
* a new filter (which the caller must unref() when it is done). If no such optimization
diff --git a/include/core/SkShader.h b/include/core/SkShader.h
index bf6d6ddb42..297091d542 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -121,6 +121,10 @@ public:
*/
virtual uint32_t getFlags() const { return 0; }
+ bool supports4f() const {
+ return SkToBool(this->getFlags() & kSupports4f_Flag);
+ }
+
/**
* Called for each span of the object being drawn. Your subclass should
* set the appropriate colors (with premultiplied alpha) that correspond