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

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

Issue 189913021: Implement support for a Context parameter in image filters (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Revert all but the Context changes. Created 6 years, 9 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/SkBicubicImageFilter.h ('k') | include/effects/SkBlurImageFilter.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 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
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 SkBitmapSource_DEFINED 8 #ifndef SkBitmapSource_DEFINED
9 #define SkBitmapSource_DEFINED 9 #define SkBitmapSource_DEFINED
10 10
11 #include "SkImageFilter.h" 11 #include "SkImageFilter.h"
12 #include "SkBitmap.h" 12 #include "SkBitmap.h"
13 13
14 class SK_API SkBitmapSource : public SkImageFilter { 14 class SK_API SkBitmapSource : public SkImageFilter {
15 public: 15 public:
16 static SkBitmapSource* Create(const SkBitmap& bitmap) { 16 static SkBitmapSource* Create(const SkBitmap& bitmap) {
17 return SkNEW_ARGS(SkBitmapSource, (bitmap)); 17 return SkNEW_ARGS(SkBitmapSource, (bitmap));
18 } 18 }
19 static SkBitmapSource* Create(const SkBitmap& bitmap, const SkRect& srcRect, 19 static SkBitmapSource* Create(const SkBitmap& bitmap, const SkRect& srcRect,
20 const SkRect& dstRect) { 20 const SkRect& dstRect) {
21 return SkNEW_ARGS(SkBitmapSource, (bitmap, srcRect, dstRect)); 21 return SkNEW_ARGS(SkBitmapSource, (bitmap, srcRect, dstRect));
22 } 22 }
23 virtual void computeFastBounds(const SkRect& src, SkRect* dst) const SK_OVER RIDE; 23 virtual void computeFastBounds(const SkRect& src, SkRect* dst) const SK_OVER RIDE;
24 24
25 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBitmapSource) 25 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBitmapSource)
26 26
27 protected: 27 protected:
28 explicit SkBitmapSource(SkReadBuffer& buffer); 28 explicit SkBitmapSource(SkReadBuffer& buffer);
29 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; 29 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
30 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, 30 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
31 SkBitmap* result, SkIPoint* offset) const SK_OVER RIDE; 31 SkBitmap* result, SkIPoint* offset) const SK_OVER RIDE;
32 virtual bool onFilterBounds(const SkIRect& src, const SkMatrix& ctm, SkIRect * dst) const SK_OVERRIDE; 32 virtual bool onFilterBounds(const SkIRect& src, const SkMatrix& ctm, SkIRect * dst) const SK_OVERRIDE;
33 33
34 #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS 34 #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
35 public: 35 public:
36 #endif 36 #endif
37 explicit SkBitmapSource(const SkBitmap& bitmap); 37 explicit SkBitmapSource(const SkBitmap& bitmap);
38 SkBitmapSource(const SkBitmap& bitmap, const SkRect& srcRect, const SkRect& dstRect); 38 SkBitmapSource(const SkBitmap& bitmap, const SkRect& srcRect, const SkRect& dstRect);
39 39
40 private: 40 private:
41 SkBitmap fBitmap; 41 SkBitmap fBitmap;
42 SkRect fSrcRect, fDstRect; 42 SkRect fSrcRect, fDstRect;
43 typedef SkImageFilter INHERITED; 43 typedef SkImageFilter INHERITED;
44 }; 44 };
45 45
46 #endif 46 #endif
OLDNEW
« no previous file with comments | « include/effects/SkBicubicImageFilter.h ('k') | include/effects/SkBlurImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698