Title: [219356] trunk/Source/WebCore
Revision
219356
Author
[email protected]
Date
2017-07-11 13:21:49 -0700 (Tue, 11 Jul 2017)

Log Message

Remove unused OpenGL files
https://bugs.webkit.org/show_bug.cgi?id=174371

Reviewed by Timothy Hatcher.

* platform/graphics/opengl/GLPlatformContext.cpp: Removed.
* platform/graphics/opengl/GLPlatformContext.h: Removed.
* platform/graphics/opengl/GLPlatformSurface.h: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (219355 => 219356)


--- trunk/Source/WebCore/ChangeLog	2017-07-11 20:11:57 UTC (rev 219355)
+++ trunk/Source/WebCore/ChangeLog	2017-07-11 20:21:49 UTC (rev 219356)
@@ -1,3 +1,14 @@
+2017-07-11  Michael Catanzaro  <[email protected]>
+
+        Remove unused OpenGL files
+        https://bugs.webkit.org/show_bug.cgi?id=174371
+
+        Reviewed by Timothy Hatcher.
+
+        * platform/graphics/opengl/GLPlatformContext.cpp: Removed.
+        * platform/graphics/opengl/GLPlatformContext.h: Removed.
+        * platform/graphics/opengl/GLPlatformSurface.h: Removed.
+
 2017-07-11  Chris Dumez  <[email protected]>
 
         Window's [[OwnPropertyKeys]] is wrong for cross origin windows

Deleted: trunk/Source/WebCore/platform/graphics/opengl/GLPlatformContext.cpp (219355 => 219356)


