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

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

Issue 1893973002: Outline SkImageFilter Make methods (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 4 years, 8 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/SkDropShadowImageFilter.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 "SkComposeImageFilter.h" 8 #include "SkComposeImageFilter.h"
9 9
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
11 #include "SkSpecialImage.h" 11 #include "SkSpecialImage.h"
12 #include "SkWriteBuffer.h" 12 #include "SkWriteBuffer.h"
13 13
14 sk_sp<SkImageFilter> SkComposeImageFilter::Make(sk_sp<SkImageFilter> outer,
15 sk_sp<SkImageFilter> inner) {
16 if (!outer) {
17 return inner;
18 }
19 if (!inner) {
20 return outer;
21 }
22 sk_sp<SkImageFilter> inputs[2] = { std::move(outer), std::move(inner) };
23 return sk_sp<SkImageFilter>(new SkComposeImageFilter(inputs));
24 }
14 25
15 SkRect SkComposeImageFilter::computeFastBounds(const SkRect& src) const { 26 SkRect SkComposeImageFilter::computeFastBounds(const SkRect& src) const {
16 SkImageFilter* outer = this->getInput(0); 27 SkImageFilter* outer = this->getInput(0);
17 SkImageFilter* inner = this->getInput(1); 28 SkImageFilter* inner = this->getInput(1);
18 29
19 return outer->computeFastBounds(inner->computeFastBounds(src)); 30 return outer->computeFastBounds(inner->computeFastBounds(src));
20 } 31 }
21 32
22 sk_sp<SkSpecialImage> SkComposeImageFilter::onFilterImage(SkSpecialImage* source , 33 sk_sp<SkSpecialImage> SkComposeImageFilter::onFilterImage(SkSpecialImage* source ,
23 const Context& ctx, 34 const Context& ctx,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 83
73 str->appendf("outer: "); 84 str->appendf("outer: ");
74 outer->toString(str); 85 outer->toString(str);
75 86
76 str->appendf("inner: "); 87 str->appendf("inner: ");
77 inner->toString(str); 88 inner->toString(str);
78 89
79 str->appendf(")"); 90 str->appendf(")");
80 } 91 }
81 #endif 92 #endif
OLDNEW
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkDropShadowImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698