Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Unified Diff: src/gpu/gl/GrGLProgramDesc.cpp

Issue 23653059: Mark when effects and programs have vertex code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLProgramDesc.cpp
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
index 91ac266093daf2742b0a2cad706bd501d3ba0a1d..8b731fbc2c71244e80a6f6dc87262280e31e214a 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -19,7 +19,8 @@ inline GrGLEffect::EffectKey get_key_and_update_stats(const GrEffectStage& stage
const GrGLCaps& caps,
bool useExplicitLocalCoords,
bool* setTrueIfReadsDst,
- bool* setTrueIfReadsPos) {
+ bool* setTrueIfReadsPos,
+ bool* setTrueIfHasVertexCode) {
const GrEffectRef& effect = *stage.getEffect();
const GrBackendEffectFactory& factory = effect->getFactory();
GrDrawEffect drawEffect(stage, useExplicitLocalCoords);
@@ -29,6 +30,9 @@ inline GrGLEffect::EffectKey get_key_and_update_stats(const GrEffectStage& stage
if (effect->willReadFragmentPosition()) {
*setTrueIfReadsPos = true;
}
+ if (effect->hasVertexCode()) {
+ *setTrueIfHasVertexCode = true;
+ }
return factory.glEffectKey(drawEffect, caps);
}
}
@@ -87,21 +91,25 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
int currEffectKey = 0;
bool readsDst = false;
bool readFragPosition = false;
+ bool hasVertexCode = false;
if (!skipColor) {
for (int s = 0; s < drawState.numColorStages(); ++s) {
effectKeys[currEffectKey++] =
get_key_and_update_stats(drawState.getColorStage(s), gpu->glCaps(),
- requiresLocalCoordAttrib, &readsDst, &readFragPosition);
+ requiresLocalCoordAttrib, &readsDst, &readFragPosition,
+ &hasVertexCode);
}
}
if (!skipCoverage) {
for (int s = 0; s < drawState.numCoverageStages(); ++s) {
effectKeys[currEffectKey++] =
get_key_and_update_stats(drawState.getCoverageStage(s), gpu->glCaps(),
- requiresLocalCoordAttrib, &readsDst, &readFragPosition);
+ requiresLocalCoordAttrib, &readsDst, &readFragPosition,
+ &hasVertexCode);
}
}
+ header->fHasVertexCode = hasVertexCode || requiresLocalCoordAttrib;
header->fEmitsPointSize = isPoints;
header->fColorFilterXfermode = skipColor ? SkXfermode::kDst_Mode : drawState.getColorFilterMode();
@@ -122,6 +130,7 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
header->fColorInput = kUniform_ColorInput;
} else {
header->fColorInput = kAttribute_ColorInput;
+ header->fHasVertexCode = true;
}
bool covIsSolidWhite = !requiresCoverageAttrib && 0xffffffff == drawState.getCoverage();
@@ -134,6 +143,7 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
header->fCoverageInput = kUniform_ColorInput;
} else {
header->fCoverageInput = kAttribute_ColorInput;
+ header->fHasVertexCode = true;
}
if (readsDst) {
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698