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 20 matching lines...) Expand all Loading... |
31 return SkNEW_ARGS(SkMergeImageFilter, (filters, count, modes, cropRect,
uniqueID)); | 31 return SkNEW_ARGS(SkMergeImageFilter, (filters, count, modes, cropRect,
uniqueID)); |
32 } | 32 } |
33 | 33 |
34 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMergeImageFilter) | 34 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMergeImageFilter) |
35 | 35 |
36 protected: | 36 protected: |
37 SkMergeImageFilter(SkImageFilter* filters[], int count, | 37 SkMergeImageFilter(SkImageFilter* filters[], int count, |
38 const SkXfermode::Mode modes[], | 38 const SkXfermode::Mode modes[], |
39 const CropRect* cropRect, | 39 const CropRect* cropRect, |
40 uint32_t uniqueID); | 40 uint32_t uniqueID); |
41 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING | |
42 explicit SkMergeImageFilter(SkReadBuffer& buffer); | |
43 #endif | |
44 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 41 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
45 | 42 |
46 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, | 43 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, |
47 SkBitmap* result, SkIPoint* loc) const SK_OVERRID
E; | 44 SkBitmap* result, SkIPoint* loc) const SK_OVERRID
E; |
48 | 45 |
49 private: | 46 private: |
50 uint8_t* fModes; // SkXfermode::Mode | 47 uint8_t* fModes; // SkXfermode::Mode |
51 | 48 |
52 // private storage, to avoid dynamically allocating storage for our copy | 49 // private storage, to avoid dynamically allocating storage for our copy |
53 // 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). |
54 intptr_t fStorage[16]; | 51 intptr_t fStorage[16]; |
55 | 52 |
56 void initAllocModes(); | 53 void initAllocModes(); |
57 void initModes(const SkXfermode::Mode []); | 54 void initModes(const SkXfermode::Mode []); |
58 | 55 |
59 typedef SkImageFilter INHERITED; | 56 typedef SkImageFilter INHERITED; |
60 }; | 57 }; |
61 | 58 |
62 #endif | 59 #endif |
OLD | NEW |