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

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

Issue 196353021: Revert "Implement support for expanding crop rects in image filters" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 const Context& ctx, 102 const Context& ctx,
103 SkBitmap* result, 103 SkBitmap* result,
104 SkIPoint* offset) const { 104 SkIPoint* offset) const {
105 SkBitmap src = source; 105 SkBitmap src = source;
106 SkIPoint srcOffset = SkIPoint::Make(0, 0); 106 SkIPoint srcOffset = SkIPoint::Make(0, 0);
107 if (getInput(0) && !getInput(0)->filterImage(proxy, source, ctx, &src, &srcO ffset)) { 107 if (getInput(0) && !getInput(0)->filterImage(proxy, source, ctx, &src, &srcO ffset)) {
108 return false; 108 return false;
109 } 109 }
110 110
111 SkIRect bounds; 111 SkIRect bounds;
112 if (!this->applyCropRect(ctx, src, srcOffset, &bounds)) { 112 src.getBounds(&bounds);
113 bounds.offset(srcOffset);
114 if (!this->applyCropRect(&bounds, ctx.ctm())) {
113 return false; 115 return false;
114 } 116 }
115 117
116 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bounds .height())); 118 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bounds .height()));
117 if (NULL == device.get()) { 119 if (NULL == device.get()) {
118 return false; 120 return false;
119 } 121 }
120 SkCanvas canvas(device.get()); 122 SkCanvas canvas(device.get());
121 SkPaint paint; 123 SkPaint paint;
122 124
(...skipping 10 matching lines...) Expand all
133 bool SkColorFilterImageFilter::asColorFilter(SkColorFilter** filter) const { 135 bool SkColorFilterImageFilter::asColorFilter(SkColorFilter** filter) const {
134 if (!cropRectIsSet()) { 136 if (!cropRectIsSet()) {
135 if (filter) { 137 if (filter) {
136 *filter = fColorFilter; 138 *filter = fColorFilter;
137 fColorFilter->ref(); 139 fColorFilter->ref();
138 } 140 }
139 return true; 141 return true;
140 } 142 }
141 return false; 143 return false;
142 } 144 }
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