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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkComposeImageFilter.h" | 9 #include "SkComposeImageFilter.h" |
10 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 SkBitmap* result, | 28 SkBitmap* result, |
29 SkIPoint* offset) const { | 29 SkIPoint* offset) const { |
30 SkBitmap tmp; | 30 SkBitmap tmp; |
31 SkIPoint innerOffset = SkIPoint::Make(0, 0); | 31 SkIPoint innerOffset = SkIPoint::Make(0, 0); |
32 SkIPoint outerOffset = SkIPoint::Make(0, 0); | 32 SkIPoint outerOffset = SkIPoint::Make(0, 0); |
33 if (!this->filterInput(1, proxy, src, ctx, &tmp, &innerOffset)) | 33 if (!this->filterInput(1, proxy, src, ctx, &tmp, &innerOffset)) |
34 return false; | 34 return false; |
35 | 35 |
36 SkMatrix outerMatrix(ctx.ctm()); | 36 SkMatrix outerMatrix(ctx.ctm()); |
37 outerMatrix.postTranslate(SkIntToScalar(-innerOffset.x()), SkIntToScalar(-in
nerOffset.y())); | 37 outerMatrix.postTranslate(SkIntToScalar(-innerOffset.x()), SkIntToScalar(-in
nerOffset.y())); |
38 Context outerContext(outerMatrix, ctx.clipBounds(), ctx.cache()); | 38 Context outerContext(outerMatrix, ctx.clipBounds(), ctx.cache(), ctx.sizeCon
straint()); |
39 if (!this->filterInput(0, proxy, tmp, outerContext, result, &outerOffset)) { | 39 if (!this->filterInput(0, proxy, tmp, outerContext, result, &outerOffset, fa
lse)) { |
40 return false; | 40 return false; |
41 } | 41 } |
42 | 42 |
43 *offset = innerOffset + outerOffset; | 43 *offset = innerOffset + outerOffset; |
44 return true; | 44 return true; |
45 } | 45 } |
46 | 46 |
47 bool SkComposeImageFilter::onFilterBounds(const SkIRect& src, | 47 bool SkComposeImageFilter::onFilterBounds(const SkIRect& src, |
48 const SkMatrix& ctm, | 48 const SkMatrix& ctm, |
49 SkIRect* dst) const { | 49 SkIRect* dst) const { |
(...skipping 18 matching lines...) Expand all Loading... |
68 | 68 |
69 str->appendf("outer: "); | 69 str->appendf("outer: "); |
70 outer->toString(str); | 70 outer->toString(str); |
71 | 71 |
72 str->appendf("inner: "); | 72 str->appendf("inner: "); |
73 inner->toString(str); | 73 inner->toString(str); |
74 | 74 |
75 str->appendf(")"); | 75 str->appendf(")"); |
76 } | 76 } |
77 #endif | 77 #endif |
OLD | NEW |