| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 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 SkColorCubeFilter_DEFINED | 8 #ifndef SkColorCubeFilter_DEFINED |
| 9 #define SkColorCubeFilter_DEFINED | 9 #define SkColorCubeFilter_DEFINED |
| 10 | 10 |
| 11 #include "SkColorFilter.h" | 11 #include "SkColorFilter.h" |
| 12 #include "SkData.h" | 12 #include "SkData.h" |
| 13 #include "SkMutex.h" | 13 #include "SkMutex.h" |
| 14 | 14 |
| 15 class SK_API SkColorCubeFilter : public SkColorFilter { | 15 class SK_API SkColorCubeFilter : public SkColorFilter { |
| 16 public: | 16 public: |
| 17 /** cubeData must containt a 3D data in the form of cube of the size: | 17 /** cubeData must containt a 3D data in the form of cube of the size: |
| 18 * cubeDimension * cubeDimension * cubeDimension * sizeof(SkColor) | 18 * cubeDimension * cubeDimension * cubeDimension * sizeof(SkColor) |
| 19 * This cube contains a transform where (x,y,z) maps to the (r,g,b). | 19 * This cube contains a transform where (x,y,z) maps to the (r,g,b). |
| 20 * The alpha components of the colors must be 0xFF. | 20 * The alpha components of the colors must be 0xFF. |
| 21 */ | 21 */ |
| 22 static SkColorFilter* Create(SkData* cubeData, int cubeDimension); | 22 static SkColorFilter* Create(SkData* cubeData, int cubeDimension); |
| 23 | 23 |
| 24 void filterSpan(const SkPMColor src[], int count, SkPMColor[]) const overrid
e; | 24 void filterSpan(const SkPMColor src[], int count, SkPMColor[]) const overrid
e; |
| 25 uint32_t getFlags() const override; | 25 uint32_t getFlags() const override; |
| 26 | 26 |
| 27 #if SK_SUPPORT_GPU | 27 #if SK_SUPPORT_GPU |
| 28 bool asFragmentProcessors(GrContext*, GrProcessorDataManager*, | 28 bool asFragmentProcessors(GrContext*, GrProcessorDataManager*, |
| 29 SkTDArray<GrFragmentProcessor*>*) const override; | 29 SkTDArray<const GrFragmentProcessor*>*) const overr
ide; |
| 30 #endif | 30 #endif |
| 31 | 31 |
| 32 SK_TO_STRING_OVERRIDE() | 32 SK_TO_STRING_OVERRIDE() |
| 33 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorCubeFilter) | 33 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorCubeFilter) |
| 34 | 34 |
| 35 protected: | 35 protected: |
| 36 SkColorCubeFilter(SkData* cubeData, int cubeDimension); | 36 SkColorCubeFilter(SkData* cubeData, int cubeDimension); |
| 37 void flatten(SkWriteBuffer&) const override; | 37 void flatten(SkWriteBuffer&) const override; |
| 38 | 38 |
| 39 private: | 39 private: |
| (...skipping 29 matching lines...) Expand all Loading... |
| 69 | 69 |
| 70 SkAutoDataUnref fCubeData; | 70 SkAutoDataUnref fCubeData; |
| 71 int32_t fUniqueID; | 71 int32_t fUniqueID; |
| 72 | 72 |
| 73 mutable ColorCubeProcesingCache fCache; | 73 mutable ColorCubeProcesingCache fCache; |
| 74 | 74 |
| 75 typedef SkColorFilter INHERITED; | 75 typedef SkColorFilter INHERITED; |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 #endif | 78 #endif |
| OLD | NEW |