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 19 matching lines...) Expand all Loading... |
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 SkIRect clipBounds = ctx.clipBounds(); | 38 SkIRect clipBounds = ctx.clipBounds(); |
39 clipBounds.offset(-innerOffset.x(), -innerOffset.y()); | 39 clipBounds.offset(-innerOffset.x(), -innerOffset.y()); |
40 Context outerContext(outerMatrix, clipBounds, ctx.cache(), ctx.sizeConstrain
t()); | 40 Context outerContext(outerMatrix, clipBounds, ctx.cache()); |
41 if (!this->filterInput(0, proxy, tmp, outerContext, result, &outerOffset, fa
lse)) { | 41 if (!this->filterInput(0, proxy, tmp, outerContext, result, &outerOffset)) { |
42 return false; | 42 return false; |
43 } | 43 } |
44 | 44 |
45 *offset = innerOffset + outerOffset; | 45 *offset = innerOffset + outerOffset; |
46 return true; | 46 return true; |
47 } | 47 } |
48 | 48 |
49 bool SkComposeImageFilter::onFilterBounds(const SkIRect& src, | 49 bool SkComposeImageFilter::onFilterBounds(const SkIRect& src, |
50 const SkMatrix& ctm, | 50 const SkMatrix& ctm, |
51 SkIRect* dst) const { | 51 SkIRect* dst) const { |
(...skipping 18 matching lines...) Expand all Loading... |
70 | 70 |
71 str->appendf("outer: "); | 71 str->appendf("outer: "); |
72 outer->toString(str); | 72 outer->toString(str); |
73 | 73 |
74 str->appendf("inner: "); | 74 str->appendf("inner: "); |
75 inner->toString(str); | 75 inner->toString(str); |
76 | 76 |
77 str->appendf(")"); | 77 str->appendf(")"); |
78 } | 78 } |
79 #endif | 79 #endif |
OLD | NEW |