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

Unified Diff: src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp

Issue 1417993004: Add version string and force highp NDS transfrom to GLSLCaps (Closed) Base URL: https://skia.googlesource.com/skia.git@renameShaderVar
Patch Set: Fix glslInit 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 | « src/gpu/gl/GrGLGpu.cpp ('k') | src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
diff --git a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
index 4a5814de510346bf0d1be5dfe03607f3d99bf69a..d31482a4bb9a708ef151bff2884d8c3e8c455139 100644
--- a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
@@ -192,14 +192,14 @@ const char* GrGLFragmentShaderBuilder::fragmentPosition() {
const char* GrGLFragmentShaderBuilder::dstColor() {
fHasReadDstColor = true;
- GrGLGpu* gpu = fProgramBuilder->gpu();
- if (gpu->glCaps().glslCaps()->fbFetchSupport()) {
+ const GrGLSLCaps* glslCaps = fProgramBuilder->glslCaps();
+ if (glslCaps->fbFetchSupport()) {
this->addFeature(1 << (GrGLFragmentShaderBuilder::kLastGLSLPrivateFeature + 1),
- gpu->glCaps().glslCaps()->fbFetchExtensionString());
+ glslCaps->fbFetchExtensionString());
// Some versions of this extension string require declaring custom color output on ES 3.0+
- const char* fbFetchColorName = gpu->glCaps().glslCaps()->fbFetchColorName();
- if (gpu->glCaps().glslCaps()->fbFetchNeedsCustomOutput()) {
+ const char* fbFetchColorName = glslCaps->fbFetchColorName();
+ if (glslCaps->fbFetchNeedsCustomOutput()) {
this->enableCustomOutput();
fOutputs[fCustomColorOutputIndex].setTypeModifier(GrShaderVar::kInOut_TypeModifier);
fbFetchColorName = declared_color_output_name();
@@ -213,7 +213,7 @@ const char* GrGLFragmentShaderBuilder::dstColor() {
void GrGLFragmentShaderBuilder::enableAdvancedBlendEquationIfNeeded(GrBlendEquation equation) {
SkASSERT(GrBlendEquationIsAdvanced(equation));
- const GrGLSLCaps& caps = *fProgramBuilder->gpu()->glCaps().glslCaps();
+ const GrGLSLCaps& caps = *fProgramBuilder->glslCaps();
if (!caps.mustEnableAdvBlendEqs()) {
return;
}
@@ -268,7 +268,7 @@ const char* GrGLFragmentShaderBuilder::getSecondaryColorOutputName() const {
bool GrGLFragmentShaderBuilder::compileAndAttachShaders(GrGLuint programId,
SkTDArray<GrGLuint>* shaderIds) {
GrGLGpu* gpu = fProgramBuilder->gpu();
- this->versionDecl() = GrGLGetGLSLVersionDecl(gpu->ctxInfo());
+ this->versionDecl() = fProgramBuilder->glslCaps()->versionDeclString();
GrGLAppendGLSLDefaultFloatPrecisionDeclaration(kDefault_GrSLPrecision,
gpu->glStandard(),
&this->precisionQualifier());
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698