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

Unified Diff: tests/GLProgramsTest.cpp

Issue 545693004: Calculate stage stats in GrOptDrawState (Closed) Base URL: https://skia.googlesource.com/skia.git@connectOpt2
Patch Set: Nit Created 6 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.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/GLProgramsTest.cpp
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index e8b6da5193f6cc4fc4067867641d3338f8b68db8..a7482120b4f453d20e3ee117bdfbd01bed1de76b 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -21,6 +21,19 @@
#include "SkRandom.h"
#include "Test.h"
+static void get_stage_stats(const GrEffectStage stage, bool* readsDst,
+ bool* readsFragPosition, bool* requiresVertexShader) {
+ if (stage.getEffect()->willReadDstColor()) {
+ *readsDst = true;
+ }
+ if (stage.getEffect()->willReadFragmentPosition()) {
+ *readsFragPosition = true;
+ }
+ if (stage.getEffect()->requiresVertexShader()) {
+ *requiresVertexShader = true;
+ }
+}
+
bool GrGLProgramDesc::setRandom(SkRandom* random,
const GrGpuGL* gpu,
const GrRenderTarget* dstRenderTarget,
@@ -57,11 +70,11 @@ bool GrGLProgramDesc::setRandom(SkRandom* random,
}
GrEffectKeyBuilder b(&fKey);
uint16_t effectKeySize;
- if (!GetEffectKeyAndUpdateStats(*stage, gpu->glCaps(), useLocalCoords, &b,
- &effectKeySize, &dstRead, &fragPos, &vertexShader)) {
+ if (!GetEffectKey(*stage, gpu->glCaps(), useLocalCoords, &b, &effectKeySize)) {
fKey.reset();
return false;
}
+ get_stage_stats(*stage, &dstRead, &fragPos, &vertexShader);
offsetAndSize[0] = effectKeyOffset;
offsetAndSize[1] = effectKeySize;
offset++;
@@ -79,11 +92,11 @@ bool GrGLProgramDesc::setRandom(SkRandom* random,
}
GrEffectKeyBuilder b(&fKey);
uint16_t effectKeySize;
- if (!GetEffectKeyAndUpdateStats(*stage, gpu->glCaps(), useLocalCoords, &b,
- &effectKeySize, &dstRead, &fragPos, &vertexShader)) {
+ if (!GetEffectKey(*stages[s], gpu->glCaps(), useLocalCoords, &b, &effectKeySize)) {
fKey.reset();
return false;
}
+ get_stage_stats(*stage, &dstRead, &fragPos, &vertexShader);
offsetAndSize[0] = effectKeyOffset;
offsetAndSize[1] = effectKeySize;
}
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698