aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-21 21:40:12 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-21 21:40:12 +0000
commit8d49d93bb33a9594a9e4a9c12e3261f47d151218 (patch)
treea0e72f6b546086356a0cb0973006285b5fac3ac8 /src
parent457b8a3b49d5cf946674bbaa959a86bd137bf582 (diff)
Stop Tracking const vertex attrib color and coverage using GrDrawState
Review URL: http://codereview.appspot.com/6219056/ git-svn-id: http://skia.googlecode.com/svn/trunk@4022 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/gpu/gl/GrGpuGL.cpp2
-rw-r--r--src/gpu/gl/GrGpuGLShaders.cpp10
-rw-r--r--src/gpu/gl/GrGpuGLShaders.h4
3 files changed, 10 insertions, 6 deletions
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 6fa958403c..b6bfd65679 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -493,8 +493,6 @@ void GrGpuGL::onResetContext() {
fHWBlendState.invalidate();
- fHWDrawState.setColor(GrColor_ILLEGAL);
-
fHWDrawState.setViewMatrix(GrMatrix::InvalidMatrix());
for (int s = 0; s < GrDrawState::kNumStages; ++s) {
diff --git a/src/gpu/gl/GrGpuGLShaders.cpp b/src/gpu/gl/GrGpuGLShaders.cpp
index 7687a14b85..32f021f29a 100644
--- a/src/gpu/gl/GrGpuGLShaders.cpp
+++ b/src/gpu/gl/GrGpuGLShaders.cpp
@@ -382,6 +382,8 @@ void GrGpuGLShaders::onResetContext() {
}
fHWProgramID = 0;
+ fHWConstAttribColor = GrColor_ILLEGAL;
+ fHWConstAttribCoverage = GrColor_ILLEGAL;
}
void GrGpuGLShaders::flushViewMatrix() {
@@ -607,7 +609,7 @@ void GrGpuGLShaders::flushColor(GrColor color) {
if (this->getVertexLayout() & kColor_VertexLayoutBit) {
// color will be specified per-vertex as an attribute
// invalidate the const vertex attrib color
- fHWDrawState.setColor(GrColor_ILLEGAL);
+ fHWConstAttribColor = GrColor_ILLEGAL;
} else {
switch (desc.fColorInput) {
case ProgramDesc::kAttribute_ColorInput:
@@ -617,7 +619,7 @@ void GrGpuGLShaders::flushColor(GrColor color) {
float c[] = GR_COLOR_TO_VEC4(color);
GL_CALL(VertexAttrib4fv(GrGLProgram::ColorAttributeIdx(),
c));
- fHWDrawState.setColor(color);
+ fHWConstAttribColor = color;
}
break;
case ProgramDesc::kUniform_ColorInput:
@@ -657,7 +659,7 @@ void GrGpuGLShaders::flushCoverage(GrColor coverage) {
if (this->getVertexLayout() & kCoverage_VertexLayoutBit) {
// coverage will be specified per-vertex as an attribute
// invalidate the const vertex attrib coverage
- fHWDrawState.setCoverage4(GrColor_ILLEGAL);
+ fHWConstAttribCoverage = GrColor_ILLEGAL;
} else {
switch (desc.fCoverageInput) {
case ProgramDesc::kAttribute_ColorInput:
@@ -667,7 +669,7 @@ void GrGpuGLShaders::flushCoverage(GrColor coverage) {
float c[] = GR_COLOR_TO_VEC4(coverage);
GL_CALL(VertexAttrib4fv(GrGLProgram::CoverageAttributeIdx(),
c));
- fHWDrawState.setCoverage(coverage);
+ fHWConstAttribCoverage = coverage;
}
break;
case ProgramDesc::kUniform_ColorInput:
diff --git a/src/gpu/gl/GrGpuGLShaders.h b/src/gpu/gl/GrGpuGLShaders.h
index cb72e2a51c..f16fa02ab9 100644
--- a/src/gpu/gl/GrGpuGLShaders.h
+++ b/src/gpu/gl/GrGpuGLShaders.h
@@ -81,7 +81,11 @@ private:
ProgramCache* fProgramCache;
CachedData* fProgramData;
+
GrGLuint fHWProgramID;
+ GrColor fHWConstAttribColor;
+ GrColor fHWConstAttribCoverage;
+
GrGLProgram fCurrentProgram;
// If we get rid of fixed function subclass this should move
// to the GLCaps struct in parent class