| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkLocalMatrixImageFilter.h" | 8 #include "SkLocalMatrixImageFilter.h" |
| 9 #include "SkReadBuffer.h" | 9 #include "SkReadBuffer.h" |
| 10 #include "SkSpecialImage.h" | 10 #include "SkSpecialImage.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 } | 38 } |
| 39 | 39 |
| 40 void SkLocalMatrixImageFilter::flatten(SkWriteBuffer& buffer) const { | 40 void SkLocalMatrixImageFilter::flatten(SkWriteBuffer& buffer) const { |
| 41 this->INHERITED::flatten(buffer); | 41 this->INHERITED::flatten(buffer); |
| 42 buffer.writeMatrix(fLocalM); | 42 buffer.writeMatrix(fLocalM); |
| 43 } | 43 } |
| 44 | 44 |
| 45 sk_sp<SkSpecialImage> SkLocalMatrixImageFilter::onFilterImage(SkSpecialImage* so
urce, | 45 sk_sp<SkSpecialImage> SkLocalMatrixImageFilter::onFilterImage(SkSpecialImage* so
urce, |
| 46 const Context& ctx
, | 46 const Context& ctx
, |
| 47 SkIPoint* offset)
const { | 47 SkIPoint* offset)
const { |
| 48 Context localCtx(SkMatrix::Concat(ctx.ctm(), fLocalM), ctx.clipBounds(), ctx
.cache()); | 48 Context localCtx(SkMatrix::Concat(ctx.ctm(), fLocalM), ctx.clipBounds(), ctx
.cache(), |
| 49 ctx.outputProperties()); |
| 49 return this->filterInput(0, source, localCtx, offset); | 50 return this->filterInput(0, source, localCtx, offset); |
| 50 } | 51 } |
| 51 | 52 |
| 52 SkIRect SkLocalMatrixImageFilter::onFilterBounds(const SkIRect& src, const SkMat
rix& matrix, | 53 SkIRect SkLocalMatrixImageFilter::onFilterBounds(const SkIRect& src, const SkMat
rix& matrix, |
| 53 MapDirection direction) const { | 54 MapDirection direction) const { |
| 54 return this->getInput(0)->filterBounds(src, SkMatrix::Concat(matrix, fLocalM
), direction); | 55 return this->getInput(0)->filterBounds(src, SkMatrix::Concat(matrix, fLocalM
), direction); |
| 55 } | 56 } |
| 56 | 57 |
| 57 #ifndef SK_IGNORE_TO_STRING | 58 #ifndef SK_IGNORE_TO_STRING |
| 58 void SkLocalMatrixImageFilter::toString(SkString* str) const { | 59 void SkLocalMatrixImageFilter::toString(SkString* str) const { |
| 59 str->append("SkLocalMatrixImageFilter: ("); | 60 str->append("SkLocalMatrixImageFilter: ("); |
| 60 str->append(")"); | 61 str->append(")"); |
| 61 } | 62 } |
| 62 #endif | 63 #endif |
| OLD | NEW |