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

Side by Side Diff: src/effects/SkComposeImageFilter.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/SkColorFilterImageFilter.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 2013 Google Inc. 2 * Copyright 2013 Google Inc.
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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkComposeImageFilter.h" 9 #include "SkComposeImageFilter.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
11 #include "SkWriteBuffer.h" 11 #include "SkWriteBuffer.h"
12 12
13 SkComposeImageFilter::~SkComposeImageFilter() { 13 SkComposeImageFilter::~SkComposeImageFilter() {
14 } 14 }
15 15
16 void SkComposeImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) con st { 16 void SkComposeImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) con st {
17 SkImageFilter* outer = getInput(0); 17 SkImageFilter* outer = getInput(0);
18 SkImageFilter* inner = getInput(1); 18 SkImageFilter* inner = getInput(1);
19 19
20 SkRect tmp; 20 SkRect tmp;
21 inner->computeFastBounds(src, &tmp); 21 inner->computeFastBounds(src, &tmp);
22 outer->computeFastBounds(tmp, dst); 22 outer->computeFastBounds(tmp, dst);
23 } 23 }
24 24
25 bool SkComposeImageFilter::onFilterImage(Proxy* proxy, 25 bool SkComposeImageFilter::onFilterImageDeprecated(Proxy* proxy,
26 const SkBitmap& src, 26 const SkBitmap& src,
27 const Context& ctx, 27 const Context& ctx,
28 SkBitmap* result, 28 SkBitmap* result,
29 SkIPoint* offset) const { 29 SkIPoint* offset) const {
30 SkBitmap tmp; 30 SkBitmap tmp;
31 SkIPoint innerOffset = SkIPoint::Make(0, 0); 31 SkIPoint innerOffset = SkIPoint::Make(0, 0);
32 SkIPoint outerOffset = SkIPoint::Make(0, 0); 32 SkIPoint outerOffset = SkIPoint::Make(0, 0);
33 if (!this->filterInput(1, proxy, src, ctx, &tmp, &innerOffset)) 33 if (!this->filterInputDeprecated(1, proxy, src, ctx, &tmp, &innerOffset))
34 return false; 34 return false;
35 35
36 SkMatrix outerMatrix(ctx.ctm()); 36 SkMatrix outerMatrix(ctx.ctm());
37 outerMatrix.postTranslate(SkIntToScalar(-innerOffset.x()), SkIntToScalar(-in nerOffset.y())); 37 outerMatrix.postTranslate(SkIntToScalar(-innerOffset.x()), SkIntToScalar(-in nerOffset.y()));
38 SkIRect clipBounds = ctx.clipBounds(); 38 SkIRect clipBounds = ctx.clipBounds();
39 clipBounds.offset(-innerOffset.x(), -innerOffset.y()); 39 clipBounds.offset(-innerOffset.x(), -innerOffset.y());
40 Context outerContext(outerMatrix, clipBounds, ctx.cache()); 40 Context outerContext(outerMatrix, clipBounds, ctx.cache());
41 if (!this->filterInput(0, proxy, tmp, outerContext, result, &outerOffset)) { 41 if (!this->filterInputDeprecated(0, proxy, tmp, outerContext, result, &outer Offset)) {
42 return false; 42 return false;
43 } 43 }
44 44
45 *offset = innerOffset + outerOffset; 45 *offset = innerOffset + outerOffset;
46 return true; 46 return true;
47 } 47 }
48 48
49 bool SkComposeImageFilter::onFilterBounds(const SkIRect& src, 49 bool SkComposeImageFilter::onFilterBounds(const SkIRect& src,
50 const SkMatrix& ctm, 50 const SkMatrix& ctm,
51 SkIRect* dst, 51 SkIRect* dst,
(...skipping 20 matching lines...) Expand all
72 72
73 str->appendf("outer: "); 73 str->appendf("outer: ");
74 outer->toString(str); 74 outer->toString(str);
75 75
76 str->appendf("inner: "); 76 str->appendf("inner: ");
77 inner->toString(str); 77 inner->toString(str);
78 78
79 str->appendf(")"); 79 str->appendf(")");
80 } 80 }
81 #endif 81 #endif
OLDNEW
« no previous file with comments | « src/effects/SkColorFilterImageFilter.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698