aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
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