| 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 13 matching lines...) Expand all Loading... |
| 24 SkXfermode::Mode modes[2] = { mode, mode }; | 24 SkXfermode::Mode modes[2] = { mode, mode }; |
| 25 return SkNEW_ARGS(SkMergeImageFilter, (inputs, 2, modes, cropRect, uniqu
eID)); | 25 return SkNEW_ARGS(SkMergeImageFilter, (inputs, 2, modes, cropRect, uniqu
eID)); |
| 26 } | 26 } |
| 27 static SkMergeImageFilter* Create(SkImageFilter* filters[], int count, | 27 static SkMergeImageFilter* Create(SkImageFilter* filters[], int count, |
| 28 const SkXfermode::Mode modes[] = NULL, | 28 const SkXfermode::Mode modes[] = NULL, |
| 29 const CropRect* cropRect = NULL, | 29 const CropRect* cropRect = NULL, |
| 30 uint32_t uniqueID = 0) { | 30 uint32_t uniqueID = 0) { |
| 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_TO_STRING_OVERRIDE() |
| 34 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMergeImageFilter) | 35 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMergeImageFilter) |
| 35 | 36 |
| 36 protected: | 37 protected: |
| 37 SkMergeImageFilter(SkImageFilter* filters[], int count, | 38 SkMergeImageFilter(SkImageFilter* filters[], int count, |
| 38 const SkXfermode::Mode modes[], | 39 const SkXfermode::Mode modes[], |
| 39 const CropRect* cropRect, | 40 const CropRect* cropRect, |
| 40 uint32_t uniqueID); | 41 uint32_t uniqueID); |
| 41 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 42 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
| 42 | 43 |
| 43 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, | 44 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, |
| 44 SkBitmap* result, SkIPoint* loc) const SK_OVERRID
E; | 45 SkBitmap* result, SkIPoint* loc) const SK_OVERRID
E; |
| 45 | 46 |
| 46 private: | 47 private: |
| 47 uint8_t* fModes; // SkXfermode::Mode | 48 uint8_t* fModes; // SkXfermode::Mode |
| 48 | 49 |
| 49 // private storage, to avoid dynamically allocating storage for our copy | 50 // private storage, to avoid dynamically allocating storage for our copy |
| 50 // of the modes (unless the count is so large we can't fit). | 51 // of the modes (unless the count is so large we can't fit). |
| 51 intptr_t fStorage[16]; | 52 intptr_t fStorage[16]; |
| 52 | 53 |
| 53 void initAllocModes(); | 54 void initAllocModes(); |
| 54 void initModes(const SkXfermode::Mode []); | 55 void initModes(const SkXfermode::Mode []); |
| 55 | 56 |
| 56 typedef SkImageFilter INHERITED; | 57 typedef SkImageFilter INHERITED; |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 #endif | 60 #endif |
| OLD | NEW |