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

Unified Diff: tests/GLProgramsTest.cpp

Issue 545693004: Calculate stage stats in GrOptDrawState (Closed) Base URL: https://skia.googlesource.com/skia.git@connectOpt2
Patch Set: 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
« src/gpu/gl/GrGLProgramDesc.cpp ('K') | « 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 af280466ae12d2aad060e24fa74473b53711a9d3..f66f9e38f399b8791e5cea2f4231400665199c99 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -22,6 +22,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,
@@ -55,11 +68,11 @@ bool GrGLProgramDesc::setRandom(SkRandom* random,
GrDrawEffect drawEffect(*stages[s], useLocalCoords);
GrEffectKeyBuilder b(&fKey);
uint16_t effectKeySize;
- if (!GetEffectKeyAndUpdateStats(*stages[s], gpu->glCaps(), useLocalCoords, &b,
- &effectKeySize, &dstRead, &fragPos, &vertexShader)) {
+ if (!GetEffectKey(*stages[s], gpu->glCaps(), useLocalCoords, &b, &effectKeySize)) {
fKey.reset();
return false;
}
+ get_stage_stats(*stages[s], &dstRead, &fragPos, &vertexShader);
offsetAndSize[0] = effectKeyOffset;
offsetAndSize[1] = effectKeySize;
}
« src/gpu/gl/GrGLProgramDesc.cpp ('K') | « src/gpu/gl/GrGLProgramDesc.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698