diff options
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 fc3e248..3acd18a 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. |