Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Side by Side Diff: include/effects/SkColorCubeFilter.h

Issue 973593002: change colorfilter to return an array of frag processors (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update gm Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 are ignored (treated as 0xFF). 20 * The alpha components of the colors are ignored (treated as 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 SK_OVER RIDE; 24 void filterSpan(const SkPMColor src[], int count, SkPMColor[]) const SK_OVER RIDE;
25 uint32_t getFlags() const SK_OVERRIDE; 25 uint32_t getFlags() const SK_OVERRIDE;
26 26
27 #if SK_SUPPORT_GPU 27 #if SK_SUPPORT_GPU
28 GrFragmentProcessor* asFragmentProcessor(GrContext*) const SK_OVERRIDE; 28 bool asFragmentProcessors(GrContext*, SkTDArray<GrFragmentProcessor*>*) const SK_OVERRIDE;
29 #endif 29 #endif
30 30
31 SK_TO_STRING_OVERRIDE() 31 SK_TO_STRING_OVERRIDE()
32 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorCubeFilter) 32 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorCubeFilter)
33 33
34 protected: 34 protected:
35 SkColorCubeFilter(SkData* cubeData, int cubeDimension); 35 SkColorCubeFilter(SkData* cubeData, int cubeDimension);
36 void flatten(SkWriteBuffer&) const SK_OVERRIDE; 36 void flatten(SkWriteBuffer&) const SK_OVERRIDE;
37 37
38 private: 38 private:
(...skipping 29 matching lines...) Expand all
68 68
69 SkAutoDataUnref fCubeData; 69 SkAutoDataUnref fCubeData;
70 int32_t fUniqueID; 70 int32_t fUniqueID;
71 71
72 mutable ColorCubeProcesingCache fCache; 72 mutable ColorCubeProcesingCache fCache;
73 73
74 typedef SkColorFilter INHERITED; 74 typedef SkColorFilter INHERITED;
75 }; 75 };
76 76
77 #endif 77 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698