diff options
author | Mike Reed <reed@google.com> | 2017-06-09 10:29:40 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-09 17:29:08 +0000 |
commit | a6aaa30359ea17f6bd61242695c788dc3707764f (patch) | |
tree | 31c545a0c4cd89913cf50d49dbe828c6f1f3343e | |
parent | 019f6c0bcf611fec93913315708eba1633857efa (diff) |
SkShader::asACompose is android-only
Bug: skia:
Change-Id: Ib99a7ee4984544f342699fa6b20797c55be7d5a0
Reviewed-on: https://skia-review.googlesource.com/19268
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
-rw-r--r-- | include/core/SkShader.h | 11 | ||||
-rw-r--r-- | src/shaders/SkComposeShader.cpp | 2 | ||||
-rw-r--r-- | src/shaders/SkComposeShader.h | 2 |
3 files changed, 6 insertions, 9 deletions
diff --git a/include/core/SkShader.h b/include/core/SkShader.h index daed2ba718..61da334490 100644 --- a/include/core/SkShader.h +++ b/include/core/SkShader.h @@ -157,21 +157,14 @@ public: virtual GradientType asAGradient(GradientInfo* info) const; - /** - * If the shader subclass is composed of two shaders, return true, and if rec is not NULL, - * fill it out with info about the shader. - * - * These are bare pointers; the ownership and reference count are unchanged. - */ - - // TODO: clean up clients, move to SkShaderBase. +#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK struct ComposeRec { const SkShader* fShaderA; const SkShader* fShaderB; SkBlendMode fBlendMode; }; - virtual bool asACompose(ComposeRec*) const { return false; } +#endif ////////////////////////////////////////////////////////////////////////// // Methods to create combinations or variants of shaders diff --git a/src/shaders/SkComposeShader.cpp b/src/shaders/SkComposeShader.cpp index 3155784338..1eae163c97 100644 --- a/src/shaders/SkComposeShader.cpp +++ b/src/shaders/SkComposeShader.cpp @@ -69,6 +69,7 @@ sk_sp<SkShader> SkComposeShader::onMakeColorSpace(SkColorSpaceXformer* xformer) fMode, fLerpT); } +#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK bool SkComposeShader::asACompose(ComposeRec* rec) const { if (!this->isJustMode()) { return false; @@ -81,6 +82,7 @@ bool SkComposeShader::asACompose(ComposeRec* rec) const { } return true; } +#endif bool SkComposeShader::onAppendStages(SkRasterPipeline* pipeline, SkColorSpace* dstCS, SkArenaAlloc* alloc, const SkMatrix& ctm, diff --git a/src/shaders/SkComposeShader.h b/src/shaders/SkComposeShader.h index 03861009a9..a3b5b21db8 100644 --- a/src/shaders/SkComposeShader.h +++ b/src/shaders/SkComposeShader.h @@ -31,7 +31,9 @@ public: SkShader* getShaderB() { return fShaderB.get(); } #endif +#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK bool asACompose(ComposeRec* rec) const override; +#endif SK_TO_STRING_OVERRIDE() SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposeShader) |