| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkTileImageFilter.h" | 8 #include "SkTileImageFilter.h" |
| 9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| 11 #include "SkDevice.h" | 11 #include "SkDevice.h" |
| 12 #include "SkReadBuffer.h" | 12 #include "SkReadBuffer.h" |
| 13 #include "SkWriteBuffer.h" | 13 #include "SkWriteBuffer.h" |
| 14 #include "SkMatrix.h" | 14 #include "SkMatrix.h" |
| 15 #include "SkPaint.h" | 15 #include "SkPaint.h" |
| 16 #include "SkShader.h" | 16 #include "SkShader.h" |
| 17 #include "SkValidationUtils.h" | 17 #include "SkValidationUtils.h" |
| 18 | 18 |
| 19 bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, const S
kMatrix& ctm, | 19 bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, const S
kMatrix& ctm, |
| 20 SkBitmap* dst, SkIPoint* offset) { | 20 SkBitmap* dst, SkIPoint* offset) const { |
| 21 SkBitmap source = src; | 21 SkBitmap source = src; |
| 22 SkImageFilter* input = getInput(0); | 22 SkImageFilter* input = getInput(0); |
| 23 SkIPoint srcOffset = SkIPoint::Make(0, 0); | 23 SkIPoint srcOffset = SkIPoint::Make(0, 0); |
| 24 if (input && !input->filterImage(proxy, src, ctm, &source, &srcOffset)) { | 24 if (input && !input->filterImage(proxy, src, ctm, &source, &srcOffset)) { |
| 25 return false; | 25 return false; |
| 26 } | 26 } |
| 27 | 27 |
| 28 SkRect dstRect; | 28 SkRect dstRect; |
| 29 ctm.mapRect(&dstRect, fDstRect); | 29 ctm.mapRect(&dstRect, fDstRect); |
| 30 SkIRect dstIRect; | 30 SkIRect dstIRect; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 buffer.readRect(&fSrcRect); | 79 buffer.readRect(&fSrcRect); |
| 80 buffer.readRect(&fDstRect); | 80 buffer.readRect(&fDstRect); |
| 81 buffer.validate(buffer.isValid() && SkIsValidRect(fSrcRect) && SkIsValidRect
(fDstRect)); | 81 buffer.validate(buffer.isValid() && SkIsValidRect(fSrcRect) && SkIsValidRect
(fDstRect)); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void SkTileImageFilter::flatten(SkWriteBuffer& buffer) const { | 84 void SkTileImageFilter::flatten(SkWriteBuffer& buffer) const { |
| 85 this->INHERITED::flatten(buffer); | 85 this->INHERITED::flatten(buffer); |
| 86 buffer.writeRect(fSrcRect); | 86 buffer.writeRect(fSrcRect); |
| 87 buffer.writeRect(fDstRect); | 87 buffer.writeRect(fDstRect); |
| 88 } | 88 } |
| OLD | NEW |