[Title] Fix webgl shader compiling issue.
[Issue#] TWEB-1118
[Problem] Fragment shader which contains "Gl_OES_standard_derivatives" is not compiled properly.
[Cause] ANGLE compiler did not enable "Gl_OES_standard_derivatives".
[Solution] Enable "Gl_OES_standard_derivatives".
Change-Id: I78b4a75f3616984ae5f48522283ea5bddcf85ff5
namespace WebCore {
-Extensions3DTizen::Extensions3DTizen()
+Extensions3DTizen::Extensions3DTizen(GraphicsContext3DInternal* context)
+ : m_context(context)
{
initialize();
}
return m_availableExtensions.contains(name);
}
+void Extensions3DTizen::ensureEnabled(const String& name)
+{
+#if ENABLE(TIZEN_WEBGL_ANGLE_INTEGRATION)
+ if (name == "GL_OES_standard_derivatives") {
+ // Enable support in ANGLE (if not enabled already)
+ ANGLEWebKitBridge& compiler = m_context->m_compiler;
+ ShBuiltInResources ANGLEResources = compiler.getResources();
+ if (!ANGLEResources.OES_standard_derivatives) {
+ ANGLEResources.OES_standard_derivatives = 1;
+ compiler.setResources(ANGLEResources);
+ }
+ }
+#endif
+}
+
+bool Extensions3DTizen::isEnabled(const String& name)
+{
+#if ENABLE(TIZEN_WEBGL_ANGLE_INTEGRATION)
+ if (name == "GL_OES_standard_derivatives") {
+ ANGLEWebKitBridge& compiler = m_context->m_compiler;
+ return compiler.getResources().OES_standard_derivatives;
+ }
+#endif
+ return supports(name);
+}
+
void Extensions3DTizen::initialize()
{
String extensionsString(reinterpret_cast<const char*>(GL_CMD(glGetString(GL_EXTENSIONS))));
#if ENABLE(TIZEN_ACCELERATED_COMPOSITING)
#include "Extensions3D.h"
-#include "GraphicsContext3D.h"
+#include "GraphicsContext3DInternal.h"
namespace WebCore {
class Extensions3DTizen : public Extensions3D {
public:
- Extensions3DTizen();
+ Extensions3DTizen(GraphicsContext3DInternal*);
virtual ~Extensions3DTizen();
void initialize();
virtual bool supports(const String& name) ;
- virtual void ensureEnabled(const String& name) {}
+ virtual void ensureEnabled(const String& name);
- virtual bool isEnabled(const String& name) { return supports(name);}
+ virtual bool isEnabled(const String& name);
virtual int getGraphicsResetStatusARB() { return GraphicsContext3D::NO_ERROR; }
// GL_ANGLE_translated_shader_source
virtual String getTranslatedShaderSourceANGLE(Platform3DObject) { return String(); }
+
+private:
HashSet<String> m_availableExtensions;
+ GraphicsContext3DInternal* m_context;
};
} // namespace WebCore
Extensions3D* GraphicsContext3DInternal::getExtensions()
{
if (!m_extensions)
- m_extensions = adoptPtr(new Extensions3DTizen);
+ m_extensions = adoptPtr(new Extensions3DTizen(this));
return m_extensions.get();
}
#if ENABLE(TIZEN_ACCELERATED_COMPOSITING)
+#if ENABLE(TIZEN_WEBGL_ANGLE_INTEGRATION)
+#include "ANGLEWebKitBridge.h"
+#endif
#include "GraphicsContext3D.h"
#if ENABLE(TIZEN_WEBKIT2)
#include <EGL/egl.h>
GraphicsContext3D::RenderStyle m_renderStyle;
+#if ENABLE(TIZEN_WEBGL_ANGLE_INTEGRATION)
+ friend class Extensions3DTizen;
+ ANGLEWebKitBridge m_compiler;
+#endif
+
#if !ENABLE(TIZEN_WEBKIT2)
Evas_GL* m_evasGL;
Evas_GL_Context* m_context;
#if USE(TIZEN_TEXTURE_MAPPER)
#include "TextureMapperPlatformLayer.h"
#endif
-#if ENABLE(TIZEN_WEBGL_ANGLE_INTEGRATION)
-#include "ANGLEWebKitBridge.h"
-#endif
#if ENABLE(TIZEN_CANVAS_GRAPHICS_SURFACE)
#include "GraphicsSurface.h"
#endif
bool isValid;
} ShaderSourceEntry;
HashMap<Platform3DObject, ShaderSourceEntry> m_shaderSourceMap;
-
- ANGLEWebKitBridge m_compiler;
#endif
//Angle intgration block