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
kImageFilter::Context& ctx, | 19 bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, |
| 20 const Context& ctx, |
20 SkBitmap* dst, SkIPoint* offset) const { | 21 SkBitmap* dst, SkIPoint* offset) const { |
21 SkBitmap source = src; | 22 SkBitmap source = src; |
22 SkImageFilter* input = getInput(0); | 23 SkImageFilter* input = getInput(0); |
23 SkIPoint srcOffset = SkIPoint::Make(0, 0); | 24 SkIPoint srcOffset = SkIPoint::Make(0, 0); |
24 if (input && !input->filterImage(proxy, src, ctx, &source, &srcOffset)) { | 25 if (input && !input->filterImage(proxy, src, ctx, &source, &srcOffset)) { |
25 return false; | 26 return false; |
26 } | 27 } |
27 | 28 |
28 SkRect dstRect; | 29 SkRect dstRect; |
29 ctx.ctm().mapRect(&dstRect, fDstRect); | 30 ctx.ctm().mapRect(&dstRect, fDstRect); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 buffer.readRect(&fSrcRect); | 80 buffer.readRect(&fSrcRect); |
80 buffer.readRect(&fDstRect); | 81 buffer.readRect(&fDstRect); |
81 buffer.validate(buffer.isValid() && SkIsValidRect(fSrcRect) && SkIsValidRect
(fDstRect)); | 82 buffer.validate(buffer.isValid() && SkIsValidRect(fSrcRect) && SkIsValidRect
(fDstRect)); |
82 } | 83 } |
83 | 84 |
84 void SkTileImageFilter::flatten(SkWriteBuffer& buffer) const { | 85 void SkTileImageFilter::flatten(SkWriteBuffer& buffer) const { |
85 this->INHERITED::flatten(buffer); | 86 this->INHERITED::flatten(buffer); |
86 buffer.writeRect(fSrcRect); | 87 buffer.writeRect(fSrcRect); |
87 buffer.writeRect(fDstRect); | 88 buffer.writeRect(fDstRect); |
88 } | 89 } |
OLD | NEW |