summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/gpu/Shader.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/gpu/Shader.h')
-rw-r--r--Source/WebCore/platform/graphics/gpu/Shader.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/gpu/Shader.h b/Source/WebCore/platform/graphics/gpu/Shader.h
index 4f62ca9..35d1a3b 100644
--- a/Source/WebCore/platform/graphics/gpu/Shader.h
+++ b/Source/WebCore/platform/graphics/gpu/Shader.h
@@ -33,6 +33,7 @@
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
+#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -42,13 +43,35 @@ class Color;
class Shader {
WTF_MAKE_NONCOPYABLE(Shader);
+public:
+ enum VertexType {
+ TwoDimensional,
+ LoopBlinnInterior,
+ LoopBlinnExterior
+ };
+
+ enum FillType {
+ SolidFill,
+ TextureFill
+ };
+
+ // Currently only applies to the Loop-Blinn vertex type.
+ enum AntialiasType {
+ NotAntialiased,
+ Antialiased
+ };
+
protected:
Shader(GraphicsContext3D*, unsigned program);
~Shader();
+ static String generateVertex(VertexType, FillType);
+ static String generateFragment(VertexType, FillType, AntialiasType);
+
static void affineTo3x3(const AffineTransform&, float mat[9]);
- static unsigned loadShader(GraphicsContext3D*, unsigned type, const char* shaderSource);
- static unsigned loadProgram(GraphicsContext3D*, const char* vertexShaderSource, const char* fragmentShaderSource);
+ static void affineTo4x4(const AffineTransform&, float mat[16]);
+ static unsigned loadShader(GraphicsContext3D*, unsigned type, const String& shaderSource);
+ static unsigned loadProgram(GraphicsContext3D*, const String& vertexShaderSource, const String& fragmentShaderSource);
GraphicsContext3D* m_context;
unsigned m_program;