OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 The Android Open Source Project |
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 "SkMergeImageFilter.h" | 8 #include "SkMergeImageFilter.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkDevice.h" | 10 #include "SkDevice.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 didProduceResult = true; | 85 didProduceResult = true; |
86 } else { | 86 } else { |
87 bounds.join(srcBounds); | 87 bounds.join(srcBounds); |
88 } | 88 } |
89 } | 89 } |
90 if (!didProduceResult) { | 90 if (!didProduceResult) { |
91 return false; | 91 return false; |
92 } | 92 } |
93 | 93 |
94 // Apply the crop rect to the union of the inputs' bounds. | 94 // Apply the crop rect to the union of the inputs' bounds. |
95 if (!this->getCropRect().applyTo(bounds, ctx, &bounds)) { | 95 this->getCropRect().applyTo(bounds, ctx.ctm(), &bounds); |
| 96 if (!bounds.intersect(ctx.clipBounds())) { |
96 return false; | 97 return false; |
97 } | 98 } |
98 | 99 |
99 const int x0 = bounds.left(); | 100 const int x0 = bounds.left(); |
100 const int y0 = bounds.top(); | 101 const int y0 = bounds.top(); |
101 | 102 |
102 // Allocate the destination buffer. | 103 // Allocate the destination buffer. |
103 SkAutoTUnref<SkBaseDevice> dst(proxy->createDevice(bounds.width(), bounds.he
ight())); | 104 SkAutoTUnref<SkBaseDevice> dst(proxy->createDevice(bounds.width(), bounds.he
ight())); |
104 if (nullptr == dst) { | 105 if (nullptr == dst) { |
105 return false; | 106 return false; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 for (int i = 0; i < this->countInputs(); ++i) { | 164 for (int i = 0; i < this->countInputs(); ++i) { |
164 SkImageFilter* filter = this->getInput(i); | 165 SkImageFilter* filter = this->getInput(i); |
165 str->appendf("%d: (", i); | 166 str->appendf("%d: (", i); |
166 filter->toString(str); | 167 filter->toString(str); |
167 str->appendf(")"); | 168 str->appendf(")"); |
168 } | 169 } |
169 | 170 |
170 str->append(")"); | 171 str->append(")"); |
171 } | 172 } |
172 #endif | 173 #endif |
OLD | NEW |