Speed up GrDrawState handling.
Compact GrDrawState and nested structs; dynamically only copy and compare
the fields actually active on the structs in question.
Yields 10-20% speedup of text benchmarks in GPU configuration.
Could probably get additional marginal speedup by ignoring unused
kernel fields.
Has some fragile constructs: pointer math on members to compute
sizes of portions of structs.
Removes fields necessary for GrTesselatedPathRenderer.
git-svn-id: http://skia.googlecode.com/svn/trunk@2644 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 7da560e..2753cf0 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -331,9 +331,9 @@
kKeep_StencilOp, kKeep_StencilOp,
kKeep_StencilOp, kKeep_StencilOp,
kAlwaysIfInClip_StencilFunc, kAlwaysIfInClip_StencilFunc,
- 0, 0,
- 0, 0,
- 0, 0
+ 0x0000, 0x0000,
+ 0x0000, 0x0000,
+ 0x0000, 0x0000
};
// mapping of clip-respecting stencil funcs to normal stencil funcs
@@ -580,6 +580,8 @@
#endif
int count = clip.getElementCount();
int clipBit = stencilBuffer->bits();
+ SkASSERT((clipBit <= 16) &&
+ "Ganesh only handles 16b or smaller stencil buffers");
clipBit = (1 << (clipBit-1));
bool clearToInside;
@@ -647,9 +649,9 @@
kIncClamp_StencilOp, kIncClamp_StencilOp,
kIncClamp_StencilOp, kIncClamp_StencilOp,
kAlways_StencilFunc, kAlways_StencilFunc,
- 0xffffffff, 0xffffffff,
- 0x00000000, 0x00000000,
- 0xffffffff, 0xffffffff,
+ 0xffff, 0xffff,
+ 0x0000, 0x0000,
+ 0xffff, 0xffff,
};
SET_RANDOM_COLOR
if (kRect_ClipType == clip.getElementType(c)) {