diff options
author | Mike Reed <reed@google.com> | 2017-08-08 16:29:22 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-08 21:32:42 +0000 |
commit | 3404207e2418e791231e36d2848e9137d6c73cad (patch) | |
tree | 23a56e88ce668387eea71137f96b2dd56c6aff36 /src/shaders/SkShaderBase.h | |
parent | 4d011bef0adb7f7bf52e96364a02b2af1312255b (diff) |
use rasterpipeline for images if matrix is >= scale+translate
Bug: skia:
Change-Id: I36112fe54c6f2d0965d0b88f0291d7ffe0902715
Reviewed-on: https://skia-review.googlesource.com/30480
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'src/shaders/SkShaderBase.h')
-rw-r--r-- | src/shaders/SkShaderBase.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/shaders/SkShaderBase.h b/src/shaders/SkShaderBase.h index 783fff4db5..99cace22f9 100644 --- a/src/shaders/SkShaderBase.h +++ b/src/shaders/SkShaderBase.h @@ -187,9 +187,10 @@ public: return this->onMakeColorSpace(xformer); } - bool isRasterPipelineOnly() const { + bool isRasterPipelineOnly(const SkMatrix& ctm) const { // We always use RP when perspective is present. - return fLocalMatrix.hasPerspective() || this->onIsRasterPipelineOnly(); + return ctm.hasPerspective() || fLocalMatrix.hasPerspective() + || this->onIsRasterPipelineOnly(ctm); } // If this returns false, then we draw nothing (do not fall back to shader context) @@ -247,7 +248,7 @@ protected: virtual bool onAppendStages(SkRasterPipeline*, SkColorSpace* dstCS, SkArenaAlloc*, const SkMatrix&, const SkPaint&, const SkMatrix* localM) const; - virtual bool onIsRasterPipelineOnly() const { return false; } + virtual bool onIsRasterPipelineOnly(const SkMatrix& ctm) const { return false; } private: // This is essentially const, but not officially so it can be modified in constructors. |