summaryrefslogtreecommitdiffstats
path: root/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h')
-rw-r--r--WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h45
1 files changed, 41 insertions, 4 deletions
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
index 5bf439a..319d9d8 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
@@ -33,8 +33,10 @@
#if ENABLE(3D_CANVAS)
+#include "GLSLANG/ShaderLang.h"
#include "WebGraphicsContext3D.h"
+#include <wtf/HashMap.h>
#include <wtf/ListHashSet.h>
#include <wtf/OwnPtr.h>
@@ -60,8 +62,6 @@ public:
//----------------------------------------------------------------------
// WebGraphicsContext3D methods
virtual bool initialize(WebGraphicsContext3D::Attributes attributes, WebView*, bool);
- // FIXME: remove once compositor is switched over to GraphicsContext3D.
- virtual bool initialize(WebGraphicsContext3D::Attributes attributes, WebView*);
virtual bool makeContextCurrent();
virtual int width();
@@ -302,8 +302,7 @@ private:
// need to in order to verify that all enabled vertex arrays have
// a valid buffer bound -- to avoid crashes on certain cards.
unsigned int m_boundArrayBuffer;
- class VertexAttribPointerState {
- public:
+ struct VertexAttribPointerState {
VertexAttribPointerState();
bool enabled;
@@ -325,6 +324,44 @@ private:
ListHashSet<unsigned long> m_syntheticErrors;
OwnPtr<gfx::GLContext> m_glContext;
+
+ // ANGLE related.
+ struct ShaderSourceEntry {
+ ShaderSourceEntry()
+ : type(0)
+ , source(0)
+ , log(0)
+ , translatedSource(0)
+ , isValid(false)
+ {
+ }
+
+ ~ShaderSourceEntry()
+ {
+ if (source)
+ fastFree(source);
+ if (log)
+ fastFree(log);
+ if (translatedSource)
+ fastFree(translatedSource);
+ }
+
+ unsigned long type;
+ char* source;
+ char* log;
+ char* translatedSource;
+ bool isValid;
+ };
+
+ bool angleCreateCompilers();
+ void angleDestroyCompilers();
+ bool angleValidateShaderSource(ShaderSourceEntry& entry);
+
+ typedef HashMap<WebGLId, ShaderSourceEntry> ShaderSourceMap;
+ ShaderSourceMap m_shaderSourceMap;
+
+ ShHandle m_fragmentCompiler;
+ ShHandle m_vertexCompiler;
};
} // namespace WebKit