Diff
Modified: trunk/Source/WTF/ChangeLog (133040 => 133041)
--- trunk/Source/WTF/ChangeLog 2012-10-31 16:46:17 UTC (rev 133040)
+++ trunk/Source/WTF/ChangeLog 2012-10-31 16:48:33 UTC (rev 133041)
@@ -1,3 +1,19 @@
+2012-10-31 Christophe Dumez <[email protected]>
+
+ [EFL][WK2][AC] Use smart pointers for Evas_GL types
+ https://bugs.webkit.org/show_bug.cgi?id=100745
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Make OwnPtr usable with Evas_GL type to avoid handling
+ raw pointers in EFL port.
+
+ * wtf/OwnPtrCommon.h:
+ (WTF):
+ * wtf/efl/OwnPtrEfl.cpp:
+ (WTF):
+ (WTF::deleteOwnedPtr):
+
2012-10-29 Anders Carlsson <[email protected]>
Build WebKit as C++11 on Mac
Modified: trunk/Source/WTF/wtf/OwnPtrCommon.h (133040 => 133041)
--- trunk/Source/WTF/wtf/OwnPtrCommon.h 2012-10-31 16:46:17 UTC (rev 133040)
+++ trunk/Source/WTF/wtf/OwnPtrCommon.h 2012-10-31 16:48:33 UTC (rev 133041)
@@ -46,7 +46,10 @@
typedef struct _Eina_Hash Eina_Hash;
typedef struct _Eina_Module Eina_Module;
typedef struct _Evas_Object Evas_Object;
+#if USE(ACCELERATED_COMPOSITING)
+typedef struct _Evas_GL Evas_GL;
#endif
+#endif
namespace WTF {
@@ -75,7 +78,10 @@
WTF_EXPORT_PRIVATE void deleteOwnedPtr(Eina_Hash*);
WTF_EXPORT_PRIVATE void deleteOwnedPtr(Eina_Module*);
WTF_EXPORT_PRIVATE void deleteOwnedPtr(Evas_Object*);
+#if USE(ACCELERATED_COMPOSITING)
+ WTF_EXPORT_PRIVATE void deleteOwnedPtr(Evas_GL*);
#endif
+#endif
} // namespace WTF
Modified: trunk/Source/WTF/wtf/efl/OwnPtrEfl.cpp (133040 => 133041)
--- trunk/Source/WTF/wtf/efl/OwnPtrEfl.cpp 2012-10-31 16:46:17 UTC (rev 133040)
+++ trunk/Source/WTF/wtf/efl/OwnPtrEfl.cpp 2012-10-31 16:48:33 UTC (rev 133041)
@@ -33,6 +33,10 @@
#include <Eina.h>
#include <Evas.h>
+#if USE(ACCELERATED_COMPOSITING)
+#include <Evas_GL.h>
+#endif
+
namespace WTF {
void deleteOwnedPtr(Ecore_Evas* ptr)
@@ -71,4 +75,12 @@
ecore_imf_context_del(ptr);
}
+#if USE(ACCELERATED_COMPOSITING)
+void deleteOwnedPtr(Evas_GL* ptr)
+{
+ if (ptr)
+ evas_gl_free(ptr);
}
+#endif
+
+}
Modified: trunk/Source/WebKit2/ChangeLog (133040 => 133041)
--- trunk/Source/WebKit2/ChangeLog 2012-10-31 16:46:17 UTC (rev 133040)
+++ trunk/Source/WebKit2/ChangeLog 2012-10-31 16:48:33 UTC (rev 133041)
@@ -1,3 +1,51 @@
+2012-10-31 Christophe Dumez <[email protected]>
+
+ [EFL][WK2][AC] Use smart pointers for Evas_GL types
+ https://bugs.webkit.org/show_bug.cgi?id=100745
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Replace raw pointers to Evas_GL, Evas_GL_Context and
+ Evas_GL_Surface by smart pointers in EwkViewImpl.
+
+ C++ wrappers were added for Evas_GL_Context and
+ Evas_GL_Surface in order to use OwnPtr. This is needed
+ because their destroy functions need the Evas_GL.
+
+ * PlatformEfl.cmake:
+ * UIProcess/API/efl/EvasGLContext.cpp: Added.
+ (WebKit):
+ (WebKit::EvasGLContext::EvasGLContext):
+ (WebKit::EvasGLContext::~EvasGLContext):
+ * UIProcess/API/efl/EvasGLContext.h: Added.
+ (WebKit):
+ (EvasGLContext):
+ (WebKit::EvasGLContext::create):
+ (WebKit::EvasGLContext::context):
+ * UIProcess/API/efl/EvasGLSurface.cpp: Added.
+ (WebKit):
+ (WebKit::EvasGLSurface::EvasGLSurface):
+ (WebKit::EvasGLSurface::~EvasGLSurface):
+ * UIProcess/API/efl/EvasGLSurface.h: Added.
+ (WebKit):
+ (EvasGLSurface):
+ (WebKit::EvasGLSurface::create):
+ (WebKit::EvasGLSurface::surface):
+ * UIProcess/API/efl/EwkViewImpl.cpp:
+ (EwkViewImpl::EwkViewImpl):
+ (EwkViewImpl::displayTimerFired):
+ (EwkViewImpl::createGLSurface):
+ (EwkViewImpl::enterAcceleratedCompositingMode):
+ (EwkViewImpl::exitAcceleratedCompositingMode):
+ * UIProcess/API/efl/EwkViewImpl.h:
+ (EwkViewImpl::evasGL):
+ (EwkViewImpl::evasGLContext):
+ (EwkViewImpl::evasGLSurface):
+ (EwkViewImpl::resetEvasGLSurface):
+ (EwkViewImpl):
+ * UIProcess/API/efl/ewk_view.cpp:
+ (_ewk_view_smart_calculate):
+
2012-10-31 Balazs Kelemen <[email protected]>
[Qt][WK2] Fix "Unable to find a renderable master window QQuickView" warnings in tst_QQuickWebView
Modified: trunk/Source/WebKit2/PlatformEfl.cmake (133040 => 133041)
--- trunk/Source/WebKit2/PlatformEfl.cmake 2012-10-31 16:46:17 UTC (rev 133040)
+++ trunk/Source/WebKit2/PlatformEfl.cmake 2012-10-31 16:48:33 UTC (rev 133041)
@@ -42,6 +42,8 @@
UIProcess/API/C/soup/WKSoupRequestManager.cpp
UIProcess/API/efl/EwkViewImpl.cpp
+ UIProcess/API/efl/EvasGLContext.cpp
+ UIProcess/API/efl/EvasGLSurface.cpp
UIProcess/API/efl/ewk_back_forward_list.cpp
UIProcess/API/efl/ewk_back_forward_list_item.cpp
UIProcess/API/efl/ewk_color_picker.cpp
Added: trunk/Source/WebKit2/UIProcess/API/efl/EvasGLContext.cpp (0 => 133041)
--- trunk/Source/WebKit2/UIProcess/API/efl/EvasGLContext.cpp (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EvasGLContext.cpp 2012-10-31 16:48:33 UTC (rev 133041)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "EvasGLContext.h"
+
+#if USE(ACCELERATED_COMPOSITING)
+
+namespace WebKit {
+
+EvasGLContext::EvasGLContext(Evas_GL* evasGL, Evas_GL_Context* passContext)
+ : m_evasGL(evasGL)
+ , m_context(passContext)
+{
+ ASSERT(evasGL);
+ ASSERT(passContext);
+}
+
+EvasGLContext::~EvasGLContext()
+{
+ evas_gl_context_destroy(m_evasGL, m_context);
+}
+
+} // namespace WebKit
+
+#endif // USE(ACCELERATED_COMPOSITING)
Added: trunk/Source/WebKit2/UIProcess/API/efl/EvasGLContext.h (0 => 133041)
--- trunk/Source/WebKit2/UIProcess/API/efl/EvasGLContext.h (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EvasGLContext.h 2012-10-31 16:48:33 UTC (rev 133041)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef EvasGLContext_h
+#define EvasGLContext_h
+
+#if USE(ACCELERATED_COMPOSITING)
+#include <Evas_GL.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace WebKit {
+
+class EvasGLContext {
+public:
+ static PassOwnPtr<EvasGLContext> create(Evas_GL* evasGL)
+ {
+ ASSERT(evasGL);
+ Evas_GL_Context* context = evas_gl_context_create(evasGL, 0);
+ if (!context)
+ return nullptr;
+
+ // Ownership of context is passed to EvasGLContext.
+ return adoptPtr(new EvasGLContext(evasGL, context));
+ }
+ ~EvasGLContext();
+
+ inline Evas_GL_Context* context() const { return m_context; }
+
+private:
+ EvasGLContext(Evas_GL* evasGL, Evas_GL_Context* passContext);
+
+ Evas_GL* m_evasGL;
+ Evas_GL_Context* m_context;
+};
+
+} // namespace WebKit
+
+#endif // USE(ACCELERATED_COMPOSITING)
+
+#endif // EvasGLContext_h
Added: trunk/Source/WebKit2/UIProcess/API/efl/EvasGLSurface.cpp (0 => 133041)
--- trunk/Source/WebKit2/UIProcess/API/efl/EvasGLSurface.cpp (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EvasGLSurface.cpp 2012-10-31 16:48:33 UTC (rev 133041)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "EvasGLSurface.h"
+
+#if USE(ACCELERATED_COMPOSITING)
+
+namespace WebKit {
+
+EvasGLSurface::EvasGLSurface(Evas_GL* evasGL, Evas_GL_Surface* passSurface)
+ : m_evasGL(evasGL)
+ , m_surface(passSurface)
+{
+ ASSERT(evasGL);
+ ASSERT(passSurface);
+}
+
+EvasGLSurface::~EvasGLSurface()
+{
+ evas_gl_surface_destroy(m_evasGL, m_surface);
+}
+
+} // namespace WebKit
+
+#endif // USE(ACCELERATED_COMPOSITING)
Added: trunk/Source/WebKit2/UIProcess/API/efl/EvasGLSurface.h (0 => 133041)
--- trunk/Source/WebKit2/UIProcess/API/efl/EvasGLSurface.h (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EvasGLSurface.h 2012-10-31 16:48:33 UTC (rev 133041)
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef EvasGLSurface_h
+#define EvasGLSurface_h
+
+#if USE(ACCELERATED_COMPOSITING)
+#include <Evas_GL.h>
+#include <WebCore/IntSize.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace WebKit {
+
+class EvasGLSurface {
+public:
+ static PassOwnPtr<EvasGLSurface> create(Evas_GL* evasGL, Evas_GL_Config* cfg, const WebCore::IntSize& size)
+ {
+ ASSERT(evasGL);
+ ASSERT(cfg);
+ Evas_GL_Surface* surface = evas_gl_surface_create(evasGL, cfg, size.width(), size.height());
+ if (!surface)
+ return nullptr;
+
+ // Ownership of surface is passed to EvasGLSurface.
+ return adoptPtr(new EvasGLSurface(evasGL, surface));
+ }
+ ~EvasGLSurface();
+
+ inline Evas_GL_Surface* surface() const { return m_surface; }
+
+private:
+ EvasGLSurface(Evas_GL* evasGL, Evas_GL_Surface* passSurface);
+
+ Evas_GL* m_evasGL;
+ Evas_GL_Surface* m_surface;
+};
+
+} // namespace WebKit
+
+#endif // USE(ACCELERATED_COMPOSITING)
+
+#endif // EvasGLSurface_h
Modified: trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp (133040 => 133041)
--- trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp 2012-10-31 16:46:17 UTC (rev 133040)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp 2012-10-31 16:48:33 UTC (rev 133041)
@@ -57,6 +57,10 @@
#include "WebFullScreenManagerProxy.h"
#endif
+#if USE(ACCELERATED_COMPOSITING)
+#include <Evas_GL.h>
+#endif
+
using namespace WebCore;
using namespace WebKit;
@@ -105,11 +109,6 @@
, m_pageViewportControllerClient(PageViewportControllerClientEfl::create(this))
, m_pageViewportController(adoptPtr(new PageViewportController(m_pageProxy.get(), m_pageViewportControllerClient.get())))
#endif
-#if USE(ACCELERATED_COMPOSITING)
- , m_evasGl(0)
- , m_evasGlContext(0)
- , m_evasGlSurface(0)
-#endif
, m_settings(Ewk_Settings::create(this))
, m_cursorGroup(0)
, m_mouseEventsEnabled(false)
@@ -255,7 +254,7 @@
for (Vector<IntRect>::iterator it = rects.begin(); it != end; ++it) {
IntRect rect = *it;
#if USE(COORDINATED_GRAPHICS)
- evas_gl_make_current(m_evasGl, m_evasGlSurface, m_evasGlContext);
+ evas_gl_make_current(evasGL(), evasGLSurface(), evasGLContext());
m_pageViewportControllerClient->display(rect, IntPoint(sd->view.x, sd->view.y));
#endif
@@ -452,7 +451,7 @@
{
Ewk_View_Smart_Data* sd = smartData();
- Evas_GL_Config evasGlConfig = {
+ Evas_GL_Config evasGLConfig = {
EVAS_GL_RGBA_8888,
EVAS_GL_DEPTH_BIT_8,
EVAS_GL_STENCIL_NONE,
@@ -460,18 +459,18 @@
EVAS_GL_MULTISAMPLE_NONE
};
- ASSERT(!m_evasGlSurface);
- m_evasGlSurface = evas_gl_surface_create(m_evasGl, &evasGlConfig, viewSize.width(), viewSize.height());
- if (!m_evasGlSurface)
+ ASSERT(!m_evasGLSurface);
+ m_evasGLSurface = EvasGLSurface::create(evasGL(), &evasGLConfig, viewSize);
+ if (!m_evasGLSurface)
return false;
Evas_Native_Surface nativeSurface;
- evas_gl_native_surface_get(m_evasGl, m_evasGlSurface, &nativeSurface);
+ evas_gl_native_surface_get(evasGL(), evasGLSurface(), &nativeSurface);
evas_object_image_native_surface_set(sd->image, &nativeSurface);
- evas_gl_make_current(m_evasGl, m_evasGlSurface, m_evasGlContext);
+ evas_gl_make_current(evasGL(), evasGLSurface(), evasGLContext());
- Evas_GL_API* gl = evas_gl_api_get(evasGl());
+ Evas_GL_API* gl = evas_gl_api_get(evasGL());
gl->glViewport(0, 0, viewSize.width() + sd->view.x, viewSize.height() + sd->view.y);
return true;
@@ -479,29 +478,27 @@
bool EwkViewImpl::enterAcceleratedCompositingMode()
{
- if (m_evasGl) {
+ if (m_evasGL) {
EINA_LOG_DOM_WARN(_ewk_log_dom, "Accelerated compositing mode already entered.");
return false;
}
Evas* evas = evas_object_evas_get(m_view);
- m_evasGl = evas_gl_new(evas);
- if (!m_evasGl)
+ m_evasGL = adoptPtr(evas_gl_new(evas));
+ if (!m_evasGL)
return false;
- m_evasGlContext = evas_gl_context_create(m_evasGl, 0);
- if (!m_evasGlContext) {
- evas_gl_free(m_evasGl);
- m_evasGl = 0;
+ m_evasGLContext = EvasGLContext::create(evasGL());
+ if (!m_evasGLContext) {
+ EINA_LOG_DOM_WARN(_ewk_log_dom, "Failed to create GLContext.");
+ m_evasGL.clear();
return false;
}
if (!createGLSurface(size())) {
- evas_gl_context_destroy(m_evasGl, m_evasGlContext);
- m_evasGlContext = 0;
-
- evas_gl_free(m_evasGl);
- m_evasGl = 0;
+ EINA_LOG_DOM_WARN(_ewk_log_dom, "Failed to create GLSurface.");
+ m_evasGLContext.clear();
+ m_evasGL.clear();
return false;
}
@@ -511,21 +508,12 @@
bool EwkViewImpl::exitAcceleratedCompositingMode()
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(m_evasGl, false);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(m_evasGL, false);
- if (m_evasGlSurface) {
- evas_gl_surface_destroy(m_evasGl, m_evasGlSurface);
- m_evasGlSurface = 0;
- }
+ m_evasGLSurface.clear();
+ m_evasGLContext.clear();
+ m_evasGL.clear();
- if (m_evasGlContext) {
- evas_gl_context_destroy(m_evasGl, m_evasGlContext);
- m_evasGlContext = 0;
- }
-
- evas_gl_free(m_evasGl);
- m_evasGl = 0;
-
return true;
}
#endif
Modified: trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h (133040 => 133041)
--- trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h 2012-10-31 16:46:17 UTC (rev 133040)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h 2012-10-31 16:48:33 UTC (rev 133041)
@@ -39,7 +39,8 @@
#endif
#if USE(ACCELERATED_COMPOSITING)
-#include <Evas_GL.h>
+#include "EvasGLContext.h"
+#include "EvasGLSurface.h"
#endif
namespace WebKit {
@@ -81,6 +82,11 @@
class Ewk_Url_Request;
class Ewk_Url_Response;
+#if USE(ACCELERATED_COMPOSITING)
+typedef struct _Evas_GL_Context Evas_GL_Context;
+typedef struct _Evas_GL_Surface Evas_GL_Surface;
+#endif
+
typedef struct Ewk_View_Smart_Data Ewk_View_Smart_Data;
class EwkViewImpl {
@@ -171,10 +177,10 @@
WebKit::PageViewportController* pageViewportController() { return m_pageViewportController.get(); }
#endif
#if USE(ACCELERATED_COMPOSITING)
- Evas_GL* evasGl() { return m_evasGl; }
- Evas_GL_Context* evasGlContext() { return m_evasGlContext; }
- Evas_GL_Surface* evasGlSurface() { return m_evasGlSurface; }
- void resetEvasGlSurface() { m_evasGlSurface = 0; }
+ Evas_GL* evasGL() { return m_evasGL.get(); }
+ Evas_GL_Context* evasGLContext() { return m_evasGLContext ? m_evasGLContext->context() : 0; }
+ Evas_GL_Surface* evasGLSurface() { return m_evasGLSurface ? m_evasGLSurface->surface() : 0; }
+ void resetEvasGLSurface() { m_evasGLSurface.clear(); }
#endif
// FIXME: needs refactoring (split callback invoke)
@@ -200,6 +206,11 @@
// Note, initialization matters.
Evas_Object* m_view;
RefPtr<Ewk_Context> m_context;
+#if USE(ACCELERATED_COMPOSITING)
+ OwnPtr<Evas_GL> m_evasGL;
+ OwnPtr<WebKit::EvasGLContext> m_evasGLContext;
+ OwnPtr<WebKit::EvasGLSurface> m_evasGLSurface;
+#endif
OwnPtr<WebKit::PageClientImpl> m_pageClient;
RefPtr<WebKit::WebPageProxy> m_pageProxy;
OwnPtr<WebKit::PageLoadClientEfl> m_pageLoadClient;
@@ -213,11 +224,6 @@
OwnPtr<WebKit::PageViewportControllerClientEfl> m_pageViewportControllerClient;
OwnPtr<WebKit::PageViewportController> m_pageViewportController;
#endif
-#if USE(ACCELERATED_COMPOSITING)
- Evas_GL* m_evasGl;
- Evas_GL_Context* m_evasGlContext;
- Evas_GL_Surface* m_evasGlSurface;
-#endif
OwnPtr<Ewk_Settings> m_settings;
const char* m_cursorGroup; // This is an address, do not free it or use WKEinaSharedString.
WKEinaSharedString m_faviconURL;
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp (133040 => 133041)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp 2012-10-31 16:46:17 UTC (rev 133040)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp 2012-10-31 16:48:33 UTC (rev 133041)
@@ -423,7 +423,7 @@
impl->pageViewportControllerClient()->updateViewportSize(IntSize(width, height));
#endif
#if USE(ACCELERATED_COMPOSITING)
- needsNewSurface = impl->evasGlSurface();
+ needsNewSurface = impl->evasGLSurface();
#endif
if (impl->page()->drawingArea())
@@ -443,8 +443,7 @@
#if USE(ACCELERATED_COMPOSITING)
if (needsNewSurface) {
- evas_gl_surface_destroy(impl->evasGl(), impl->evasGlSurface());
- impl->resetEvasGlSurface();
+ impl->resetEvasGLSurface();
impl->createGLSurface(IntSize(width, height));
impl->redrawRegion(IntRect(IntPoint(), IntSize(width, height)));
}