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

Side by Side Diff: include/core/SkColorFilter.h

Issue 2178523002: Revert of Add SkRasterPipeline blitter. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « gyp/core.gypi ('k') | include/core/SkXfermode.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 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 SkColorFilter_DEFINED 8 #ifndef SkColorFilter_DEFINED
9 #define SkColorFilter_DEFINED 9 #define SkColorFilter_DEFINED
10 10
11 #include "SkColor.h" 11 #include "SkColor.h"
12 #include "SkFlattenable.h" 12 #include "SkFlattenable.h"
13 #include "SkRefCnt.h" 13 #include "SkRefCnt.h"
14 #include "SkXfermode.h" 14 #include "SkXfermode.h"
15 15
16 class GrContext; 16 class GrContext;
17 class GrFragmentProcessor; 17 class GrFragmentProcessor;
18 class SkBitmap; 18 class SkBitmap;
19 class SkRasterPipeline;
20 19
21 /** 20 /**
22 * ColorFilters are optional objects in the drawing pipeline. When present in 21 * ColorFilters are optional objects in the drawing pipeline. When present in
23 * a paint, they are called with the "src" colors, and return new colors, which 22 * a paint, they are called with the "src" colors, and return new colors, which
24 * are then passed onto the next stage (either ImageFilter or Xfermode). 23 * are then passed onto the next stage (either ImageFilter or Xfermode).
25 * 24 *
26 * All subclasses are required to be reentrant-safe : it must be legal to share 25 * All subclasses are required to be reentrant-safe : it must be legal to share
27 * the same instance between several threads. 26 * the same instance between several threads.
28 */ 27 */
29 class SK_API SkColorFilter : public SkFlattenable { 28 class SK_API SkColorFilter : public SkFlattenable {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 The implementation writes out its filtered version into result[]. 63 The implementation writes out its filtered version into result[].
65 Note: shader and result may be the same buffer. 64 Note: shader and result may be the same buffer.
66 @param src array of colors, possibly generated by a shader 65 @param src array of colors, possibly generated by a shader
67 @param count the number of entries in the src[] and result[] arrays 66 @param count the number of entries in the src[] and result[] arrays
68 @param result written by the filter 67 @param result written by the filter
69 */ 68 */
70 virtual void filterSpan(const SkPMColor src[], int count, SkPMColor result[] ) const = 0; 69 virtual void filterSpan(const SkPMColor src[], int count, SkPMColor result[] ) const = 0;
71 70
72 virtual void filterSpan4f(const SkPM4f src[], int count, SkPM4f result[]) co nst; 71 virtual void filterSpan4f(const SkPM4f src[], int count, SkPM4f result[]) co nst;
73 72
74 bool appendStages(SkRasterPipeline*) const;
75
76 enum Flags { 73 enum Flags {
77 /** If set the filter methods will not change the alpha channel of the c olors. 74 /** If set the filter methods will not change the alpha channel of the c olors.
78 */ 75 */
79 kAlphaUnchanged_Flag = 1 << 0, 76 kAlphaUnchanged_Flag = 1 << 0,
80 }; 77 };
81 78
82 /** Returns the flags for this filter. Override in subclasses to return cust om flags. 79 /** Returns the flags for this filter. Override in subclasses to return cust om flags.
83 */ 80 */
84 virtual uint32_t getFlags() const { return 0; } 81 virtual uint32_t getFlags() const { return 0; }
85 82
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 } 161 }
165 162
166 SK_TO_STRING_PUREVIRT() 163 SK_TO_STRING_PUREVIRT()
167 164
168 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() 165 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
169 SK_DEFINE_FLATTENABLE_TYPE(SkColorFilter) 166 SK_DEFINE_FLATTENABLE_TYPE(SkColorFilter)
170 167
171 protected: 168 protected:
172 SkColorFilter() {} 169 SkColorFilter() {}
173 170
174 virtual bool onAppendStages(SkRasterPipeline*) const;
175
176 private: 171 private:
177 /* 172 /*
178 * Returns 1 if this is a single filter (not a composition of other filters ), otherwise it 173 * Returns 1 if this is a single filter (not a composition of other filters ), otherwise it
179 * reutrns the number of leaf-node filters in a composition. This should be the same value 174 * reutrns the number of leaf-node filters in a composition. This should be the same value
180 * as the number of GrFragmentProcessors returned by asFragmentProcessors's array parameter. 175 * as the number of GrFragmentProcessors returned by asFragmentProcessors's array parameter.
181 * 176 *
182 * e.g. compose(filter, compose(compose(filter, filter), filter)) --> 4 177 * e.g. compose(filter, compose(compose(filter, filter), filter)) --> 4
183 */ 178 */
184 virtual int privateComposedFilterCount() const { return 1; } 179 virtual int privateComposedFilterCount() const { return 1; }
185 friend class SkComposeColorFilter; 180 friend class SkComposeColorFilter;
186 181
187 typedef SkFlattenable INHERITED; 182 typedef SkFlattenable INHERITED;
188 }; 183 };
189 184
190 #endif 185 #endif
OLDNEW
« no previous file with comments | « gyp/core.gypi ('k') | include/core/SkXfermode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698