aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.cpp
diff options
context:
space:
mode:
authorGravatar tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-11-09 16:39:17 +0000
committerGravatar tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-11-09 16:39:17 +0000
commit62b09687857c923b1044be0aef4dd900f8379b22 (patch)
treea8219f3eb36c258653744ab3deeccd029e15e0b1 /src/gpu/GrGpu.cpp
parent60014ca38710d3fc265f4376b05c0fefd0e044cf (diff)
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
Diffstat (limited to 'src/gpu/GrGpu.cpp')
-rw-r--r--src/gpu/GrGpu.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 7da560e195..2753cf0693 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -331,9 +331,9 @@ const GrStencilSettings GrGpu::gClipStencilSettings = {
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 @@ bool GrGpu::setupClipAndFlushState(GrPrimitiveType type) {
#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 @@ bool GrGpu::setupClipAndFlushState(GrPrimitiveType type) {
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)) {