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

Unified Diff: src/gpu/gl/GrGLPathProgram.h

Issue 1186113007: Refactor separable varying location info to be stored in GrGLProgram subclass (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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
Index: src/gpu/gl/GrGLPathProgram.h
diff --git a/src/gpu/gl/GrGLPathProgram.h b/src/gpu/gl/GrGLPathProgram.h
new file mode 100644
index 0000000000000000000000000000000000000000..f80d1bb69695512c52e634ef11d0ee317a2b3298
--- /dev/null
+++ b/src/gpu/gl/GrGLPathProgram.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrGLPathProgram_DEFINED
+#define GrGLPathProgram_DEFINED
+
+#include "gl/GrGLProgram.h"
+#include "gl/GrGLPathProgramDataManager.h"
+
+/*
+ * The default GrGL programs consist of at the very least a vertex and fragment shader.
+ * 1.3+ Nvpr ignores the vertex shader, but both require
+ * specialized methods for setting transform data. NVPR also requires setting the
+ * projection matrix through a special function call.
+ */
+class GrGLPathProgram : public GrGLProgram {
+protected:
+ typedef GrGLPathProgramDataManager::SeparableVaryingInfoArray SeparableVaryingInfoArray;
+ GrGLPathProgram(GrGLGpu*,
+ const GrProgramDesc&,
+ const BuiltinUniformHandles&,
+ GrGLuint programID,
+ const UniformInfoArray&,
+ const SeparableVaryingInfoArray&,
+ GrGLInstalledGeoProc*,
+ GrGLInstalledXferProc* xferProcessor,
+ GrGLInstalledFragProcs* fragmentProcessors);
+
+private:
+ void didSetData() override;
+ virtual void setTransformData(const GrPrimitiveProcessor&,
+ const GrPendingFragmentStage&,
+ int index,
+ GrGLInstalledFragProc*) override;
+ virtual void onSetRenderTargetState(const GrPrimitiveProcessor&, const GrPipeline&);
+
+ friend class GrGLPathProgramBuilder;
+
+ GrGLPathProgramDataManager fPathProgramDataManager;
+
+ typedef GrGLProgram INHERITED;
+};
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698