aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrSamplerState.h
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 /include/gpu/GrSamplerState.h
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 'include/gpu/GrSamplerState.h')
-rw-r--r--include/gpu/GrSamplerState.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/gpu/GrSamplerState.h b/include/gpu/GrSamplerState.h
index 9c217dbf9c..ed49593210 100644
--- a/include/gpu/GrSamplerState.h
+++ b/include/gpu/GrSamplerState.h
@@ -252,10 +252,10 @@ public:
}
private:
- WrapMode fWrapX;
- WrapMode fWrapY;
- SampleMode fSampleMode;
- Filter fFilter;
+ WrapMode fWrapX : 8;
+ WrapMode fWrapY : 8;
+ SampleMode fSampleMode : 8;
+ Filter fFilter : 8;
GrMatrix fMatrix;
bool fSwapRAndB;
GrRect fTextureDomain;
@@ -263,12 +263,12 @@ private:
// these are undefined unless fSampleMode == kRadial2_SampleMode
GrScalar fRadial2CenterX1;
GrScalar fRadial2Radius0;
- bool fRadial2PosRoot;
+ SkBool8 fRadial2PosRoot;
// These are undefined unless fFilter == kConvolution_Filter
- int fKernelWidth;
- float fKernel[MAX_KERNEL_WIDTH];
+ uint8_t fKernelWidth;
float fImageIncrement[2];
+ float fKernel[MAX_KERNEL_WIDTH];
static const GrSamplerState gClampNoFilter;
};