Chromium Code Reviews| Index: src/core/SkImageFilter.cpp |
| diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp |
| index 4128ba6cc20199f4489debfeb11a09add85609bc..6c73be29b59ff7bb0c5f7550b874854474c34853 100644 |
| --- a/src/core/SkImageFilter.cpp |
| +++ b/src/core/SkImageFilter.cpp |
| @@ -330,6 +330,24 @@ bool SkImageFilter::asAColorFilter(SkColorFilter** filterPtr) const { |
| return true; |
| } |
| +bool SkImageFilter::onCanHandleAffine() const { |
|
Stephen White
2016/04/25 14:09:34
Wouldn't it be simpler to have (non-virtual) canHa
reed1
2016/04/25 14:13:35
Good idea! See follow-on CL https://codereview.chr
|
| + bool hasInputs = false; |
| + |
| + const int count = this->countInputs(); |
| + for (int i = 0; i < count; ++i) { |
| + SkImageFilter* input = this->getInput(i); |
| + if (input) { |
| + if (!input->canHandleAffine()) { |
| + return false; |
| + } |
| + hasInputs = true; |
| + } |
| + } |
| + // We return true iff we had 1 or more inputs, and all of them can handle affine. |
| + // If we have no inputs, or 1 or more of them do not handle affine, then we return false. |
|
Stephen White
2016/04/25 14:09:34
Why would a null input imply we can't handle affin
|
| + return hasInputs; |
| +} |
| + |
| bool SkImageFilter::applyCropRect(const Context& ctx, const SkIRect& srcBounds, |
| SkIRect* dstBounds) const { |
| SkIRect temp = this->onFilterNodeBounds(srcBounds, ctx.ctm(), kForward_MapDirection); |