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

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

Issue 1848953002: Image filters: optimize crop rect application (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT Created 4 years, 8 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
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 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 continue; 78 continue;
79 } 79 }
80 const SkIRect inputBounds = SkIRect::MakeXYWH(offsets[i].fX, offsets[i]. fY, 80 const SkIRect inputBounds = SkIRect::MakeXYWH(offsets[i].fX, offsets[i]. fY,
81 inputs[i]->width(), inputs [i]->height()); 81 inputs[i]->width(), inputs [i]->height());
82 bounds.join(inputBounds); 82 bounds.join(inputBounds);
83 } 83 }
84 if (bounds.isEmpty()) { 84 if (bounds.isEmpty()) {
85 return nullptr; 85 return nullptr;
86 } 86 }
87 87
88 // Apply the crop rect to the union of the inputs' bounds. 88 // Apply the crop rect to the union of the inputs' bounds.
robertphillips 2016/04/01 19:58:08 // add a comment about why this is 'false' ?
Stephen White 2016/04/01 21:26:35 Changed it to pass this->affectsTransparentBlack()
89 this->getCropRect().applyTo(bounds, ctx.ctm(), &bounds); 89 this->getCropRect().applyTo(bounds, ctx.ctm(), false, &bounds);
90 if (!bounds.intersect(ctx.clipBounds())) { 90 if (!bounds.intersect(ctx.clipBounds())) {
91 return nullptr; 91 return nullptr;
92 } 92 }
93 93
94 const int x0 = bounds.left(); 94 const int x0 = bounds.left();
95 const int y0 = bounds.top(); 95 const int y0 = bounds.top();
96 96
97 SkImageInfo info = SkImageInfo::MakeN32(bounds.width(), bounds.height(), 97 SkImageInfo info = SkImageInfo::MakeN32(bounds.width(), bounds.height(),
98 kPremul_SkAlphaType); 98 kPremul_SkAlphaType);
99 99
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 for (int i = 0; i < this->countInputs(); ++i) { 169 for (int i = 0; i < this->countInputs(); ++i) {
170 SkImageFilter* filter = this->getInput(i); 170 SkImageFilter* filter = this->getInput(i);
171 str->appendf("%d: (", i); 171 str->appendf("%d: (", i);
172 filter->toString(str); 172 filter->toString(str);
173 str->appendf(")"); 173 str->appendf(")");
174 } 174 }
175 175
176 str->append(")"); 176 str->append(")");
177 } 177 }
178 #endif 178 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698