aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLGeometryProcessor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/gl/GrGLGeometryProcessor.h')
-rw-r--r--src/gpu/gl/GrGLGeometryProcessor.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLGeometryProcessor.h b/src/gpu/gl/GrGLGeometryProcessor.h
new file mode 100644
index 0000000000..4b9bd449fb
--- /dev/null
+++ b/src/gpu/gl/GrGLGeometryProcessor.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2013 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrGLGeometryProcessor_DEFINED
+#define GrGLGeometryProcessor_DEFINED
+
+#include "GrGLEffect.h"
+
+/**
+ * If a GL effect needs a GrGLFullShaderBuilder* object to emit vertex code, then it must inherit
+ * from this class. Since paths don't have vertices, this class is only meant to be used internally
+ * by skia, for special cases.
+ */
+class GrGLGeometryProcessor : public GrGLEffect {
+public:
+ GrGLGeometryProcessor(const GrBackendEffectFactory& factory)
+ : INHERITED(factory) { fIsVertexEffect = true; }
+
+ /**
+ * This is similar to emitCode() in the base class, except it takes a full shader builder.
+ * This allows the effect subclass to emit vertex code.
+ */
+ virtual void emitCode(GrGLFullProgramBuilder* builder,
+ const GrDrawEffect& drawEffect,
+ const GrEffectKey& key,
+ const char* outputColor,
+ const char* inputColor,
+ const TransformedCoordsArray& coords,
+ const TextureSamplerArray& samplers) = 0;
+ /**
+ * Provide a default override for base class's emitCode() function.
+ */
+ virtual void emitCode(GrGLProgramBuilder* builder,
+ const GrDrawEffect& drawEffect,
+ const GrEffectKey& key,
+ const char* outputColor,
+ const char* inputColor,
+ const TransformedCoordsArray& coords,
+ const TextureSamplerArray& samplers) SK_OVERRIDE {
+ SkFAIL("GrGLGeometryProcessor requires GrGLFullProgramBuilder* overload for emitCode().");
+ }
+
+
+private:
+ typedef GrGLEffect INHERITED;
+};
+
+#endif