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

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

Issue 22438003: Move SkComposeImageFilter into its own {.h, .cpp} files (Closed) Base URL: http://skia.googlecode.com/svn/trunk
Patch Set: Fix nit Created 7 years, 4 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 | « include/effects/SkTestImageFilters.h ('k') | src/effects/SkTestImageFilters.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "SkBitmap.h"
9 #include "SkComposeImageFilter.h"
10 #include "SkFlattenableBuffers.h"
11
12 SkComposeImageFilter::~SkComposeImageFilter() {
13 }
14
15 bool SkComposeImageFilter::onFilterImage(Proxy* proxy,
16 const SkBitmap& src,
17 const SkMatrix& ctm,
18 SkBitmap* result,
19 SkIPoint* loc) {
20 SkImageFilter* outer = getInput(0);
21 SkImageFilter* inner = getInput(1);
22
23 if (!outer && !inner) {
24 return false;
25 }
26
27 if (!outer || !inner) {
28 return (outer ? outer : inner)->filterImage(proxy, src, ctm, result, loc );
29 }
30
31 SkBitmap tmp;
32 return inner->filterImage(proxy, src, ctm, &tmp, loc) &&
33 outer->filterImage(proxy, tmp, ctm, result, loc);
34 }
35
36 bool SkComposeImageFilter::onFilterBounds(const SkIRect& src,
37 const SkMatrix& ctm,
38 SkIRect* dst) {
39 SkImageFilter* outer = getInput(0);
40 SkImageFilter* inner = getInput(1);
41
42 if (!outer && !inner) {
43 return false;
44 }
45
46 if (!outer || !inner) {
47 return (outer ? outer : inner)->filterBounds(src, ctm, dst);
48 }
49
50 SkIRect tmp;
51 return inner->filterBounds(src, ctm, &tmp) &&
52 outer->filterBounds(tmp, ctm, dst);
53 }
54
55 SkComposeImageFilter::SkComposeImageFilter(SkFlattenableReadBuffer& buffer) : IN HERITED(buffer) {
56 }
OLDNEW
« no previous file with comments | « include/effects/SkTestImageFilters.h ('k') | src/effects/SkTestImageFilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698