gfx/angle/src/libEGL/Display.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 //
     2 // Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
     3 // Use of this source code is governed by a BSD-style license that can be
     4 // found in the LICENSE file.
     5 //
     7 // Display.h: Defines the egl::Display class, representing the abstract
     8 // display on which graphics are drawn. Implements EGLDisplay.
     9 // [EGL 1.4] section 2.1.2 page 3.
    11 #ifndef LIBEGL_DISPLAY_H_
    12 #define LIBEGL_DISPLAY_H_
    14 #include "common/system.h"
    16 #include <set>
    17 #include <vector>
    19 #include "libEGL/Config.h"
    21 namespace gl
    22 {
    23 class Context;
    24 }
    26 namespace egl
    27 {
    28 class Surface;
    30 class Display
    31 {
    32   public:
    33     ~Display();
    35     bool initialize();
    36     void terminate();
    38     static egl::Display *getDisplay(EGLNativeDisplayType displayId);
    40     bool getConfigs(EGLConfig *configs, const EGLint *attribList, EGLint configSize, EGLint *numConfig);
    41     bool getConfigAttrib(EGLConfig config, EGLint attribute, EGLint *value);
    43     EGLSurface createWindowSurface(HWND window, EGLConfig config, const EGLint *attribList);
    44     EGLSurface createOffscreenSurface(EGLConfig config, HANDLE shareHandle, const EGLint *attribList);
    45     EGLContext createContext(EGLConfig configHandle, const gl::Context *shareContext, bool notifyResets, bool robustAccess);
    47     void destroySurface(egl::Surface *surface);
    48     void destroyContext(gl::Context *context);
    50     bool isInitialized() const;
    51     bool isValidConfig(EGLConfig config);
    52     bool isValidContext(gl::Context *context);
    53     bool isValidSurface(egl::Surface *surface);
    54     bool hasExistingWindowSurface(HWND window);
    56     rx::Renderer *getRenderer() { return mRenderer; };
    58     // exported methods must be virtual
    59     virtual void notifyDeviceLost();
    60     virtual void recreateSwapChains();
    62     const char *getExtensionString() const;
    63     const char *getVendorString() const;
    65   private:
    66     DISALLOW_COPY_AND_ASSIGN(Display);
    68     Display(EGLNativeDisplayType displayId, HDC deviceContext);
    70     bool restoreLostDevice();
    72     EGLNativeDisplayType mDisplayId;
    73     const HDC mDc;
    75     bool mSoftwareDevice;
    77     typedef std::set<Surface*> SurfaceSet;
    78     SurfaceSet mSurfaceSet;
    80     ConfigSet mConfigSet;
    82     typedef std::set<gl::Context*> ContextSet;
    83     ContextSet mContextSet;
    85     rx::Renderer *mRenderer;
    87     void initExtensionString();
    88     void initVendorString();
    89     std::string mExtensionString;
    90     std::string mVendorString;
    91 };
    92 }
    94 #endif   // LIBEGL_DISPLAY_H_

mercurial