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

Side by Side Diff: include/effects/SkDisplacementMapEffect.h

Issue 137423005: Implement a computeFastBounds() traversal for SkImageFilter. This allows for correct culling of pri… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix Win build; update to ToT Created 6 years, 11 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/SkBlurImageFilter.h ('k') | include/effects/SkDropShadowImageFilter.h » ('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 #ifndef SkDisplacementMapEffect_DEFINED 8 #ifndef SkDisplacementMapEffect_DEFINED
9 #define SkDisplacementMapEffect_DEFINED 9 #define SkDisplacementMapEffect_DEFINED
10 10
(...skipping 19 matching lines...) Expand all
30 30
31 ~SkDisplacementMapEffect(); 31 ~SkDisplacementMapEffect();
32 32
33 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDisplacementMapEffect) 33 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDisplacementMapEffect)
34 34
35 virtual bool onFilterImage(Proxy* proxy, 35 virtual bool onFilterImage(Proxy* proxy,
36 const SkBitmap& src, 36 const SkBitmap& src,
37 const SkMatrix& ctm, 37 const SkMatrix& ctm,
38 SkBitmap* dst, 38 SkBitmap* dst,
39 SkIPoint* offset) SK_OVERRIDE; 39 SkIPoint* offset) SK_OVERRIDE;
40 virtual void computeFastBounds(const SkRect& src, SkRect* dst) const SK_OVER RIDE;
41
40 #if SK_SUPPORT_GPU 42 #if SK_SUPPORT_GPU
41 virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; } 43 virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; }
42 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatri x& ctm, 44 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatri x& ctm,
43 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; 45 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
44 #endif 46 #endif
45 47
46 protected: 48 protected:
47 explicit SkDisplacementMapEffect(SkFlattenableReadBuffer& buffer); 49 explicit SkDisplacementMapEffect(SkFlattenableReadBuffer& buffer);
48 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 50 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
49 51
50 private: 52 private:
51 ChannelSelectorType fXChannelSelector; 53 ChannelSelectorType fXChannelSelector;
52 ChannelSelectorType fYChannelSelector; 54 ChannelSelectorType fYChannelSelector;
53 SkScalar fScale; 55 SkScalar fScale;
54 typedef SkImageFilter INHERITED; 56 typedef SkImageFilter INHERITED;
55 SkImageFilter* getDisplacementInput() { return getInput(0); } 57 SkImageFilter* getDisplacementInput() { return getInput(0); }
56 SkImageFilter* getColorInput() { return getInput(1); } 58 SkImageFilter* getColorInput() { return getInput(1); }
59 const SkImageFilter* getDisplacementInput() const { return getInput(0); }
60 const SkImageFilter* getColorInput() const { return getInput(1); }
57 }; 61 };
58 62
59 #endif 63 #endif
OLDNEW
« no previous file with comments | « include/effects/SkBlurImageFilter.h ('k') | include/effects/SkDropShadowImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698