diff options
author | 2010-12-13 18:24:33 -0800 | |
---|---|---|
committer | 2010-12-13 18:24:33 -0800 | |
commit | 70ca14e08ae197547ac412e8a1210e1ebdfb2eb1 (patch) | |
tree | b5d798c0ae819e6d769b826c5d090ea4f03665a0 /libs/hwui/ProgramCache.h | |
parent | b8c0de2c2726f4e8f0029710047efe0c8e6661ed (diff) |
Refactor OpenGLRenderer to simplify OpenGL drawing code.
This is the first step of the refactoring:
- drawColorRect
- drawTextureMesh
Remaining methods to refactor:
- setupTextureAlpha8
- drawPath
- setupShadow
- drawText
- drawLines
- composeLayerRegion
Change-Id: I0fced6a05b6b6eee10ee7cef0c3fbdaa6cefab20
Diffstat (limited to 'libs/hwui/ProgramCache.h')
-rw-r--r-- | libs/hwui/ProgramCache.h | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/libs/hwui/ProgramCache.h b/libs/hwui/ProgramCache.h index fc3e248713f3..3acd18a9e097 100644 --- a/libs/hwui/ProgramCache.h +++ b/libs/hwui/ProgramCache.h @@ -102,14 +102,8 @@ struct ProgramDescription { kGradientSweep }; - ProgramDescription(): - hasTexture(false), hasAlpha8Texture(false), modulate(false), - hasBitmap(false), isBitmapNpot(false), hasGradient(false), - gradientType(kGradientLinear), - shadersMode(SkXfermode::kClear_Mode), isBitmapFirst(false), - bitmapWrapS(GL_CLAMP_TO_EDGE), bitmapWrapT(GL_CLAMP_TO_EDGE), - colorOp(kColorNone), colorMode(SkXfermode::kClear_Mode), - framebufferMode(SkXfermode::kClear_Mode), swapSrcDst(false) { + ProgramDescription() { + reset(); } // Texturing @@ -142,6 +136,35 @@ struct ProgramDescription { bool swapSrcDst; /** + * Resets this description. All fields are reset back to the default + * values they hold after building a new instance. + */ + void reset() { + hasTexture = false; + hasAlpha8Texture = false; + + modulate = false; + + hasBitmap = false; + isBitmapNpot = false; + + hasGradient = false; + gradientType = kGradientLinear; + + shadersMode = SkXfermode::kClear_Mode; + + isBitmapFirst = false; + bitmapWrapS = GL_CLAMP_TO_EDGE; + bitmapWrapT = GL_CLAMP_TO_EDGE; + + colorOp = kColorNone; + colorMode = SkXfermode::kClear_Mode; + + framebufferMode = SkXfermode::kClear_Mode; + swapSrcDst = false; + } + + /** * Indicates, for a given color, whether color modulation is required in * the fragment shader. When this method returns true, the program should * be provided with a modulation color. |