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

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

Issue 1462123003: Create GrGLSLVaryingHandler class for program building (Closed) Base URL: https://skia.googlesource.com/skia.git@putCapsOnArgs
Patch Set: add files Created 5 years, 1 month 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
Index: src/gpu/gl/GrGLVaryingHandler.cpp
diff --git a/src/gpu/gl/GrGLVaryingHandler.cpp b/src/gpu/gl/GrGLVaryingHandler.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f10d238168c3ff0adea0cd73b18a15e4bb1b65e1
--- /dev/null
+++ b/src/gpu/gl/GrGLVaryingHandler.cpp
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "gl/GrGLVaryingHandler.h"
+
+#include "gl/GrGLGpu.h"
+#include "gl/builders/GrGLProgramBuilder.h"
+
+
+GrGLSLVaryingHandler::SeparableVaryingHandle GrGLVaryingHandler::addSeparableVarying(
+ const char* name,
+ GrGLSLVertToFrag* v,
+ GrSLPrecision fsPrecision) {
+ GrGLProgramBuilder* glPB = (GrGLProgramBuilder*) fProgramBuilder;
+ // This call is not used for non-NVPR backends.
+ SkASSERT(glPB->gpu()->glCaps().shaderCaps()->pathRenderingSupport() &&
+ glPB->fArgs.fPrimitiveProcessor->isPathRendering() &&
+ !glPB->fArgs.fPrimitiveProcessor->willUseGeoShader() &&
+ glPB->fArgs.fPrimitiveProcessor->numAttribs() == 0);
+ this->addVarying(name, v, fsPrecision);
+ SeparableVaryingInfo& varyingInfo = fSeparableVaryingInfos.push_back();
+ varyingInfo.fVariable = fFragInputs.back();
+ varyingInfo.fLocation = fSeparableVaryingInfos.count() - 1;
+ return SeparableVaryingHandle(varyingInfo.fLocation);
+}

Powered by Google App Engine
This is Rietveld 408576698