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

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

Issue 305203002: Use GrGLShaderBuilder::GenProgramOutput in GrGLProgram. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: restore autotunref Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/gl/GrGLProgramEffects.h ('k') | src/gpu/gl/GrGLShaderBuilder.cpp » ('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 #ifndef GrGLShaderBuilder_DEFINED 8 #ifndef GrGLShaderBuilder_DEFINED
9 #define GrGLShaderBuilder_DEFINED 9 #define GrGLShaderBuilder_DEFINED
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 }; 61 };
62 62
63 struct GenProgramOutput { 63 struct GenProgramOutput {
64 GenProgramOutput() 64 GenProgramOutput()
65 : fColorEffects(NULL) 65 : fColorEffects(NULL)
66 , fCoverageEffects(NULL) 66 , fCoverageEffects(NULL)
67 , fHasVertexShader(false) 67 , fHasVertexShader(false)
68 , fTexCoordSetCnt(0) 68 , fTexCoordSetCnt(0)
69 , fProgramID(0) {} 69 , fProgramID(0) {}
70 70
71 GrGLProgramEffects* fColorEffects; 71 GenProgramOutput(const GenProgramOutput& other) {
72 GrGLProgramEffects* fCoverageEffects; 72 *this = other;
73 UniformHandles fUniformHandles; 73 }
74 bool fHasVertexShader; 74
75 int fTexCoordSetCnt; 75 GenProgramOutput& operator=(const GenProgramOutput& other) {
76 GrGLuint fProgramID; 76 fColorEffects.reset(SkRef(other.fColorEffects.get()));
77 fCoverageEffects.reset(SkRef(other.fCoverageEffects.get()));
78 fUniformHandles = other.fUniformHandles;
79 fHasVertexShader = other.fHasVertexShader;
80 fTexCoordSetCnt = other.fTexCoordSetCnt;
81 fProgramID = other.fProgramID;
82 return *this;
83 }
84
85 SkAutoTUnref<GrGLProgramEffects> fColorEffects;
86 SkAutoTUnref<GrGLProgramEffects> fCoverageEffects;
87 UniformHandles fUniformHandles;
88 bool fHasVertexShader;
89 int fTexCoordSetCnt;
90 GrGLuint fProgramID;
77 }; 91 };
78 92
79 static bool GenProgram(GrGpuGL* gpu, 93 static bool GenProgram(GrGpuGL* gpu,
80 GrGLUniformManager* uman, 94 GrGLUniformManager* uman,
81 const GrGLProgramDesc& desc, 95 const GrGLProgramDesc& desc,
82 const GrEffectStage* inColorStages[], 96 const GrEffectStage* inColorStages[],
83 const GrEffectStage* inCoverageStages[], 97 const GrEffectStage* inCoverageStages[],
84 GenProgramOutput* output); 98 GenProgramOutput* output);
85 99
86 virtual ~GrGLShaderBuilder() {} 100 virtual ~GrGLShaderBuilder() {}
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 const EffectKey effectKeys[ ], 513 const EffectKey effectKeys[ ],
500 int effectCnt, 514 int effectCnt,
501 GrGLSLExpr4* inOutFSColor) SK_OVERRIDE; 515 GrGLSLExpr4* inOutFSColor) SK_OVERRIDE;
502 516
503 virtual void emitCodeAfterEffects() SK_OVERRIDE {} 517 virtual void emitCodeAfterEffects() SK_OVERRIDE {}
504 518
505 typedef GrGLShaderBuilder INHERITED; 519 typedef GrGLShaderBuilder INHERITED;
506 }; 520 };
507 521
508 #endif 522 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLProgramEffects.h ('k') | src/gpu/gl/GrGLShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698