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

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

Issue 1702683002: Image filters: change applyCropRect() to take a src rect. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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/SkBlurImageFilter.cpp ('k') | src/effects/SkDisplacementMapEffect.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 "SkColorFilterImageFilter.h" 8 #include "SkColorFilterImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 const Context& ctx, 59 const Context& ctx,
60 SkBitmap* result, 60 SkBitmap* result,
61 SkIPoint* offset) const { 61 SkIPoint* offset) const {
62 SkBitmap src = source; 62 SkBitmap src = source;
63 SkIPoint srcOffset = SkIPoint::Make(0, 0); 63 SkIPoint srcOffset = SkIPoint::Make(0, 0);
64 if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) { 64 if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) {
65 return false; 65 return false;
66 } 66 }
67 67
68 SkIRect bounds; 68 SkIRect bounds;
69 if (!this->applyCropRect(ctx, src, srcOffset, &bounds)) { 69 SkIRect srcBounds = src.bounds();
70 srcBounds.offset(srcOffset);
71 if (!this->applyCropRect(ctx, srcBounds, &bounds)) {
70 return false; 72 return false;
71 } 73 }
72 74
73 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bounds .height())); 75 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bounds .height()));
74 if (nullptr == device.get()) { 76 if (nullptr == device.get()) {
75 return false; 77 return false;
76 } 78 }
77 SkCanvas canvas(device.get()); 79 SkCanvas canvas(device.get());
78 SkPaint paint; 80 SkPaint paint;
79 81
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 if (this->getInput(0)) { 117 if (this->getInput(0)) {
116 this->getInput(0)->toString(str); 118 this->getInput(0)->toString(str);
117 } 119 }
118 120
119 str->appendf(") color filter: "); 121 str->appendf(") color filter: ");
120 fColorFilter->toString(str); 122 fColorFilter->toString(str);
121 123
122 str->append(")"); 124 str->append(")");
123 } 125 }
124 #endif 126 #endif
OLDNEW
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698