--- trunk/Source/WebCore/platform/graphics/opengl/GLPlatformContext.cpp	2017-07-11 20:11:57 UTC (rev 219355)
+++ trunk/Source/WebCore/platform/graphics/opengl/GLPlatformContext.cpp	2017-07-11 20:21:49 UTC (rev 219356)
@@ -1,273 +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"
-
-#if ENABLE(GRAPHICS_CONTEXT_3D)
-#include "GLPlatformContext.h"
-
-#if USE(GLX)
-#include "GLXContext.h"
-#elif USE(EGL)
-#include "EGLContext.h"
-#endif
-
-#include "NotImplemented.h"
-
-namespace WebCore {
-
-#if USE(OPENGL_ES_2)
-static PFNGLGETGRAPHICSRESETSTATUSEXTPROC glGetGraphicsResetStatus = 0;
-#else
-static PFNGLGETGRAPHICSRESETSTATUSARBPROC glGetGraphicsResetStatus = 0;
-#endif
-
-class GLCurrentContextWrapper : public GLPlatformContext {
-
-public:
-    GLCurrentContextWrapper()
-        : GLPlatformContext()
-    {
-#if USE(GLX)
-        m_contextHandle = glXGetCurrentContext();
-#elif USE(EGL)
-        m_contextHandle = eglGetCurrentContext();
-#endif
-    }
-
-    virtual ~GLCurrentContextWrapper() { }
-
-    bool isCurrentContext() const override
-    {
-        return true;
-    }
-};
-
-static std::unique_ptr<GLPlatformContext> createOffScreenContext()
-{
-#if USE(GLX)
-    return std::make_unique<GLXOffScreenContext>();
-#elif USE(EGL)
-    return std::make_unique<EGLOffScreenContext>();
-#else
-    return nullptr;
-#endif
-}
-
-static HashSet<String> parseExtensions(const String& extensionsString)
-{
-    Vector<String> extNames;
-    extensionsString.split(' ', extNames);
-    HashSet<String> splitExtNames;
-    unsigned size = extNames.size();
-    for (unsigned i = 0; i < size; ++i)
-        splitExtNames.add(extNames[i]);
-    extNames.clear();
-
-    return splitExtNames;
-}
-
-static void resolveResetStatusExtension()
-{
-    static bool resolvedRobustnessExtension = false;
-    if (!resolvedRobustnessExtension) {
-        resolvedRobustnessExtension = true;
-#if USE(OPENGL_ES_2)
-        glGetGraphicsResetStatus = reinterpret_cast<PFNGLGETGRAPHICSRESETSTATUSEXTPROC>(eglGetProcAddress("glGetGraphicsResetStatusEXT"));
-#elif USE(EGL)
-        glGetGraphicsResetStatus = reinterpret_cast<PFNGLGETGRAPHICSRESETSTATUSARBPROC>(eglGetProcAddress("glGetGraphicsResetStatusARB"));
-#elif USE(GLX)
-        glGetGraphicsResetStatus = reinterpret_cast<PFNGLGETGRAPHICSRESETSTATUSARBPROC>(glXGetProcAddressARB(reinterpret_cast<const GLubyte*>("glGetGraphicsResetStatusARB")));
-#endif
-    }
-}
-
-std::unique_ptr<GLPlatformContext> GLPlatformContext::createContext(GraphicsContext3D::RenderStyle renderStyle)
-{
-#if !USE(OPENGL_ES_2)
-    if (!initializeOpenGLShims())
-        return nullptr;
-#endif
-
-    switch (renderStyle) {
-    case GraphicsContext3D::RenderOffscreen:
-        return createOffScreenContext();
-    case GraphicsContext3D::RenderToCurrentGLContext:
-        return std::make_unique<GLCurrentContextWrapper>();
-    case GraphicsContext3D::RenderDirectlyToHostWindow:
-        ASSERT_NOT_REACHED();
-        break;
-    }
-
-    return nullptr;
-}
-
-bool GLPlatformContext::supportsGLExtension(const String& name)
-{
-    static HashSet<String> supportedExtensions;
-
-    if (!supportedExtensions.size()) {
-        String rawExtensions = reinterpret_cast<const char*>(::glGetString(GL_EXTENSIONS));
-        supportedExtensions = parseExtensions(rawExtensions);
-    }
-
-    if (supportedExtensions.contains(name))
-        return true;
-
-    return false;
-}
-
-#if USE(EGL)
-bool GLPlatformContext::supportsEGLExtension(EGLDisplay display, const String& name)
-{
-    static HashSet<String> supportedExtensions;
-
-    if (!supportedExtensions.size()) {
-        if (display == EGL_NO_DISPLAY)
-            return false;
-
-        String rawExtensions = reinterpret_cast<const char*>(eglQueryString(display, EGL_EXTENSIONS));
-        supportedExtensions = parseExtensions(rawExtensions);
-    }
-
-    if (supportedExtensions.contains(name))
-        return true;
-
-    return false;
-}
-#endif
-
-#if USE(GLX)
-bool GLPlatformContext::supportsGLXExtension(Display* display, const String& name)
-{
-    static HashSet<String> supportedExtensions;
-
-    if (!supportedExtensions.size()) {
-        if (!display)
-            return false;
-
-        String rawExtensions = glXQueryExtensionsString(display, DefaultScreen(display));
-        supportedExtensions = parseExtensions(rawExtensions);
-    }
-
-    if (supportedExtensions.contains(name))
-        return true;
-
-    return false;
-}
-#endif
-
-GLPlatformContext::GLPlatformContext()
-    : m_contextHandle(0)
-    , m_resetLostContext(false)
-{
-}
-
-GLPlatformContext::~GLPlatformContext()
-{
-}
-
-bool GLPlatformContext::makeCurrent(GLPlatformSurface* surface)
-{
-    m_contextLost = false;
-
-    if (isCurrentContext() && (!surface || surface->isCurrentDrawable()))
-        return true;
-
-    GLPlatformContext* currentContext = 0;
-
-    if (!surface || (surface && !surface->drawable()))
-        platformReleaseCurrent();
-    else if (platformMakeCurrent(surface)) {
-        currentContext = this;
-        surface->onMakeCurrent();
-    }
-
-    if (m_resetLostContext) {
-        resolveResetStatusExtension();
-
-        if (glGetGraphicsResetStatus) {
-            GLenum status = glGetGraphicsResetStatus();
-
-            switch (status) {
-            case PLATFORMCONTEXT_NO_ERROR:
-                break;
-            case PLATFORMCONTEXT_GUILTY_CONTEXT_RESET:
-                m_contextLost = true;
-                break;
-            case PLATFORMCONTEXT_INNOCENT_CONTEXT_RESET:
-                break;
-            case PLATFORMCONTEXT_UNKNOWN_CONTEXT_RESET:
-                m_contextLost = true;
-                break;
-            default:
-                break;
-            }
-        }
-    }
-
-    return currentContext;
-}
-
-bool GLPlatformContext::isValid() const
-{
-    return !m_contextLost;
-}
-
-void GLPlatformContext::releaseCurrent()
-{
-    if (isCurrentContext())
-        platformReleaseCurrent();
-}
-
-PlatformContext GLPlatformContext::handle() const
-{
-    return m_contextHandle;
-}
-
-bool GLPlatformContext::initialize(GLPlatformSurface*, PlatformContext)
-{
-    return true;
-}
-
-bool GLPlatformContext::platformMakeCurrent(GLPlatformSurface*)
-{
-    return true;
-}
-
-void GLPlatformContext::platformReleaseCurrent()
-{
-    notImplemented();
-}
-
-void GLPlatformContext::destroy()
-{
-    m_contextHandle = 0;
-    m_resetLostContext = false;
-}
-
-} // namespace WebCore
-
-#endif

Deleted: trunk/Source/WebCore/platform/graphics/opengl/GLPlatformContext.h (219355 => 219356)


