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

Unified Diff: src/gpu/gl/GrGpuGL_program.cpp

Issue 16180006: separate arrays for color and coverage effects. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add helper function Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGpuGL.h ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGpuGL_program.cpp
diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp
index 5dab982a8df9dc952f791528e6719bd8009bb047..5da8ecffbde6ddeaf6f2aa5feb37a6a79fe741cc 100644
--- a/src/gpu/gl/GrGpuGL_program.cpp
+++ b/src/gpu/gl/GrGpuGL_program.cpp
@@ -84,7 +84,8 @@ int GrGpuGL::ProgramCache::search(const GrGLProgramDesc& desc) const {
}
GrGLProgram* GrGpuGL::ProgramCache::getProgram(const GrGLProgramDesc& desc,
- const GrEffectStage* stages[]) {
+ const GrEffectStage* colorStages[],
+ const GrEffectStage* coverageStages[]) {
#ifdef PROGRAM_CACHE_STATS
++fTotalRequests;
#endif
@@ -119,7 +120,7 @@ GrGLProgram* GrGpuGL::ProgramCache::getProgram(const GrGLProgramDesc& desc,
#ifdef PROGRAM_CACHE_STATS
++fCacheMisses;
#endif
- GrGLProgram* program = GrGLProgram::Create(fGL, desc, stages);
+ GrGLProgram* program = GrGLProgram::Create(fGL, desc, colorStages, coverageStages);
if (NULL == program) {
return NULL;
}
@@ -273,7 +274,8 @@ bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC
return false;
}
- const GrEffectStage* stages[GrDrawState::kNumStages];
+ SkSTArray<8, const GrEffectStage*, true> colorStages;
+ SkSTArray<8, const GrEffectStage*, true> coverageStages;
GrGLProgramDesc desc;
GrGLProgramDesc::Build(this->getDrawState(),
kDrawPoints_DrawType == type,
@@ -282,10 +284,13 @@ bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC
dstCoeff,
this,
dstCopy,
- stages,
+ &colorStages,
+ &coverageStages,
&desc);
- fCurrentProgram.reset(fProgramCache->getProgram(desc, stages));
+ fCurrentProgram.reset(fProgramCache->getProgram(desc,
+ colorStages.begin(),
+ coverageStages.begin()));
if (NULL == fCurrentProgram.get()) {
GrAssert(!"Failed to create program!");
return false;
@@ -301,7 +306,12 @@ bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC
fCurrentProgram->overrideBlend(&srcCoeff, &dstCoeff);
this->flushBlend(kDrawLines_DrawType == type, srcCoeff, dstCoeff);
- fCurrentProgram->setData(this, blendOpts, stages, dstCopy, &fSharedGLProgramState);
+ fCurrentProgram->setData(this,
+ blendOpts,
+ colorStages.begin(),
+ coverageStages.begin(),
+ dstCopy,
+ &fSharedGLProgramState);
}
this->flushStencil(type);
this->flushScissor();
« no previous file with comments | « src/gpu/gl/GrGpuGL.h ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698