diff options
author | reed <reed@chromium.org> | 2016-01-23 10:15:39 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-23 10:15:39 -0800 |
commit | fac684502b6047ffc7dc2e59bd7e5a7cbfa5bf78 (patch) | |
tree | 998fc0005b8d04c1fd27422d0c78afd55383c454 /include/core | |
parent | 55d49053d1b6db42e013eb3409ffcfc7e235c685 (diff) |
expand unitests for color4f
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1622893002
TBR=
Review URL: https://codereview.chromium.org/1622893002
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkColor.h | 2 | ||||
-rw-r--r-- | include/core/SkColorFilter.h | 4 | ||||
-rw-r--r-- | include/core/SkShader.h | 4 |
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 |