OLD | NEW |
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 explicit SkBitmapSource(const SkBitmap& bitmap); | 16 explicit SkBitmapSource(const SkBitmap& bitmap); |
17 SkBitmapSource(const SkBitmap& bitmap, const SkRect& srcRect, const SkRect&
dstRect); | 17 SkBitmapSource(const SkBitmap& bitmap, const SkRect& srcRect, const SkRect&
dstRect); |
18 virtual void computeFastBounds(const SkRect& src, SkRect* dst) const SK_OVER
RIDE; | 18 virtual void computeFastBounds(const SkRect& src, SkRect* dst) const SK_OVER
RIDE; |
19 | 19 |
20 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBitmapSource) | 20 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBitmapSource) |
21 | 21 |
22 protected: | 22 protected: |
23 explicit SkBitmapSource(SkReadBuffer& buffer); | 23 explicit SkBitmapSource(SkReadBuffer& buffer); |
24 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 24 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
25 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, | 25 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, |
26 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; | 26 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; |
| 27 virtual bool onFilterBounds(const SkIRect& src, const SkMatrix& ctm, SkIRect
* dst) const SK_OVERRIDE; |
27 | 28 |
28 private: | 29 private: |
29 SkBitmap fBitmap; | 30 SkBitmap fBitmap; |
30 SkRect fSrcRect, fDstRect; | 31 SkRect fSrcRect, fDstRect; |
31 typedef SkImageFilter INHERITED; | 32 typedef SkImageFilter INHERITED; |
32 }; | 33 }; |
33 | 34 |
34 #endif | 35 #endif |
OLD | NEW |