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

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

Issue 920513003: Make filters use SkImage instead of SkBitmap Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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
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 bool SkComposeImageFilter::onFilterImage(Proxy* proxy, 16 bool SkComposeImageFilter::onFilterImage(Proxy* proxy,
17 const SkBitmap& src, 17 SkImage& src,
18 const Context& ctx, 18 const Context& ctx,
19 SkBitmap* result, 19 SkAutoTUnref<SkImage>& result,
20 SkIPoint* offset) const { 20 SkIPoint* offset) const {
21 SkImageFilter* outer = getInput(0); 21 SkImageFilter* outer = getInput(0);
22 SkImageFilter* inner = getInput(1); 22 SkImageFilter* inner = getInput(1);
23 23
24 SkBitmap tmp; 24 SkAutoTUnref<SkImage> tmp;
25 return inner->filterImage(proxy, src, ctx, &tmp, offset) && 25 return inner->filterImage(proxy, src, ctx, tmp, offset) &&
26 outer->filterImage(proxy, tmp, ctx, result, offset); 26 outer->filterImage(proxy, *tmp, ctx, result, offset);
27 } 27 }
28 28
29 bool SkComposeImageFilter::onFilterBounds(const SkIRect& src, 29 bool SkComposeImageFilter::onFilterBounds(const SkIRect& src,
30 const SkMatrix& ctm, 30 const SkMatrix& ctm,
31 SkIRect* dst) const { 31 SkIRect* dst) const {
32 SkImageFilter* outer = getInput(0); 32 SkImageFilter* outer = getInput(0);
33 SkImageFilter* inner = getInput(1); 33 SkImageFilter* inner = getInput(1);
34 34
35 SkIRect tmp; 35 SkIRect tmp;
36 return inner->filterBounds(src, ctm, &tmp) && outer->filterBounds(tmp, ctm, dst); 36 return inner->filterBounds(src, ctm, &tmp) && outer->filterBounds(tmp, ctm, dst);
(...skipping 13 matching lines...) Expand all
50 50
51 str->appendf("outer: "); 51 str->appendf("outer: ");
52 outer->toString(str); 52 outer->toString(str);
53 53
54 str->appendf("inner: "); 54 str->appendf("inner: ");
55 inner->toString(str); 55 inner->toString(str);
56 56
57 str->appendf(")"); 57 str->appendf(")");
58 } 58 }
59 #endif 59 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698