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

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

Issue 1709753002: Mark existing image filter entry points that will be going away with Deprecated (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT 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/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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 this->initModes(modes); 48 this->initModes(modes);
49 } 49 }
50 50
51 SkMergeImageFilter::~SkMergeImageFilter() { 51 SkMergeImageFilter::~SkMergeImageFilter() {
52 52
53 if (fModes != SkTCast<uint8_t*>(fStorage)) { 53 if (fModes != SkTCast<uint8_t*>(fStorage)) {
54 sk_free(fModes); 54 sk_free(fModes);
55 } 55 }
56 } 56 }
57 57
58 bool SkMergeImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, 58 bool SkMergeImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& s rc,
59 const Context& ctx, 59 const Context& ctx,
60 SkBitmap* result, SkIPoint* offset) const { 60 SkBitmap* result, SkIPoint* off set) const {
61 int inputCount = this->countInputs(); 61 int inputCount = this->countInputs();
62 if (inputCount < 1) { 62 if (inputCount < 1) {
63 return false; 63 return false;
64 } 64 }
65 65
66 SkIRect bounds; 66 SkIRect bounds;
67 67
68 SkAutoTDeleteArray<SkBitmap> inputs(new SkBitmap[inputCount]); 68 SkAutoTDeleteArray<SkBitmap> inputs(new SkBitmap[inputCount]);
69 SkAutoTDeleteArray<SkIPoint> offsets(new SkIPoint[inputCount]); 69 SkAutoTDeleteArray<SkIPoint> offsets(new SkIPoint[inputCount]);
70 bool didProduceResult = false; 70 bool didProduceResult = false;
71 71
72 // Filter all of the inputs. 72 // Filter all of the inputs.
73 for (int i = 0; i < inputCount; ++i) { 73 for (int i = 0; i < inputCount; ++i) {
74 inputs[i] = src; 74 inputs[i] = src;
75 offsets[i].setZero(); 75 offsets[i].setZero();
76 if (!this->filterInput(i, proxy, src, ctx, &inputs[i], &offsets[i])) { 76 if (!this->filterInputDeprecated(i, proxy, src, ctx, &inputs[i], &offset s[i])) {
77 inputs[i].reset(); 77 inputs[i].reset();
78 continue; 78 continue;
79 } 79 }
80 SkIRect srcBounds; 80 SkIRect srcBounds;
81 inputs[i].getBounds(&srcBounds); 81 inputs[i].getBounds(&srcBounds);
82 srcBounds.offset(offsets[i]); 82 srcBounds.offset(offsets[i]);
83 if (!didProduceResult) { 83 if (!didProduceResult) {
84 bounds = srcBounds; 84 bounds = srcBounds;
85 didProduceResult = true; 85 didProduceResult = true;
86 } else { 86 } else {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 for (int i = 0; i < this->countInputs(); ++i) { 164 for (int i = 0; i < this->countInputs(); ++i) {
165 SkImageFilter* filter = this->getInput(i); 165 SkImageFilter* filter = this->getInput(i);
166 str->appendf("%d: (", i); 166 str->appendf("%d: (", i);
167 filter->toString(str); 167 filter->toString(str);
168 str->appendf(")"); 168 str->appendf(")");
169 } 169 }
170 170
171 str->append(")"); 171 str->append(")");
172 } 172 }
173 #endif 173 #endif
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