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

Side by Side Diff: src/gpu/gl/GrGLShaderBuilder.cpp

Issue 212753002: Use fixed function pipeline only when drawing paths (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 8 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
« no previous file with comments | « src/gpu/gl/GrGLProgramEffects.cpp ('k') | src/gpu/gl/GrGpuGL.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 "gl/GrGLShaderBuilder.h" 8 #include "gl/GrGLShaderBuilder.h"
9 #include "gl/GrGLProgram.h" 9 #include "gl/GrGLProgram.h"
10 #include "gl/GrGLUniformHandle.h" 10 #include "gl/GrGLUniformHandle.h"
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 963
964 //////////////////////////////////////////////////////////////////////////////// 964 ////////////////////////////////////////////////////////////////////////////////
965 965
966 GrGLFragmentOnlyShaderBuilder::GrGLFragmentOnlyShaderBuilder(GrGpuGL* gpu, 966 GrGLFragmentOnlyShaderBuilder::GrGLFragmentOnlyShaderBuilder(GrGpuGL* gpu,
967 GrGLUniformManager& uniformManager, 967 GrGLUniformManager& uniformManager,
968 const GrGLProgramDe sc& desc) 968 const GrGLProgramDe sc& desc)
969 : INHERITED(gpu, uniformManager, desc) 969 : INHERITED(gpu, uniformManager, desc)
970 , fNumTexCoordSets(0) { 970 , fNumTexCoordSets(0) {
971 971
972 SkASSERT(!desc.getHeader().fHasVertexCode); 972 SkASSERT(!desc.getHeader().fHasVertexCode);
973 SkASSERT(gpu->glCaps().fixedFunctionSupport());
974 SkASSERT(gpu->glCaps().pathRenderingSupport()); 973 SkASSERT(gpu->glCaps().pathRenderingSupport());
975 SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fColorIn put); 974 SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fColorIn put);
976 SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fCoverag eInput); 975 SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fCoverag eInput);
977 } 976 }
978 977
979 int GrGLFragmentOnlyShaderBuilder::addTexCoordSets(int count) { 978 int GrGLFragmentOnlyShaderBuilder::addTexCoordSets(int count) {
980 int firstFreeCoordSet = fNumTexCoordSets; 979 int firstFreeCoordSet = fNumTexCoordSets;
981 fNumTexCoordSets += count; 980 fNumTexCoordSets += count;
982 SkASSERT(gpu()->glCaps().maxFixedFunctionTextureCoords() >= fNumTexCoordSets ); 981 SkASSERT(gpu()->glCaps().maxFixedFunctionTextureCoords() >= fNumTexCoordSets );
983 return firstFreeCoordSet; 982 return firstFreeCoordSet;
984 } 983 }
985 984
986 GrGLProgramEffects* GrGLFragmentOnlyShaderBuilder::createAndEmitEffects( 985 GrGLProgramEffects* GrGLFragmentOnlyShaderBuilder::createAndEmitEffects(
987 const GrEffectStage* effectStages[], 986 const GrEffectStage* effectStages[],
988 const EffectKey effectKeys[], 987 const EffectKey effectKeys[],
989 int effectCnt, 988 int effectCnt,
990 GrGLSLExpr4* inOutFSColor) { 989 GrGLSLExpr4* inOutFSColor) {
991 990
992 GrGLTexGenProgramEffectsBuilder texGenEffectsBuilder(this, effectCnt); 991 GrGLPathTexGenProgramEffectsBuilder pathTexGenEffectsBuilder(this,
993 this->INHERITED::createAndEmitEffects(&texGenEffectsBuilder, 992 effectCnt);
993 this->INHERITED::createAndEmitEffects(&pathTexGenEffectsBuilder,
994 effectStages, 994 effectStages,
995 effectKeys, 995 effectKeys,
996 effectCnt, 996 effectCnt,
997 inOutFSColor); 997 inOutFSColor);
998 return texGenEffectsBuilder.finish(); 998 return pathTexGenEffectsBuilder.finish();
999 } 999 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLProgramEffects.cpp ('k') | src/gpu/gl/GrGpuGL.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698