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

Side by Side Diff: src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp

Issue 1673093002: Use noperspective interpolation for 2D draws (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: formatting Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrGLSLFragmentShaderBuilder.h" 8 #include "GrGLSLFragmentShaderBuilder.h"
9 #include "GrRenderTarget.h" 9 #include "GrRenderTarget.h"
10 #include "gl/GrGLGpu.h" 10 #include "gl/GrGLGpu.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 const char* GrGLSLFragmentShaderBuilder::dstColor() { 169 const char* GrGLSLFragmentShaderBuilder::dstColor() {
170 fHasReadDstColor = true; 170 fHasReadDstColor = true;
171 171
172 const char* override = fProgramBuilder->primitiveProcessor().getDestColorOve rride(); 172 const char* override = fProgramBuilder->primitiveProcessor().getDestColorOve rride();
173 if (override != nullptr) { 173 if (override != nullptr) {
174 return override; 174 return override;
175 } 175 }
176 176
177 const GrGLSLCaps* glslCaps = fProgramBuilder->glslCaps(); 177 const GrGLSLCaps* glslCaps = fProgramBuilder->glslCaps();
178 if (glslCaps->fbFetchSupport()) { 178 if (glslCaps->fbFetchSupport()) {
179 this->addFeature(1 << (GrGLSLFragmentShaderBuilder::kLastGLSLPrivateFeat ure + 1), 179 this->addFeature(1 << kFramebufferFetch_GLSLPrivateFeature,
180 glslCaps->fbFetchExtensionString()); 180 glslCaps->fbFetchExtensionString());
181 181
182 // Some versions of this extension string require declaring custom color output on ES 3.0+ 182 // Some versions of this extension string require declaring custom color output on ES 3.0+
183 const char* fbFetchColorName = glslCaps->fbFetchColorName(); 183 const char* fbFetchColorName = glslCaps->fbFetchColorName();
184 if (glslCaps->fbFetchNeedsCustomOutput()) { 184 if (glslCaps->fbFetchNeedsCustomOutput()) {
185 this->enableCustomOutput(); 185 this->enableCustomOutput();
186 fOutputs[fCustomColorOutputIndex].setTypeModifier(GrShaderVar::kInOu t_TypeModifier); 186 fOutputs[fCustomColorOutputIndex].setTypeModifier(GrShaderVar::kInOu t_TypeModifier);
187 fbFetchColorName = DeclaredColorOutputName(); 187 fbFetchColorName = DeclaredColorOutputName();
188 } 188 }
189 return fbFetchColorName; 189 return fbFetchColorName;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 } 270 }
271 271
272 void GrGLSLFragmentBuilder::onAfterChildProcEmitCode() { 272 void GrGLSLFragmentBuilder::onAfterChildProcEmitCode() {
273 SkASSERT(fSubstageIndices.count() >= 2); 273 SkASSERT(fSubstageIndices.count() >= 2);
274 fSubstageIndices.pop_back(); 274 fSubstageIndices.pop_back();
275 fSubstageIndices.back()++; 275 fSubstageIndices.back()++;
276 int removeAt = fMangleString.findLastOf('_'); 276 int removeAt = fMangleString.findLastOf('_');
277 fMangleString.remove(removeAt, fMangleString.size() - removeAt); 277 fMangleString.remove(removeAt, fMangleString.size() - removeAt);
278 } 278 }
279 279
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698