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

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

Issue 576543005: Breaking out full program and frag only (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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/builders/GrGLFragmentOnlyProgramBuilder.h ('k') | src/gpu/gl/builders/GrGLFullProgramBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLFragmentOnlyProgramBuilder.cpp
diff --git a/src/gpu/gl/builders/GrGLFragmentOnlyProgramBuilder.cpp b/src/gpu/gl/builders/GrGLFragmentOnlyProgramBuilder.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..3ad6b446c1523d76b7e45f5555bdd7ee5f5e4d30
--- /dev/null
+++ b/src/gpu/gl/builders/GrGLFragmentOnlyProgramBuilder.cpp
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "GrGLFragmentOnlyProgramBuilder.h"
+#include "../GrGpuGL.h"
+
+GrGLFragmentOnlyProgramBuilder::GrGLFragmentOnlyProgramBuilder(GrGpuGL* gpu,
+ const GrGLProgramDesc& desc)
+ : INHERITED(gpu, desc) {
+ SkASSERT(!desc.getHeader().fRequiresVertexShader);
+ SkASSERT(gpu->glCaps().pathRenderingSupport());
+ SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fColorInput);
+ SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fCoverageInput);
+}
+
+int GrGLFragmentOnlyProgramBuilder::addTexCoordSets(int count) {
+ int firstFreeCoordSet = fTexCoordSetCnt;
+ fTexCoordSetCnt += count;
+ SkASSERT(gpu()->glCaps().maxFixedFunctionTextureCoords() >= fTexCoordSetCnt);
+ return firstFreeCoordSet;
+}
+
+GrGLProgramEffects* GrGLFragmentOnlyProgramBuilder::createAndEmitEffects(
+ const GrEffectStage* effectStages[], int effectCnt,
+ const GrGLProgramDesc::EffectKeyProvider& keyProvider, GrGLSLExpr4* inOutFSColor) {
+
+ GrGLPathTexGenProgramEffectsBuilder pathTexGenEffectsBuilder(this,
+ effectCnt);
+ this->INHERITED::createAndEmitEffects(&pathTexGenEffectsBuilder,
+ effectStages,
+ effectCnt,
+ keyProvider,
+ inOutFSColor);
+ return pathTexGenEffectsBuilder.finish();
+}
« no previous file with comments | « src/gpu/gl/builders/GrGLFragmentOnlyProgramBuilder.h ('k') | src/gpu/gl/builders/GrGLFullProgramBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698