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" |
(...skipping 17 matching lines...) Expand all Loading... |
28 return SkSafeRef(input); | 28 return SkSafeRef(input); |
29 } | 29 } |
30 CropRect cropRect(ir); | 30 CropRect cropRect(ir); |
31 return SkOffsetImageFilter::Create(dstRect.x() - srcRect.x(), | 31 return SkOffsetImageFilter::Create(dstRect.x() - srcRect.x(), |
32 dstRect.y() - srcRect.y(), | 32 dstRect.y() - srcRect.y(), |
33 input, &cropRect); | 33 input, &cropRect); |
34 } | 34 } |
35 return new SkTileImageFilter(srcRect, dstRect, input); | 35 return new SkTileImageFilter(srcRect, dstRect, input); |
36 } | 36 } |
37 | 37 |
38 bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, | 38 bool SkTileImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& sr
c, |
39 const Context& ctx, | 39 const Context& ctx, |
40 SkBitmap* dst, SkIPoint* offset) const { | 40 SkBitmap* dst, SkIPoint* offset)
const { |
41 SkBitmap source = src; | 41 SkBitmap source = src; |
42 SkIPoint srcOffset = SkIPoint::Make(0, 0); | 42 SkIPoint srcOffset = SkIPoint::Make(0, 0); |
43 if (!this->filterInput(0, proxy, src, ctx, &source, &srcOffset)) { | 43 if (!this->filterInputDeprecated(0, proxy, src, ctx, &source, &srcOffset)) { |
44 return false; | 44 return false; |
45 } | 45 } |
46 | 46 |
47 SkRect dstRect; | 47 SkRect dstRect; |
48 ctx.ctm().mapRect(&dstRect, fDstRect); | 48 ctx.ctm().mapRect(&dstRect, fDstRect); |
49 if (!dstRect.intersect(SkRect::Make(ctx.clipBounds()))) { | 49 if (!dstRect.intersect(SkRect::Make(ctx.clipBounds()))) { |
50 offset->fX = offset->fY = 0; | 50 offset->fX = offset->fY = 0; |
51 return true; | 51 return true; |
52 } | 52 } |
53 const SkIRect dstIRect = dstRect.roundOut(); | 53 const SkIRect dstIRect = dstRect.roundOut(); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 str->appendf(" dst: %.2f %.2f %.2f %.2f", | 148 str->appendf(" dst: %.2f %.2f %.2f %.2f", |
149 fDstRect.fLeft, fDstRect.fTop, fDstRect.fRight, fDstRect.fBotto
m); | 149 fDstRect.fLeft, fDstRect.fTop, fDstRect.fRight, fDstRect.fBotto
m); |
150 if (this->getInput(0)) { | 150 if (this->getInput(0)) { |
151 str->appendf("input: ("); | 151 str->appendf("input: ("); |
152 this->getInput(0)->toString(str); | 152 this->getInput(0)->toString(str); |
153 str->appendf(")"); | 153 str->appendf(")"); |
154 } | 154 } |
155 str->append(")"); | 155 str->append(")"); |
156 } | 156 } |
157 #endif | 157 #endif |
OLD | NEW |