--- trunk/Source/WebCore/platform/graphics/opengl/GLPlatformContext.h	2017-07-11 20:11:57 UTC (rev 219355)
+++ trunk/Source/WebCore/platform/graphics/opengl/GLPlatformContext.h	2017-07-11 20:21:49 UTC (rev 219356)
@@ -1,94 +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 GLPlatformContext_h
-#define GLPlatformContext_h
-
-#include "GLDefs.h"
-#include "GLPlatformSurface.h"
-#include "GraphicsContext3D.h"
-#include <wtf/Noncopyable.h>
-
-// Encapsulates an OpenGL context, hiding platform specific management.
-namespace WebCore {
-
-class GLPlatformContext {
-    WTF_MAKE_NONCOPYABLE(GLPlatformContext);
-
-public:
-    // From http://www.khronos.org/registry/gles/extensions/EXT/EXT_robustness.txt
-    enum PlatformContextReset {
-        PLATFORMCONTEXT_NO_ERROR = 0x0000,
-        PLATFORMCONTEXT_GUILTY_CONTEXT_RESET = 0x8253,
-        PLATFORMCONTEXT_INNOCENT_CONTEXT_RESET = 0x8254,
-        PLATFORMCONTEXT_UNKNOWN_CONTEXT_RESET = 0x8255,
-    };
-
-    static std::unique_ptr<GLPlatformContext> createContext(GraphicsContext3D::RenderStyle);
-
-    static bool supportsGLExtension(const String&);
-
-#if USE(EGL)
-    static bool supportsEGLExtension(EGLDisplay, const String&);
-#endif
-
-#if USE(GLX)
-    static bool supportsGLXExtension(Display*, const String&);
-#endif
-
-    virtual ~GLPlatformContext();
-
-    virtual bool initialize(GLPlatformSurface*, PlatformContext = 0);
-
-    // Makes this and surface as current context and drawable.
-    // Calling this function with no surface is same as calling releaseCurrent.
-    // Does nothing if this is already current Context.
-    bool makeCurrent(GLPlatformSurface* = 0);
-
-    // Sets Current Context and Drawable as Null.
-    // Doesn't have any effect if this is not the current Context.
-    void releaseCurrent();
-
-    virtual PlatformContext handle() const;
-
-    virtual bool isCurrentContext() const = 0;
-
-    bool isValid() const;
-
-    // Destroys any GL resources associated with this context.
-    virtual void destroy();
-
-protected:
-    GLPlatformContext();
-    virtual bool platformMakeCurrent(GLPlatformSurface*);
-    virtual void platformReleaseCurrent();
-    PlatformContext m_contextHandle;
-    bool m_resetLostContext;
-    bool m_contextLost;
-};
-
-} // namespace WebCore
-
-#endif // GLNativeContext_H

Deleted: trunk/Source/WebCore/platform/graphics/opengl/GLPlatformSurface.h (219355 => 219356)


--- trunk/Source/WebCore/platform/graphics/opengl/GLPlatformSurface.h	2017-07-11 20:11:57 UTC (rev 219355)
+++ trunk/Source/WebCore/platform/graphics/opengl/GLPlatformSurface.h	2017-07-11 20:21:49 UTC (rev 219356)
@@ -1,93 +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 GLPlatformSurface_h
-#define GLPlatformSurface_h
-
-#include "GLDefs.h"
-#include "IntRect.h"
-#include <wtf/Noncopyable.h>
-
-// Encapsulates a surface that can be rendered to with GL, hiding platform
-// specific management.
-namespace WebCore {
-
-class GLPlatformSurface {
-    WTF_MAKE_NONCOPYABLE(GLPlatformSurface);
-
-public:
-    enum Attributes {
-        Default = 0x00, // No Alpha channel. Only R,G,B values set.
-        SupportAlpha = 0x01,
-        DoubleBuffered = 0x02
-    };
-
-    typedef unsigned SurfaceAttributes;
-    // Creates a GL surface used for offscreen rendering.
-    static std::unique_ptr<GLPlatformSurface> createOffScreenSurface(SurfaceAttributes = GLPlatformSurface::Default);
-
-    virtual ~GLPlatformSurface();
-
-    const IntRect& geometry() const;
-
-    // Get the underlying platform specific buffer handle.
-    // The handle will be null if surface doesn't support
-    // buffer sharing.
-    PlatformBufferHandle handle() const;
-
-    PlatformDrawable drawable() const;
-
-    virtual SurfaceAttributes attributes() const;
-
-    virtual void swapBuffers();
-
-    virtual bool isCurrentDrawable() const = 0;
-
-    virtual void onMakeCurrent();
-
-    // Convenience Function to update surface backbuffer with texture contents.
-    // Note that the function doesn't track or restore any GL states.
-    // Function does the following(in order):
-    // a) Blits texture contents to back buffer.
-    // b) Calls Swap Buffers.
-    virtual void updateContents(const uint32_t);
-
-    virtual void setGeometry(const IntRect&);
-
-    virtual PlatformSurfaceConfig configuration();
-
-    virtual void destroy();
-
-protected:
-    GLPlatformSurface(SurfaceAttributes);
-
-    PlatformDrawable m_drawable;
-    PlatformBufferHandle m_bufferHandle;
-    IntRect m_rect;
-};
-
-}
-
-#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to