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

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

Issue 968993004: add virtuals to optimize composing colorfilters (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix param warning 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
« no previous file with comments | « no previous file | include/effects/SkColorMatrix.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkColorFilter_DEFINED 10 #ifndef SkColorFilter_DEFINED
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 */ 91 */
92 kHasFilter16_Flag = 0x02 92 kHasFilter16_Flag = 0x02
93 }; 93 };
94 94
95 /** Returns the flags for this filter. Override in subclasses to return 95 /** Returns the flags for this filter. Override in subclasses to return
96 custom flags. 96 custom flags.
97 */ 97 */
98 virtual uint32_t getFlags() const { return 0; } 98 virtual uint32_t getFlags() const { return 0; }
99 99
100 /** 100 /**
101 * If this subclass can optimally createa composition with the inner filter , return it as
102 * a new filter (which the caller must unref() when it is done). If no such optimization
103 * is known, return NULL.
104 *
105 * e.g. result(color) == this_filter(inner(color))
106 */
107 virtual SkColorFilter* newComposed(const SkColorFilter* /*inner*/) const { r eturn NULL; }
108
109 /**
101 * Apply this colorfilter to the specified SkColor. This routine handles 110 * Apply this colorfilter to the specified SkColor. This routine handles
102 * converting to SkPMColor, calling the filter, and then converting back 111 * converting to SkPMColor, calling the filter, and then converting back
103 * to SkColor. This method is not virtual, but will call filterSpan() 112 * to SkColor. This method is not virtual, but will call filterSpan()
104 * which is virtual. 113 * which is virtual.
105 */ 114 */
106 SkColor filterColor(SkColor) const; 115 SkColor filterColor(SkColor) const;
107 116
108 /** Create a colorfilter that uses the specified color and mode. 117 /** Create a colorfilter that uses the specified color and mode.
109 If the Mode is DST, this function will return NULL (since that 118 If the Mode is DST, this function will return NULL (since that
110 mode will have no effect on the result). 119 mode will have no effect on the result).
(...skipping 29 matching lines...) Expand all
140 SK_DEFINE_FLATTENABLE_TYPE(SkColorFilter) 149 SK_DEFINE_FLATTENABLE_TYPE(SkColorFilter)
141 150
142 protected: 151 protected:
143 SkColorFilter() {} 152 SkColorFilter() {}
144 153
145 private: 154 private:
146 typedef SkFlattenable INHERITED; 155 typedef SkFlattenable INHERITED;
147 }; 156 };
148 157
149 #endif 158 #endif
OLDNEW
« no previous file with comments | « no previous file | include/effects/SkColorMatrix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698