Hash :
59126651
Author :
Date :
2020-02-17T09:52:05
Revert "Provide default implementation of rx::DisplayEGL" This reverts commit e82ab75a4ca8f4389a5f23b3a51d9388a92428e2. Reason for revert: crbug.com/1052772 Original change's description: > Provide default implementation of rx::DisplayEGL > > Will allow to use EGL instead of GLX on X11. > > Meant to be used on modern EGL so it requires the extensions > EGL_KHR_no_config_context and EGL_KHR_surfaceless_context. > This keeps the default implementation simple (no pBuffer > fallback) > > Also provide simple WorkerContextEGL. > > Bug: angleproject:4328 > Change-Id: I825c6998e4a3727a13e533ede3d9fb1820edc804 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2031699 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=geofflang@chromium.org,syoussefi@chromium.org,jonahr@google.com,jmadill@chromium.org,julien.isorce@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: angleproject:4328 Change-Id: I62436cad1e6aae0c5e072acb1dab0bd10b2cf722 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2058952 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
//
// Copyright 2016 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// DisplayAndroid.h: Android implementation of egl::Display
#ifndef LIBANGLE_RENDERER_GL_EGL_ANDROID_DISPLAYANDROID_H_
#define LIBANGLE_RENDERER_GL_EGL_ANDROID_DISPLAYANDROID_H_
#include <map>
#include <string>
#include <thread>
#include <vector>
#include "libANGLE/renderer/gl/egl/DisplayEGL.h"
namespace rx
{
class RendererEGL;
class DisplayAndroid : public DisplayEGL
{
public:
DisplayAndroid(const egl::DisplayState &state);
~DisplayAndroid() override;
egl::Error initialize(egl::Display *display) override;
void terminate() override;
ContextImpl *createContext(const gl::State &state,
gl::ErrorSet *errorSet,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs) override;
bool isValidNativeWindow(EGLNativeWindowType window) const override;
egl::Error validateImageClientBuffer(const gl::Context *context,
EGLenum target,
EGLClientBuffer clientBuffer,
const egl::AttributeMap &attribs) const override;
ExternalImageSiblingImpl *createExternalImageSibling(const gl::Context *context,
EGLenum target,
EGLClientBuffer buffer,
const egl::AttributeMap &attribs) override;
egl::Error makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface,
gl::Context *context) override;
void destroyNativeContext(EGLContext context) override;
WorkerContext *createWorkerContext(std::string *infoLog,
EGLContext sharedContext,
const native_egl::AttributeVector workerAttribs) override;
private:
void generateExtensions(egl::DisplayExtensions *outExtensions) const override;
egl::Error createRenderer(EGLContext shareContext,
bool makeNewContextCurrent,
std::shared_ptr<RendererEGL> *outRenderer);
bool mVirtualizedContexts;
bool mSupportsSurfaceless;
EGLSurface mDummyPbuffer;
struct CurrentNativeContext
{
EGLSurface surface = EGL_NO_SURFACE;
EGLContext context = EGL_NO_CONTEXT;
};
std::unordered_map<std::thread::id, CurrentNativeContext> mCurrentNativeContext;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_GL_EGL_ANDROID_DISPLAYANDROID_H_