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

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

Issue 24018007: Add a GrCustomCoordsTextureEffect class (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 | « gyp/gpu.gypi ('k') | src/gpu/GrTextContext.cpp » ('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 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 memory pool. The ref count of an effect must reach 0 before the thread termi nates and the pool 78 memory pool. The ref count of an effect must reach 0 before the thread termi nates and the pool
79 is destroyed. To create a static effect use the macro GR_CREATE_STATIC_EFFEC T declared below. 79 is destroyed. To create a static effect use the macro GR_CREATE_STATIC_EFFEC T declared below.
80 */ 80 */
81 class GrEffect : private SkRefCnt { 81 class GrEffect : private SkRefCnt {
82 public: 82 public:
83 SK_DECLARE_INST_COUNT(GrEffect) 83 SK_DECLARE_INST_COUNT(GrEffect)
84 84
85 /** 85 /**
86 * The types of vertex coordinates available to an effect in the vertex shad er. Effects can 86 * The types of vertex coordinates available to an effect in the vertex shad er. Effects can
87 * require their own vertex attribute but these coordinates are made availab le by the framework 87 * require their own vertex attribute but these coordinates are made availab le by the framework
88 * in all programs. kCustom_CoordsType is provided to signify that an altern ative set of coords 88 * in all programs.
89 * is used (usually an explicit vertex attribute) but its meaning is determi ned by the effect
90 * subclass.
91 */ 89 */
92 enum CoordsType { 90 enum CoordsType {
93 kLocal_CoordsType, 91 kLocal_CoordsType,
94 kPosition_CoordsType, 92 kPosition_CoordsType,
95
96 kCustom_CoordsType,
97 }; 93 };
98 94
99 virtual ~GrEffect(); 95 virtual ~GrEffect();
100 96
101 /** 97 /**
102 * This function is used to perform optimizations. When called the color and validFlags params 98 * 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. 99 * 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 100 * 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 101 * indicate known values of its output. A component of the color param only has meaning if the
106 * corresponding bit in validFlags is set. 102 * corresponding bit in validFlags is set.
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 }; \ 331 }; \
336 static SkAlignedSStorage<k_##NAME##_StorageSize> g_##NAME##_Storage; \ 332 static SkAlignedSStorage<k_##NAME##_StorageSize> g_##NAME##_Storage; \
337 static void* NAME##_RefLocation = (char*)g_##NAME##_Storage.get() + k_##NAME##_E ffectRefOffset; \ 333 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);\ 334 static GrEffect* NAME##_Effect SkNEW_PLACEMENT_ARGS(g_##NAME##_Storage.get(), EF FECT_CLASS, ARGS);\
339 static SkAutoTDestroy<GrEffect> NAME##_ad(NAME##_Effect); \ 335 static SkAutoTDestroy<GrEffect> NAME##_ad(NAME##_Effect); \
340 static GrEffectRef* NAME(GrEffect::CreateStaticEffectRef(NAME##_RefLocation, NAM E##_Effect)); \ 336 static GrEffectRef* NAME(GrEffect::CreateStaticEffectRef(NAME##_RefLocation, NAM E##_Effect)); \
341 static SkAutoTDestroy<GrEffectRef> NAME##_Ref_ad(NAME) 337 static SkAutoTDestroy<GrEffectRef> NAME##_Ref_ad(NAME)
342 338
343 339
344 #endif 340 #endif
OLDNEW
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/GrTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698