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

Side by Side Diff: src/effects/SkMergeImageFilter.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/SkMatrixConvolutionImageFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 67
68 bool SkMergeImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, 68 bool SkMergeImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
69 const Context& ctx, 69 const Context& ctx,
70 SkBitmap* result, SkIPoint* offset) const { 70 SkBitmap* result, SkIPoint* offset) const {
71 if (countInputs() < 1) { 71 if (countInputs() < 1) {
72 return false; 72 return false;
73 } 73 }
74 74
75 SkIRect bounds; 75 SkIRect bounds;
76 if (!this->applyCropRect(ctx, src, SkIPoint::Make(0, 0), &bounds)) { 76 src.getBounds(&bounds);
77 if (!this->applyCropRect(&bounds, ctx.ctm())) {
77 return false; 78 return false;
78 } 79 }
79 80
80 const int x0 = bounds.left(); 81 const int x0 = bounds.left();
81 const int y0 = bounds.top(); 82 const int y0 = bounds.top();
82 83
83 SkAutoTUnref<SkBaseDevice> dst(proxy->createDevice(bounds.width(), bounds.he ight())); 84 SkAutoTUnref<SkBaseDevice> dst(proxy->createDevice(bounds.width(), bounds.he ight()));
84 if (NULL == dst) { 85 if (NULL == dst) {
85 return false; 86 return false;
86 } 87 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 if (buffer.validate(buffer.getArrayCount() == size) && 137 if (buffer.validate(buffer.getArrayCount() == size) &&
137 buffer.readByteArray(fModes, size)) { 138 buffer.readByteArray(fModes, size)) {
138 for (int i = 0; i < nbInputs; ++i) { 139 for (int i = 0; i < nbInputs; ++i) {
139 buffer.validate(SkIsValidMode((SkXfermode::Mode)fModes[i])); 140 buffer.validate(SkIsValidMode((SkXfermode::Mode)fModes[i]));
140 } 141 }
141 } 142 }
142 } else { 143 } else {
143 fModes = 0; 144 fModes = 0;
144 } 145 }
145 } 146 }
OLDNEW
« no previous file with comments | « src/effects/SkMatrixConvolutionImageFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698