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 SkMergeImageFilter_DEFINED | 8 #ifndef SkMergeImageFilter_DEFINED |
9 #define SkMergeImageFilter_DEFINED | 9 #define SkMergeImageFilter_DEFINED |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 const CropRect* cropRect = NULL) { | 28 const CropRect* cropRect = NULL) { |
29 return SkNEW_ARGS(SkMergeImageFilter, (filters, count, modes, cropRect))
; | 29 return SkNEW_ARGS(SkMergeImageFilter, (filters, count, modes, cropRect))
; |
30 } | 30 } |
31 | 31 |
32 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMergeImageFilter) | 32 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMergeImageFilter) |
33 | 33 |
34 protected: | 34 protected: |
35 SkMergeImageFilter(SkImageFilter* filters[], int count, | 35 SkMergeImageFilter(SkImageFilter* filters[], int count, |
36 const SkXfermode::Mode modes[], | 36 const SkXfermode::Mode modes[], |
37 const CropRect* cropRect); | 37 const CropRect* cropRect); |
| 38 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
38 explicit SkMergeImageFilter(SkReadBuffer& buffer); | 39 explicit SkMergeImageFilter(SkReadBuffer& buffer); |
| 40 #endif |
39 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 41 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
40 | 42 |
41 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, | 43 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, |
42 SkBitmap* result, SkIPoint* loc) const SK_OVERRID
E; | 44 SkBitmap* result, SkIPoint* loc) const SK_OVERRID
E; |
43 | 45 |
44 private: | 46 private: |
45 uint8_t* fModes; // SkXfermode::Mode | 47 uint8_t* fModes; // SkXfermode::Mode |
46 | 48 |
47 // private storage, to avoid dynamically allocating storage for our copy | 49 // private storage, to avoid dynamically allocating storage for our copy |
48 // of the modes (unless the count is so large we can't fit). | 50 // of the modes (unless the count is so large we can't fit). |
49 intptr_t fStorage[16]; | 51 intptr_t fStorage[16]; |
50 | 52 |
51 void initAllocModes(); | 53 void initAllocModes(); |
52 void initModes(const SkXfermode::Mode []); | 54 void initModes(const SkXfermode::Mode []); |
53 | 55 |
54 typedef SkImageFilter INHERITED; | 56 typedef SkImageFilter INHERITED; |
55 }; | 57 }; |
56 | 58 |
57 #endif | 59 #endif |
OLD | NEW |