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

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

Issue 25605008: Repurpose GrGLCoordTransform as GrGLEffectArray (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
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 GrTBackendEffectFactory_DEFINED 8 #ifndef GrTBackendEffectFactory_DEFINED
9 #define GrTBackendEffectFactory_DEFINED 9 #define GrTBackendEffectFactory_DEFINED
10 10
(...skipping 16 matching lines...) Expand all
27 27
28 /** Returns a value that identifies the GLSL shader code generated by 28 /** Returns a value that identifies the GLSL shader code generated by
29 a GrEffect. This enables caching of generated shaders. Part of the 29 a GrEffect. This enables caching of generated shaders. Part of the
30 id identifies the GrEffect subclass. The remainder is based 30 id identifies the GrEffect subclass. The remainder is based
31 on the aspects of the GrEffect object's configuration that affect 31 on the aspects of the GrEffect object's configuration that affect
32 GLSL code generation. */ 32 GLSL code generation. */
33 virtual EffectKey glEffectKey(const GrDrawEffect& drawEffect, 33 virtual EffectKey glEffectKey(const GrDrawEffect& drawEffect,
34 const GrGLCaps& caps) const SK_OVERRIDE { 34 const GrGLCaps& caps) const SK_OVERRIDE {
35 SkASSERT(kIllegalEffectClassID != fEffectClassID); 35 SkASSERT(kIllegalEffectClassID != fEffectClassID);
36 EffectKey effectKey = GLEffect::GenKey(drawEffect, caps); 36 EffectKey effectKey = GLEffect::GenKey(drawEffect, caps);
37 EffectKey textureKey = GLEffect::GenTextureKey(drawEffect, caps); 37 EffectKey textureKey = GLEffect::ArrayClass::GenTextureKey(drawEffect, c aps);
38 EffectKey transformKey = GLEffect::GenTransformKey(drawEffect); 38 EffectKey transformKey = GLEffect::ArrayClass::GenTransformKey(drawEffec t);
39 EffectKey attribKey = GLEffect::GenAttribKey(drawEffect); 39 EffectKey attribKey = GLEffect::ArrayClass::GenAttribKey(drawEffect);
Chris Dalton 2013/10/02 19:57:32 I'm not sure I'm a huge fan of this 'ArrayClass' a
bsalomon 2013/10/02 20:17:06 Why do we need the typedef and nested scoping anyw
Chris Dalton 2013/10/02 20:24:09 This class is a template factory for any Effect. (
Chris Dalton 2013/10/02 21:25:43 Done.
40 #ifdef SK_DEBUG 40 #ifdef SK_DEBUG
41 static const EffectKey kIllegalEffectKeyMask = (uint16_t) (~((1U << kEff ectKeyBits) - 1)); 41 static const EffectKey kIllegalEffectKeyMask = (uint16_t) (~((1U << kEff ectKeyBits) - 1));
42 SkASSERT(!(kIllegalEffectKeyMask & effectKey)); 42 SkASSERT(!(kIllegalEffectKeyMask & effectKey));
43 43
44 static const EffectKey kIllegalTextureKeyMask = (uint16_t) (~((1U << kTe xtureKeyBits) - 1)); 44 static const EffectKey kIllegalTextureKeyMask = (uint16_t) (~((1U << kTe xtureKeyBits) - 1));
45 SkASSERT(!(kIllegalTextureKeyMask & textureKey)); 45 SkASSERT(!(kIllegalTextureKeyMask & textureKey));
46 46
47 static const EffectKey kIllegalTransformKeyMask = (uint16_t) (~((1U << k TransformKeyBits) - 1)); 47 static const EffectKey kIllegalTransformKeyMask = (uint16_t) (~((1U << k TransformKeyBits) - 1));
48 SkASSERT(!(kIllegalTransformKeyMask & transformKey)); 48 SkASSERT(!(kIllegalTransformKeyMask & transformKey));
49 49
(...skipping 29 matching lines...) Expand all
79 return *gInstance; 79 return *gInstance;
80 } 80 }
81 81
82 protected: 82 protected:
83 GrTBackendEffectFactory() { 83 GrTBackendEffectFactory() {
84 fEffectClassID = GenID(); 84 fEffectClassID = GenID();
85 } 85 }
86 }; 86 };
87 87
88 #endif 88 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698