Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: src/effects/SkMergeImageFilter.cpp

Issue 1612953004: Image filters: Make a recursive, forward-mapping bounds traversal. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkTileImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkTileImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698