summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/libANGLE/Display.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/angle/src/libANGLE/Display.h')
-rw-r--r--src/3rdparty/angle/src/libANGLE/Display.h124
1 files changed, 97 insertions, 27 deletions
diff --git a/src/3rdparty/angle/src/libANGLE/Display.h b/src/3rdparty/angle/src/libANGLE/Display.h
index f80e308347..aa1d1c3b37 100644
--- a/src/3rdparty/angle/src/libANGLE/Display.h
+++ b/src/3rdparty/angle/src/libANGLE/Display.h
@@ -14,15 +14,18 @@
#include <set>
#include <vector>
-#include "libANGLE/Error.h"
+#include "libANGLE/AttributeMap.h"
#include "libANGLE/Caps.h"
#include "libANGLE/Config.h"
-#include "libANGLE/AttributeMap.h"
-#include "libANGLE/renderer/Renderer.h"
+#include "libANGLE/Error.h"
+#include "libANGLE/LoggingAnnotator.h"
+#include "libANGLE/MemoryProgramCache.h"
+#include "libANGLE/Version.h"
namespace gl
{
class Context;
+class TextureManager;
}
namespace rx
@@ -35,6 +38,21 @@ namespace egl
class Device;
class Image;
class Surface;
+class Stream;
+class Thread;
+
+using SurfaceSet = std::set<Surface *>;
+
+struct DisplayState final : private angle::NonCopyable
+{
+ DisplayState();
+ ~DisplayState();
+
+ SurfaceSet surfaceSet;
+};
+
+// Constant coded here as a sanity limit.
+constexpr EGLAttrib kProgramCacheSizeAbsoluteMax = 0x4000000;
class Display final : angle::NonCopyable
{
@@ -42,48 +60,68 @@ class Display final : angle::NonCopyable
~Display();
Error initialize();
- void terminate();
+ Error terminate();
- static egl::Display *GetDisplayFromDevice(void *native_display);
- static egl::Display *GetDisplayFromAttribs(void *native_display, const AttributeMap &attribMap);
+ static Display *GetDisplayFromDevice(Device *device, const AttributeMap &attribMap);
+ static Display *GetDisplayFromNativeDisplay(EGLNativeDisplayType nativeDisplay,
+ const AttributeMap &attribMap);
- static const ClientExtensions &getClientExtensions();
- static const std::string &getClientExtensionString();
+ static const ClientExtensions &GetClientExtensions();
+ static const std::string &GetClientExtensionString();
- std::vector<const Config*> getConfigs(const egl::AttributeMap &attribs) const;
- bool getConfigAttrib(const Config *configuration, EGLint attribute, EGLint *value);
+ std::vector<const Config *> getConfigs(const AttributeMap &attribs) const;
- Error createWindowSurface(const Config *configuration, EGLNativeWindowType window, const AttributeMap &attribs,
+ Error createWindowSurface(const Config *configuration,
+ EGLNativeWindowType window,
+ const AttributeMap &attribs,
Surface **outSurface);
- Error createPbufferSurface(const Config *configuration, const AttributeMap &attribs, Surface **outSurface);
- Error createPbufferFromClientBuffer(const Config *configuration, EGLClientBuffer shareHandle, const AttributeMap &attribs,
+ Error createPbufferSurface(const Config *configuration,
+ const AttributeMap &attribs,
+ Surface **outSurface);
+ Error createPbufferFromClientBuffer(const Config *configuration,
+ EGLenum buftype,
+ EGLClientBuffer clientBuffer,
+ const AttributeMap &attribs,
Surface **outSurface);
- Error createPixmapSurface(const Config *configuration, NativePixmapType nativePixmap, const AttributeMap &attribs,
+ Error createPixmapSurface(const Config *configuration,
+ NativePixmapType nativePixmap,
+ const AttributeMap &attribs,
Surface **outSurface);
- Error createImage(gl::Context *context,
+ Error createImage(const gl::Context *context,
EGLenum target,
EGLClientBuffer buffer,
const AttributeMap &attribs,
Image **outImage);
- Error createContext(const Config *configuration, gl::Context *shareContext, const AttributeMap &attribs,
+ Error createStream(const AttributeMap &attribs, Stream **outStream);
+
+ Error createContext(const Config *configuration,
+ gl::Context *shareContext,
+ const AttributeMap &attribs,
gl::Context **outContext);
- Error makeCurrent(egl::Surface *drawSurface, egl::Surface *readSurface, gl::Context *context);
+ Error makeCurrent(Surface *drawSurface, Surface *readSurface, gl::Context *context);
- void destroySurface(egl::Surface *surface);
- void destroyImage(egl::Image *image);
- void destroyContext(gl::Context *context);
+ Error destroySurface(Surface *surface);
+ void destroyImage(Image *image);
+ void destroyStream(Stream *stream);
+ Error destroyContext(gl::Context *context);
bool isInitialized() const;
bool isValidConfig(const Config *config) const;
- bool isValidContext(gl::Context *context) const;
- bool isValidSurface(egl::Surface *surface) const;
+ bool isValidContext(const gl::Context *context) const;
+ bool isValidSurface(const Surface *surface) const;
bool isValidImage(const Image *image) const;
+ bool isValidStream(const Stream *stream) const;
bool isValidNativeWindow(EGLNativeWindowType window) const;
- static bool isValidDisplay(const egl::Display *display);
+ Error validateClientBuffer(const Config *configuration,
+ EGLenum buftype,
+ EGLClientBuffer clientBuffer,
+ const AttributeMap &attribs);
+
+ static bool isValidDisplay(const Display *display);
static bool isValidNativeDisplay(EGLNativeDisplayType display);
static bool hasExistingWindowSurface(EGLNativeWindowType window);
@@ -91,8 +129,8 @@ class Display final : angle::NonCopyable
bool testDeviceLost();
void notifyDeviceLost();
- Error waitClient() const;
- Error waitNative(EGLint engine, egl::Surface *drawSurface, egl::Surface *readSurface) const;
+ Error waitClient(const gl::Context *context) const;
+ Error waitNative(const gl::Context *context, EGLint engine) const;
const Caps &getCaps() const;
@@ -100,13 +138,31 @@ class Display final : angle::NonCopyable
const std::string &getExtensionString() const;
const std::string &getVendorString() const;
+ EGLint programCacheGetAttrib(EGLenum attrib) const;
+ Error programCacheQuery(EGLint index,
+ void *key,
+ EGLint *keysize,
+ void *binary,
+ EGLint *binarysize);
+ Error programCachePopulate(const void *key,
+ EGLint keysize,
+ const void *binary,
+ EGLint binarysize);
+ EGLint programCacheResize(EGLint limit, EGLenum mode);
+
const AttributeMap &getAttributeMap() const { return mAttributeMap; }
EGLNativeDisplayType getNativeDisplayId() const { return mDisplayId; }
- rx::DisplayImpl *getImplementation() { return mImplementation; }
+ rx::DisplayImpl *getImplementation() const { return mImplementation; }
Device *getDevice() const;
EGLenum getPlatform() const { return mPlatform; }
+ gl::Version getMaxSupportedESVersion() const;
+
+ const DisplayState &getState() const { return mState; }
+
+ gl::Context *getProxyContext() const { return mProxyContext.get(); }
+
private:
Display(EGLenum platform, EGLNativeDisplayType displayId, Device *eglDevice);
@@ -117,6 +173,7 @@ class Display final : angle::NonCopyable
void initDisplayExtensions();
void initVendorString();
+ DisplayState mState;
rx::DisplayImpl *mImplementation;
EGLNativeDisplayType mDisplayId;
@@ -130,7 +187,11 @@ class Display final : angle::NonCopyable
typedef std::set<Image *> ImageSet;
ImageSet mImageSet;
+ typedef std::set<Stream *> StreamSet;
+ StreamSet mStreamSet;
+
bool mInitialized;
+ bool mDeviceLost;
Caps mCaps;
@@ -141,8 +202,17 @@ class Display final : angle::NonCopyable
Device *mDevice;
EGLenum mPlatform;
+ angle::LoggingAnnotator mAnnotator;
+
+ gl::TextureManager *mTextureManager;
+ gl::MemoryProgramCache mMemoryProgramCache;
+ size_t mGlobalTextureShareGroupUsers;
+
+ // This gl::Context is a simple proxy to the Display for the GL back-end entry points
+ // that need access to implementation-specific data, like a Renderer object.
+ angle::UniqueObjectPointer<gl::Context, Display> mProxyContext;
};
-}
+} // namespace egl
#endif // LIBANGLE_DISPLAY_H_