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

Side by Side Diff: include/gpu/GrEffect.h

Issue 25023003: Implement color filter as GrGLEffect (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | include/gpu/GrPaint.h » ('j') | src/gpu/gl/GrGLProgram.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 GrEffect_DEFINED 8 #ifndef GrEffect_DEFINED
9 #define GrEffect_DEFINED 9 #define GrEffect_DEFINED
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 /** 101 /**
102 * This function is used to perform optimizations. When called the color and validFlags params 102 * This function is used to perform optimizations. When called the color and validFlags params
103 * indicate whether the input components to this effect in the FS will have known values. 103 * indicate whether the input components to this effect in the FS will have known values.
104 * validFlags is a bitfield of GrColorComponentFlags. The function updates b oth params to 104 * validFlags is a bitfield of GrColorComponentFlags. The function updates b oth params to
105 * indicate known values of its output. A component of the color param only has meaning if the 105 * indicate known values of its output. A component of the color param only has meaning if the
106 * corresponding bit in validFlags is set. 106 * corresponding bit in validFlags is set.
107 */ 107 */
108 virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags ) const = 0; 108 virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags ) const = 0;
109 109
110 /** Will this effect read the source color value? */
111 virtual bool getWillUseInputColor() const { return true; }
112
110 /** This object, besides creating back-end-specific helper objects, is used for run-time-type- 113 /** This object, besides creating back-end-specific helper objects, is used for run-time-type-
111 identification. The factory should be an instance of templated class, 114 identification. The factory should be an instance of templated class,
112 GrTBackendEffectFactory. It is templated on the subclass of GrEffect. Th e subclass must have 115 GrTBackendEffectFactory. It is templated on the subclass of GrEffect. Th e subclass must have
113 a nested type (or typedef) named GLEffect which will be the subclass of GrGLEffect created 116 a nested type (or typedef) named GLEffect which will be the subclass of GrGLEffect created
114 by the factory. 117 by the factory.
115 118
116 Example: 119 Example:
117 class MyCustomEffect : public GrEffect { 120 class MyCustomEffect : public GrEffect {
118 ... 121 ...
119 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE { 122 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE {
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 }; \ 338 }; \
336 static SkAlignedSStorage<k_##NAME##_StorageSize> g_##NAME##_Storage; \ 339 static SkAlignedSStorage<k_##NAME##_StorageSize> g_##NAME##_Storage; \
337 static void* NAME##_RefLocation = (char*)g_##NAME##_Storage.get() + k_##NAME##_E ffectRefOffset; \ 340 static void* NAME##_RefLocation = (char*)g_##NAME##_Storage.get() + k_##NAME##_E ffectRefOffset; \
338 static GrEffect* NAME##_Effect SkNEW_PLACEMENT_ARGS(g_##NAME##_Storage.get(), EF FECT_CLASS, ARGS);\ 341 static GrEffect* NAME##_Effect SkNEW_PLACEMENT_ARGS(g_##NAME##_Storage.get(), EF FECT_CLASS, ARGS);\
339 static SkAutoTDestroy<GrEffect> NAME##_ad(NAME##_Effect); \ 342 static SkAutoTDestroy<GrEffect> NAME##_ad(NAME##_Effect); \
340 static GrEffectRef* NAME(GrEffect::CreateStaticEffectRef(NAME##_RefLocation, NAM E##_Effect)); \ 343 static GrEffectRef* NAME(GrEffect::CreateStaticEffectRef(NAME##_RefLocation, NAM E##_Effect)); \
341 static SkAutoTDestroy<GrEffectRef> NAME##_Ref_ad(NAME) 344 static SkAutoTDestroy<GrEffectRef> NAME##_Ref_ad(NAME)
342 345
343 346
344 #endif 347 #endif
OLDNEW
« no previous file with comments | « no previous file | include/gpu/GrPaint.h » ('j') | src/gpu/gl/GrGLProgram.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698