WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
patch
renameclass.patch (text/plain), 23.18 KB, created by
Kalyan
on 2012-12-30 15:18:44 PST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Kalyan
Created:
2012-12-30 15:18:44 PST
Size:
23.18 KB
patch
obsolete
>diff --git ChangeLog ChangeLog >index eac52e5..c70f9bb 100644 >--- ChangeLog >+++ ChangeLog >@@ -1,3 +1,18 @@ >+2012-12-30 Kondapally Kalyan <kalyan.kondapally@intel.com> >+ >+ [EFL] [WebGL] Rename EGLConfigHelper as EGLConfigSelector. >+ https://bugs.webkit.org/show_bug.cgi?id=105876 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This is to sync the naming conventions of our classes in both EGL and GLX implementations. >+ In our GLX implementation, class responsible for the same functionality is named as GLXConfigSelector. >+ This patch renames EGLConfigHelper as EGLConfigSelector. >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Source/cmake/OptionsEfl.cmake: >+ > 2012-12-27 Kondapally Kalyan <kalyan.kondapally@intel.com> > > [EFL][WebGL] Implement EGL support with GLX. >diff --git Source/WebCore/ChangeLog Source/WebCore/ChangeLog >index d1a6c10..7e4d839 100644 >--- Source/WebCore/ChangeLog >+++ Source/WebCore/ChangeLog >@@ -1,3 +1,40 @@ >+ [EFL] [WebGL] Rename EGLConfigHelper as EGLConfigSelector. >+ https://bugs.webkit.org/show_bug.cgi?id=105876 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This is to sync the naming conventions of our classes in both EGL and GLX implementations. >+ In our GLX implementation, class responsible for the same functionality is named as GLXConfigSelector. >+ This patch renames EGLConfigHelper as EGLConfigSelector. >+ >+ * PlatformEfl.cmake: >+ * platform/graphics/surfaces/egl/EGLConfigSelector.cpp: Renamed from Source/WebCore/platform/graphics/surfaces/egl/EGLConfigHelper.cpp. >+ (WebCore): >+ (WebCore::SharedEGLDisplay::deref): >+ (WebCore::SharedEGLDisplay::sharedEGLDisplay): >+ (WebCore::SharedEGLDisplay::SharedEGLDisplay): >+ (WebCore::SharedEGLDisplay::cleanup): >+ (WebCore::SharedEGLDisplay::~SharedEGLDisplay): >+ (WebCore::EGLConfigSelector::EGLConfigSelector): >+ (WebCore::EGLConfigSelector::~EGLConfigSelector): >+ (WebCore::EGLConfigSelector::display): >+ (WebCore::EGLConfigSelector::pBufferContextConfig): >+ (WebCore::EGLConfigSelector::surfaceContextConfig): >+ (WebCore::EGLConfigSelector::nativeVisualId): >+ (WebCore::EGLConfigSelector::reset): >+ (WebCore::EGLConfigSelector::createConfig): >+ * platform/graphics/surfaces/egl/EGLConfigSelector.h: Renamed from Source/WebCore/platform/graphics/surfaces/egl/EGLConfigHelper.h. >+ (WebCore): >+ (SharedEGLDisplay): >+ (WebCore::SharedEGLDisplay::create): >+ (EGLConfigSelector): >+ * platform/graphics/surfaces/egl/EGLSurface.cpp: >+ (WebCore::EGLWindowTransportSurface::EGLWindowTransportSurface): >+ (WebCore::EGLWindowTransportSurface::configuration): >+ (WebCore::EGLWindowTransportSurface::destroy): >+ * platform/graphics/surfaces/egl/EGLSurface.h: >+ (EGLWindowTransportSurface): >+ > 2012-12-30 Philippe Normand <pnormand@igalia.com> > > [GStreamer] webaudio/decode-audio-data-basic.html fails >diff --git Source/WebCore/PlatformEfl.cmake Source/WebCore/PlatformEfl.cmake >index e7e469c..712db0a 100644 >--- Source/WebCore/PlatformEfl.cmake >+++ Source/WebCore/PlatformEfl.cmake >@@ -293,8 +293,9 @@ if (WTF_USE_3D_GRAPHICS) > > if (WTF_USE_EGL) > list(APPEND WebCore_SOURCES >- platform/graphics/surfaces/egl/EGLSurface.cpp >+ platform/graphics/surfaces/egl/EGLConfigSelector.cpp > platform/graphics/surfaces/egl/EGLContext.cpp >+ platform/graphics/surfaces/egl/EGLSurface.cpp > ) > endif () > >diff --git Source/WebCore/platform/graphics/surfaces/egl/EGLConfigHelper.cpp Source/WebCore/platform/graphics/surfaces/egl/EGLConfigHelper.cpp >deleted file mode 100644 >index b08ebaa..0000000 >--- Source/WebCore/platform/graphics/surfaces/egl/EGLConfigHelper.cpp >+++ /dev/null >@@ -1,181 +0,0 @@ >-/* >- * 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 "EGLConfigHelper.h" >- >-#if USE(EGL) >- >-namespace WebCore { >- >-SharedEGLDisplay* SharedEGLDisplay::m_staticSharedEGLDisplay = 0; >- >-static EGLint configAttributeList[] = { >-#if USE(OPENGL_ES_2) >- EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, >-#else >- EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT, >-#endif >- EGL_RED_SIZE, 8, >- EGL_GREEN_SIZE, 8, >- EGL_BLUE_SIZE, 8, >- EGL_STENCIL_SIZE, 8, >- EGL_ALPHA_SIZE, 8, >- EGL_SURFACE_TYPE, EGL_NONE, >- EGL_NONE >-}; >- >-void SharedEGLDisplay::deref() >-{ >- if (derefBase()) { >- m_staticSharedEGLDisplay = 0; >- delete this; >- } >-} >- >-EGLDisplay SharedEGLDisplay::sharedEGLDisplay() >-{ >- return m_eglDisplay; >-} >- >-SharedEGLDisplay::SharedEGLDisplay(NativeSharedDisplay* display) >- : m_eglDisplay(EGL_NO_DISPLAY) >-{ >- if (display) >- m_eglDisplay = eglGetDisplay(reinterpret_cast<EGLNativeDisplayType>(display)); >- else >- m_eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); >- >- if (m_eglDisplay == EGL_NO_DISPLAY) { >- LOG_ERROR("EGLDisplay Initialization failed."); >- return; >- } >- >- EGLBoolean success; >- success = eglInitialize(m_eglDisplay, 0, 0); >- >- if (success != EGL_TRUE) { >- LOG_ERROR("EGLInitialization failed."); >- m_eglDisplay = EGL_NO_DISPLAY; >- } >- >- success = eglBindAPI(eglAPIVersion); >- >- if (success != EGL_TRUE) { >- LOG_ERROR("Failed to set EGL API(%d).", eglGetError()); >- m_eglDisplay = EGL_NO_DISPLAY; >- } >-} >- >-void SharedEGLDisplay::cleanup() >-{ >- if (m_eglDisplay == EGL_NO_DISPLAY) >- return; >- >- eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); >- eglTerminate(m_eglDisplay); >- m_eglDisplay = EGL_NO_DISPLAY; >-} >- >-SharedEGLDisplay::~SharedEGLDisplay() >-{ >- cleanup(); >-} >- >-EGLConfigHelper::EGLConfigHelper(NativeSharedDisplay* display) >- : m_pbufferFBConfig(0) >- , m_surfaceContextFBConfig(0) >-{ >- m_sharedDisplay = SharedEGLDisplay::create(display); >-} >- >-EGLConfigHelper::~EGLConfigHelper() >-{ >-} >- >-PlatformDisplay EGLConfigHelper::display() >-{ >- return m_sharedDisplay->sharedEGLDisplay(); >-} >- >-EGLConfig EGLConfigHelper::pBufferContextConfig() >-{ >- if (!m_pbufferFBConfig) { >- configAttributeList[13] = EGL_PIXMAP_BIT; >- m_pbufferFBConfig = createConfig(configAttributeList); >- } >- >- return m_pbufferFBConfig; >-} >- >-EGLConfig EGLConfigHelper::surfaceContextConfig() >-{ >- if (!m_surfaceContextFBConfig) { >- configAttributeList[13] = EGL_WINDOW_BIT; >- m_surfaceContextFBConfig = createConfig(configAttributeList); >- } >- >- return m_surfaceContextFBConfig; >-} >- >-EGLint EGLConfigHelper::nativeVisualId(const EGLConfig& config) >-{ >- if (display() == EGL_NO_DISPLAY) >- return -1; >- >- EGLint eglValue = 0; >- eglGetConfigAttrib(display(), config, EGL_NATIVE_VISUAL_ID, &eglValue); >- >- return eglValue; >-} >- >-void EGLConfigHelper::reset() >-{ >- m_surfaceContextFBConfig = 0; >- m_pbufferFBConfig = 0; >-} >- >-EGLConfig EGLConfigHelper::createConfig(const int attributes[]) >-{ >- if (display() == EGL_NO_DISPLAY) >- return 0; >- >- int numConfigs; >- EGLConfig config = 0; >- >- if (!eglChooseConfig(display(), attributes, &config, 1, &numConfigs)) >- LOG_ERROR("Failed to get supported configirations."); >- >- if (numConfigs != 1) { >- LOG_ERROR("EGLChooseConfig didn't return exactly one config but (%d).", numConfigs); >- config = 0; >- } >- >- return config; >-} >- >-} >- >-#endif >diff --git Source/WebCore/platform/graphics/surfaces/egl/EGLConfigHelper.h Source/WebCore/platform/graphics/surfaces/egl/EGLConfigHelper.h >deleted file mode 100644 >index 1987011..0000000 >--- Source/WebCore/platform/graphics/surfaces/egl/EGLConfigHelper.h >+++ /dev/null >@@ -1,92 +0,0 @@ >-/* >- * 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 EGLConfigHelper_h >-#define EGLConfigHelper_h >- >-#if USE(EGL) >- >-#include <opengl/GLDefs.h> >-#include <wtf/Noncopyable.h> >-#include <wtf/PassRefPtr.h> >-#include <wtf/RefCounted.h> >-#include <wtf/RefPtr.h> >- >-namespace WebCore { >- >-typedef Display NativeSharedDisplay; >- >-class SharedEGLDisplay : public WTF::RefCountedBase { >- WTF_MAKE_NONCOPYABLE(SharedEGLDisplay); >- >-public: >- static PassRefPtr<SharedEGLDisplay> create(NativeSharedDisplay* display) >- { >- if (!m_staticSharedEGLDisplay) >- m_staticSharedEGLDisplay = new SharedEGLDisplay(display); >- else >- m_staticSharedEGLDisplay->ref(); >- >- return adoptRef(m_staticSharedEGLDisplay); >- } >- >- void deref(); >- EGLDisplay sharedEGLDisplay(); >- >-protected: >- SharedEGLDisplay(NativeSharedDisplay*); >- void cleanup(); >- virtual ~SharedEGLDisplay(); >- >- static SharedEGLDisplay* m_staticSharedEGLDisplay; >- EGLDisplay m_eglDisplay; >-}; >- >-class EGLConfigHelper { >- WTF_MAKE_NONCOPYABLE(EGLConfigHelper); >- >-public: >- EGLConfigHelper(NativeSharedDisplay* = 0); >- virtual ~EGLConfigHelper(); >- PlatformDisplay display(); >- virtual EGLConfig pBufferContextConfig(); >- virtual EGLConfig surfaceContextConfig(); >- EGLint nativeVisualId(const EGLConfig&); >- void reset(); >- >-private: >- EGLConfig createConfig(const int attributes[]); >- >-protected: >- EGLConfig m_pbufferFBConfig; >- EGLConfig m_surfaceContextFBConfig; >- RefPtr<SharedEGLDisplay> m_sharedDisplay; >-}; >- >-} >- >-#endif >- >-#endif >diff --git Source/WebCore/platform/graphics/surfaces/egl/EGLConfigSelector.cpp Source/WebCore/platform/graphics/surfaces/egl/EGLConfigSelector.cpp >new file mode 100644 >index 0000000..cbcd212 >--- /dev/null >+++ Source/WebCore/platform/graphics/surfaces/egl/EGLConfigSelector.cpp >@@ -0,0 +1,181 @@ >+/* >+ * 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 "EGLConfigSelector.h" >+ >+#if USE(EGL) >+ >+namespace WebCore { >+ >+SharedEGLDisplay* SharedEGLDisplay::m_staticSharedEGLDisplay = 0; >+ >+static EGLint configAttributeList[] = { >+#if USE(OPENGL_ES_2) >+ EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, >+#else >+ EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT, >+#endif >+ EGL_RED_SIZE, 8, >+ EGL_GREEN_SIZE, 8, >+ EGL_BLUE_SIZE, 8, >+ EGL_STENCIL_SIZE, 8, >+ EGL_ALPHA_SIZE, 8, >+ EGL_SURFACE_TYPE, EGL_NONE, >+ EGL_NONE >+}; >+ >+void SharedEGLDisplay::deref() >+{ >+ if (derefBase()) { >+ m_staticSharedEGLDisplay = 0; >+ delete this; >+ } >+} >+ >+EGLDisplay SharedEGLDisplay::sharedEGLDisplay() const >+{ >+ return m_eglDisplay; >+} >+ >+SharedEGLDisplay::SharedEGLDisplay(NativeSharedDisplay* display) >+ : m_eglDisplay(EGL_NO_DISPLAY) >+{ >+ if (display) >+ m_eglDisplay = eglGetDisplay(reinterpret_cast<EGLNativeDisplayType>(display)); >+ else >+ m_eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); >+ >+ if (m_eglDisplay == EGL_NO_DISPLAY) { >+ LOG_ERROR("EGLDisplay Initialization failed."); >+ return; >+ } >+ >+ EGLBoolean success; >+ success = eglInitialize(m_eglDisplay, 0, 0); >+ >+ if (success != EGL_TRUE) { >+ LOG_ERROR("EGLInitialization failed."); >+ m_eglDisplay = EGL_NO_DISPLAY; >+ } >+ >+ success = eglBindAPI(eglAPIVersion); >+ >+ if (success != EGL_TRUE) { >+ LOG_ERROR("Failed to set EGL API(%d).", eglGetError()); >+ m_eglDisplay = EGL_NO_DISPLAY; >+ } >+} >+ >+void SharedEGLDisplay::cleanup() >+{ >+ if (m_eglDisplay == EGL_NO_DISPLAY) >+ return; >+ >+ eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); >+ eglTerminate(m_eglDisplay); >+ m_eglDisplay = EGL_NO_DISPLAY; >+} >+ >+SharedEGLDisplay::~SharedEGLDisplay() >+{ >+ cleanup(); >+} >+ >+EGLConfigSelector::EGLConfigSelector(NativeSharedDisplay* display) >+ : m_pbufferFBConfig(0) >+ , m_surfaceContextFBConfig(0) >+{ >+ m_sharedDisplay = SharedEGLDisplay::create(display); >+} >+ >+EGLConfigSelector::~EGLConfigSelector() >+{ >+} >+ >+PlatformDisplay EGLConfigSelector::display() const >+{ >+ return m_sharedDisplay->sharedEGLDisplay(); >+} >+ >+EGLConfig EGLConfigSelector::pBufferContextConfig() >+{ >+ if (!m_pbufferFBConfig) { >+ configAttributeList[13] = EGL_PIXMAP_BIT; >+ m_pbufferFBConfig = createConfig(configAttributeList); >+ } >+ >+ return m_pbufferFBConfig; >+} >+ >+EGLConfig EGLConfigSelector::surfaceContextConfig() >+{ >+ if (!m_surfaceContextFBConfig) { >+ configAttributeList[13] = EGL_WINDOW_BIT; >+ m_surfaceContextFBConfig = createConfig(configAttributeList); >+ } >+ >+ return m_surfaceContextFBConfig; >+} >+ >+EGLint EGLConfigSelector::nativeVisualId(const EGLConfig& config) const >+{ >+ if (display() == EGL_NO_DISPLAY) >+ return -1; >+ >+ EGLint eglValue = 0; >+ eglGetConfigAttrib(display(), config, EGL_NATIVE_VISUAL_ID, &eglValue); >+ >+ return eglValue; >+} >+ >+void EGLConfigSelector::reset() >+{ >+ m_surfaceContextFBConfig = 0; >+ m_pbufferFBConfig = 0; >+} >+ >+EGLConfig EGLConfigSelector::createConfig(const int attributes[]) >+{ >+ if (display() == EGL_NO_DISPLAY) >+ return 0; >+ >+ int numConfigs; >+ EGLConfig config = 0; >+ >+ if (!eglChooseConfig(display(), attributes, &config, 1, &numConfigs)) >+ LOG_ERROR("Failed to get supported configirations."); >+ >+ if (numConfigs != 1) { >+ LOG_ERROR("EGLChooseConfig didn't return exactly one config but (%d).", numConfigs); >+ config = 0; >+ } >+ >+ return config; >+} >+ >+} >+ >+#endif >diff --git Source/WebCore/platform/graphics/surfaces/egl/EGLConfigSelector.h Source/WebCore/platform/graphics/surfaces/egl/EGLConfigSelector.h >new file mode 100644 >index 0000000..6631adc >--- /dev/null >+++ Source/WebCore/platform/graphics/surfaces/egl/EGLConfigSelector.h >@@ -0,0 +1,92 @@ >+/* >+ * 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 EGLConfigSelector_h >+#define EGLConfigSelector_h >+ >+#if USE(EGL) >+ >+#include <opengl/GLDefs.h> >+#include <wtf/Noncopyable.h> >+#include <wtf/PassRefPtr.h> >+#include <wtf/RefCounted.h> >+#include <wtf/RefPtr.h> >+ >+namespace WebCore { >+ >+typedef Display NativeSharedDisplay; >+ >+class SharedEGLDisplay : public WTF::RefCountedBase { >+ WTF_MAKE_NONCOPYABLE(SharedEGLDisplay); >+ >+public: >+ static PassRefPtr<SharedEGLDisplay> create(NativeSharedDisplay* display) >+ { >+ if (!m_staticSharedEGLDisplay) >+ m_staticSharedEGLDisplay = new SharedEGLDisplay(display); >+ else >+ m_staticSharedEGLDisplay->ref(); >+ >+ return adoptRef(m_staticSharedEGLDisplay); >+ } >+ >+ void deref(); >+ EGLDisplay sharedEGLDisplay() const; >+ >+protected: >+ SharedEGLDisplay(NativeSharedDisplay*); >+ void cleanup(); >+ virtual ~SharedEGLDisplay(); >+ >+ static SharedEGLDisplay* m_staticSharedEGLDisplay; >+ EGLDisplay m_eglDisplay; >+}; >+ >+class EGLConfigSelector { >+ WTF_MAKE_NONCOPYABLE(EGLConfigSelector); >+ >+public: >+ EGLConfigSelector(NativeSharedDisplay* = 0); >+ virtual ~EGLConfigSelector(); >+ PlatformDisplay display() const; >+ virtual EGLConfig pBufferContextConfig(); >+ virtual EGLConfig surfaceContextConfig(); >+ EGLint nativeVisualId(const EGLConfig&) const; >+ void reset(); >+ >+private: >+ EGLConfig createConfig(const int attributes[]); >+ >+protected: >+ EGLConfig m_pbufferFBConfig; >+ EGLConfig m_surfaceContextFBConfig; >+ RefPtr<SharedEGLDisplay> m_sharedDisplay; >+}; >+ >+} >+ >+#endif >+ >+#endif >diff --git Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.cpp Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.cpp >index fc940de..992b3a6 100644 >--- Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.cpp >+++ Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.cpp >@@ -34,23 +34,23 @@ EGLWindowTransportSurface::EGLWindowTransportSurface() > : GLPlatformSurface() > { > m_nativeResource = adoptPtr(new NativeOffScreenWindow()); >- m_eglConfigHelper = adoptPtr(new EGLConfigHelper(m_nativeResource->nativeSharedDisplay())); >- m_sharedDisplay = m_eglConfigHelper->display(); >+ m_configSelector = adoptPtr(new EGLConfigSelector(m_nativeResource->nativeSharedDisplay())); >+ m_sharedDisplay = m_configSelector->display(); > > if (m_sharedDisplay == EGL_NO_DISPLAY) { >- m_eglConfigHelper = nullptr; >+ m_configSelector = nullptr; > m_nativeResource = nullptr; > return; > } > >- EGLConfig config = m_eglConfigHelper->surfaceContextConfig(); >+ EGLConfig config = m_configSelector->surfaceContextConfig(); > > if (!config) { > destroy(); > return; > } > >- EGLint visualId = m_eglConfigHelper->nativeVisualId(config); >+ EGLint visualId = m_configSelector->nativeVisualId(config); > > if (visualId == -1) { > destroy(); >@@ -69,7 +69,7 @@ EGLWindowTransportSurface::EGLWindowTransportSurface() > return; > } > >- m_drawable = eglCreateWindowSurface(m_sharedDisplay, m_eglConfigHelper->surfaceContextConfig(), (EGLNativeWindowType)m_bufferHandle, 0); >+ m_drawable = eglCreateWindowSurface(m_sharedDisplay, m_configSelector->surfaceContextConfig(), (EGLNativeWindowType)m_bufferHandle, 0); > > if (m_drawable == EGL_NO_SURFACE) { > LOG_ERROR("Failed to create EGL surface(%d).", eglGetError()); >@@ -83,7 +83,7 @@ EGLWindowTransportSurface::~EGLWindowTransportSurface() > > PlatformSurfaceConfig EGLWindowTransportSurface::configuration() > { >- return m_eglConfigHelper->surfaceContextConfig(); >+ return m_configSelector->surfaceContextConfig(); > } > > void EGLWindowTransportSurface::swapBuffers() >@@ -111,7 +111,7 @@ void EGLWindowTransportSurface::destroy() > m_nativeResource->destroyWindow(m_bufferHandle); > freeEGLResources(); > m_nativeResource = nullptr; >- m_eglConfigHelper = nullptr; >+ m_configSelector = nullptr; > m_bufferHandle = 0; > } > >diff --git Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.h Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.h >index 78863dc..5c288a9 100644 >--- Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.h >+++ Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.h >@@ -28,7 +28,7 @@ > > #if USE(EGL) && USE(GRAPHICS_SURFACE) > >-#include "EGLConfigHelper.h" >+#include "EGLConfigSelector.h" > #include "GLPlatformSurface.h" > > #include <glx/X11WindowResources.h> >@@ -53,7 +53,7 @@ public: > private: > void freeEGLResources(); > OwnPtr<NativeOffScreenWindow> m_nativeResource; >- OwnPtr<EGLConfigHelper> m_eglConfigHelper; >+ OwnPtr<EGLConfigSelector> m_configSelector; > }; > > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
kenneth
:
review+
webkit.review.bot
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 105876
:
180961
|
180963
|
180965