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

Unified Diff: bench/GLVec4ScalarBench.cpp

Issue 1403373012: Make appending default precision be controled by GLSL (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 2 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 | « bench/GLInstancedArraysBench.cpp ('k') | bench/GLVertexAttributesBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/GLVec4ScalarBench.cpp
diff --git a/bench/GLVec4ScalarBench.cpp b/bench/GLVec4ScalarBench.cpp
index 490b55ab529b91b5f53365cce569b65726ad35fb..e3837a7225700d8515014a23f74a968ef3d322d7 100644
--- a/bench/GLVec4ScalarBench.cpp
+++ b/bench/GLVec4ScalarBench.cpp
@@ -12,9 +12,9 @@
#if SK_SUPPORT_GPU
#include "GLBench.h"
#include "gl/GrGLContext.h"
-#include "gl/GrGLGLSL.h"
#include "gl/GrGLInterface.h"
#include "gl/GrGLUtil.h"
+#include "glsl/GrGLSL.h"
#include "glsl/GrGLSLCaps.h"
#include "glsl/GrGLSLShaderVar.h"
@@ -93,7 +93,8 @@ private:
///////////////////////////////////////////////////////////////////////////////////////////////////
GrGLuint GLVec4ScalarBench::setupShader(const GrGLContext* ctx) {
- const char* version = ctx->caps()->glslCaps()->versionDeclString();
+ const GrGLSLCaps* glslCaps = ctx->caps()->glslCaps();
+ const char* version = glslCaps->versionDeclString();
// this shader draws fNumStages overlapping circles of increasing opacity (coverage) and
// decreasing size, with the center of each subsequent circle closer to the bottom-right
@@ -106,13 +107,13 @@ GrGLuint GLVec4ScalarBench::setupShader(const GrGLContext* ctx) {
GrGLSLShaderVar oColor("o_color", kVec3f_GrSLType, GrShaderVar::kVaryingOut_TypeModifier);
SkString vshaderTxt(version);
- aPosition.appendDecl(ctx->caps()->glslCaps(), &vshaderTxt);
+ aPosition.appendDecl(glslCaps, &vshaderTxt);
vshaderTxt.append(";\n");
- aColor.appendDecl(ctx->caps()->glslCaps(), &vshaderTxt);
+ aColor.appendDecl(glslCaps, &vshaderTxt);
vshaderTxt.append(";\n");
- oPosition.appendDecl(ctx->caps()->glslCaps(), &vshaderTxt);
+ oPosition.appendDecl(glslCaps, &vshaderTxt);
vshaderTxt.append(";\n");
- oColor.appendDecl(ctx->caps()->glslCaps(), &vshaderTxt);
+ oColor.appendDecl(glslCaps, &vshaderTxt);
vshaderTxt.append(";\n");
vshaderTxt.append(
@@ -132,18 +133,17 @@ GrGLuint GLVec4ScalarBench::setupShader(const GrGLContext* ctx) {
// next stage.
GrGLSLShaderVar oFragColor("o_FragColor", kVec4f_GrSLType, GrShaderVar::kOut_TypeModifier);
SkString fshaderTxt(version);
- GrGLAppendGLSLDefaultFloatPrecisionDeclaration(kDefault_GrSLPrecision, gl->fStandard,
- &fshaderTxt);
+ GrGLSLAppendDefaultFloatPrecisionDeclaration(kDefault_GrSLPrecision, *glslCaps, &fshaderTxt);
oPosition.setTypeModifier(GrShaderVar::kVaryingIn_TypeModifier);
- oPosition.appendDecl(ctx->caps()->glslCaps(), &fshaderTxt);
+ oPosition.appendDecl(glslCaps, &fshaderTxt);
fshaderTxt.append(";\n");
oColor.setTypeModifier(GrShaderVar::kVaryingIn_TypeModifier);
- oColor.appendDecl(ctx->caps()->glslCaps(), &fshaderTxt);
+ oColor.appendDecl(glslCaps, &fshaderTxt);
fshaderTxt.append(";\n");
const char* fsOutName;
- if (ctx->caps()->glslCaps()->mustDeclareFragmentShaderOutput()) {
- oFragColor.appendDecl(ctx->caps()->glslCaps(), &fshaderTxt);
+ if (glslCaps->mustDeclareFragmentShaderOutput()) {
+ oFragColor.appendDecl(glslCaps, &fshaderTxt);
fshaderTxt.append(";\n");
fsOutName = oFragColor.c_str();
} else {
« no previous file with comments | « bench/GLInstancedArraysBench.cpp ('k') | bench/GLVertexAttributesBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698