Commit 853f8255 by Jamie Madill Committed by Commit Bot

DisplayImpl: Make waitClient/waitNative non-const.

These methods can mutate the display resources. Necessary for getting rid of ProxyContext and for the Vulkan error refactor. Bug: angleproject:2714 Bug: angleproject:2713 Change-Id: Ibffb1a382ecb064daaa7c664f9fc65cbcf927b37 Reviewed-on: https://chromium-review.googlesource.com/1128927Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 63cc351f
...@@ -959,12 +959,12 @@ void Display::notifyDeviceLost() ...@@ -959,12 +959,12 @@ void Display::notifyDeviceLost()
mDeviceLost = true; mDeviceLost = true;
} }
Error Display::waitClient(const gl::Context *context) const Error Display::waitClient(const gl::Context *context)
{ {
return mImplementation->waitClient(context); return mImplementation->waitClient(context);
} }
Error Display::waitNative(const gl::Context *context, EGLint engine) const Error Display::waitNative(const gl::Context *context, EGLint engine)
{ {
return mImplementation->waitNative(context, engine); return mImplementation->waitNative(context, engine);
} }
......
...@@ -134,8 +134,8 @@ class Display final : public LabeledObject, angle::NonCopyable ...@@ -134,8 +134,8 @@ class Display final : public LabeledObject, angle::NonCopyable
bool testDeviceLost(); bool testDeviceLost();
void notifyDeviceLost(); void notifyDeviceLost();
Error waitClient(const gl::Context *context) const; Error waitClient(const gl::Context *context);
Error waitNative(const gl::Context *context, EGLint engine) const; Error waitNative(const gl::Context *context, EGLint engine);
const Caps &getCaps() const; const Caps &getCaps() const;
......
...@@ -70,8 +70,8 @@ class DisplayImpl : public EGLImplFactory ...@@ -70,8 +70,8 @@ class DisplayImpl : public EGLImplFactory
virtual DeviceImpl *createDevice() = 0; virtual DeviceImpl *createDevice() = 0;
virtual egl::Error waitClient(const gl::Context *context) const = 0; virtual egl::Error waitClient(const gl::Context *context) = 0;
virtual egl::Error waitNative(const gl::Context *context, EGLint engine) const = 0; virtual egl::Error waitNative(const gl::Context *context, EGLint engine) = 0;
virtual gl::Version getMaxSupportedESVersion() const = 0; virtual gl::Version getMaxSupportedESVersion() const = 0;
const egl::Caps &getCaps() const; const egl::Caps &getCaps() const;
......
...@@ -325,7 +325,7 @@ void DisplayD3D::generateCaps(egl::Caps *outCaps) const ...@@ -325,7 +325,7 @@ void DisplayD3D::generateCaps(egl::Caps *outCaps) const
outCaps->textureNPOT = mRenderer->getNativeExtensions().textureNPOT; outCaps->textureNPOT = mRenderer->getNativeExtensions().textureNPOT;
} }
egl::Error DisplayD3D::waitClient(const gl::Context *context) const egl::Error DisplayD3D::waitClient(const gl::Context *context)
{ {
for (egl::Surface *surface : mState.surfaceSet) for (egl::Surface *surface : mState.surfaceSet)
{ {
...@@ -336,7 +336,7 @@ egl::Error DisplayD3D::waitClient(const gl::Context *context) const ...@@ -336,7 +336,7 @@ egl::Error DisplayD3D::waitClient(const gl::Context *context) const
return egl::NoError(); return egl::NoError();
} }
egl::Error DisplayD3D::waitNative(const gl::Context *context, EGLint engine) const egl::Error DisplayD3D::waitNative(const gl::Context *context, EGLint engine)
{ {
egl::Surface *drawSurface = context->getCurrentDrawSurface(); egl::Surface *drawSurface = context->getCurrentDrawSurface();
egl::Surface *readSurface = context->getCurrentReadSurface(); egl::Surface *readSurface = context->getCurrentReadSurface();
......
...@@ -67,8 +67,8 @@ class DisplayD3D : public DisplayImpl ...@@ -67,8 +67,8 @@ class DisplayD3D : public DisplayImpl
std::string getVendorString() const override; std::string getVendorString() const override;
egl::Error waitClient(const gl::Context *context) const override; egl::Error waitClient(const gl::Context *context) override;
egl::Error waitNative(const gl::Context *context, EGLint engine) const override; egl::Error waitNative(const gl::Context *context, EGLint engine) override;
gl::Version getMaxSupportedESVersion() const override; gl::Version getMaxSupportedESVersion() const override;
private: private:
......
...@@ -59,8 +59,8 @@ class DisplayCGL : public DisplayGL ...@@ -59,8 +59,8 @@ class DisplayCGL : public DisplayGL
std::string getVendorString() const override; std::string getVendorString() const override;
egl::Error waitClient(const gl::Context *context) const override; egl::Error waitClient(const gl::Context *context) override;
egl::Error waitNative(const gl::Context *context, EGLint engine) const override; egl::Error waitNative(const gl::Context *context, EGLint engine) override;
gl::Version getMaxSupportedESVersion() const override; gl::Version getMaxSupportedESVersion() const override;
......
...@@ -295,13 +295,13 @@ void DisplayCGL::generateCaps(egl::Caps *outCaps) const ...@@ -295,13 +295,13 @@ void DisplayCGL::generateCaps(egl::Caps *outCaps) const
outCaps->textureNPOT = true; outCaps->textureNPOT = true;
} }
egl::Error DisplayCGL::waitClient(const gl::Context *context) const egl::Error DisplayCGL::waitClient(const gl::Context *context)
{ {
// TODO(cwallez) UNIMPLEMENTED() // TODO(cwallez) UNIMPLEMENTED()
return egl::NoError(); return egl::NoError();
} }
egl::Error DisplayCGL::waitNative(const gl::Context *context, EGLint engine) const egl::Error DisplayCGL::waitNative(const gl::Context *context, EGLint engine)
{ {
// TODO(cwallez) UNIMPLEMENTED() // TODO(cwallez) UNIMPLEMENTED()
return egl::NoError(); return egl::NoError();
......
...@@ -459,13 +459,13 @@ DeviceImpl *DisplayAndroid::createDevice() ...@@ -459,13 +459,13 @@ DeviceImpl *DisplayAndroid::createDevice()
return nullptr; return nullptr;
} }
egl::Error DisplayAndroid::waitClient(const gl::Context *context) const egl::Error DisplayAndroid::waitClient(const gl::Context *context)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED();
return egl::NoError(); return egl::NoError();
} }
egl::Error DisplayAndroid::waitNative(const gl::Context *context, EGLint engine) const egl::Error DisplayAndroid::waitNative(const gl::Context *context, EGLint engine)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED();
return egl::NoError(); return egl::NoError();
......
...@@ -61,8 +61,8 @@ class DisplayAndroid : public DisplayEGL ...@@ -61,8 +61,8 @@ class DisplayAndroid : public DisplayEGL
DeviceImpl *createDevice() override; DeviceImpl *createDevice() override;
egl::Error waitClient(const gl::Context *context) const override; egl::Error waitClient(const gl::Context *context) override;
egl::Error waitNative(const gl::Context *context, EGLint engine) const override; egl::Error waitNative(const gl::Context *context, EGLint engine) override;
egl::Error makeCurrent(egl::Surface *drawSurface, egl::Error makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface, egl::Surface *readSurface,
......
...@@ -982,13 +982,13 @@ bool DisplayOzone::isValidNativeWindow(EGLNativeWindowType window) const ...@@ -982,13 +982,13 @@ bool DisplayOzone::isValidNativeWindow(EGLNativeWindowType window) const
return true; return true;
} }
egl::Error DisplayOzone::waitClient(const gl::Context *context) const egl::Error DisplayOzone::waitClient(const gl::Context *context)
{ {
// TODO(fjhenigman) Implement this. // TODO(fjhenigman) Implement this.
return egl::NoError(); return egl::NoError();
} }
egl::Error DisplayOzone::waitNative(const gl::Context *context, EGLint engine) const egl::Error DisplayOzone::waitNative(const gl::Context *context, EGLint engine)
{ {
// TODO(fjhenigman) Implement this. // TODO(fjhenigman) Implement this.
return egl::NoError(); return egl::NoError();
......
...@@ -142,8 +142,8 @@ class DisplayOzone final : public DisplayEGL ...@@ -142,8 +142,8 @@ class DisplayOzone final : public DisplayEGL
DeviceImpl *createDevice() override; DeviceImpl *createDevice() override;
egl::Error waitClient(const gl::Context *context) const override; egl::Error waitClient(const gl::Context *context) override;
egl::Error waitNative(const gl::Context *context, EGLint engine) const override; egl::Error waitNative(const gl::Context *context, EGLint engine) override;
gl::Version getMaxSupportedESVersion() const override; gl::Version getMaxSupportedESVersion() const override;
......
...@@ -708,13 +708,13 @@ std::string DisplayGLX::getVendorString() const ...@@ -708,13 +708,13 @@ std::string DisplayGLX::getVendorString() const
return ""; return "";
} }
egl::Error DisplayGLX::waitClient(const gl::Context *context) const egl::Error DisplayGLX::waitClient(const gl::Context *context)
{ {
mGLX.waitGL(); mGLX.waitGL();
return egl::NoError(); return egl::NoError();
} }
egl::Error DisplayGLX::waitNative(const gl::Context *context, EGLint engine) const egl::Error DisplayGLX::waitNative(const gl::Context *context, EGLint engine)
{ {
// eglWaitNative is used to notice the driver of changes in X11 for the current surface, such as // eglWaitNative is used to notice the driver of changes in X11 for the current surface, such as
// changes of the window size. We use this event to update the child window of WindowSurfaceGLX // changes of the window size. We use this event to update the child window of WindowSurfaceGLX
......
...@@ -77,8 +77,8 @@ class DisplayGLX : public DisplayGL ...@@ -77,8 +77,8 @@ class DisplayGLX : public DisplayGL
std::string getVendorString() const override; std::string getVendorString() const override;
egl::Error waitClient(const gl::Context *context) const override; egl::Error waitClient(const gl::Context *context) override;
egl::Error waitNative(const gl::Context *context, EGLint engine) const override; egl::Error waitNative(const gl::Context *context, EGLint engine) override;
gl::Version getMaxSupportedESVersion() const override; gl::Version getMaxSupportedESVersion() const override;
......
...@@ -650,13 +650,13 @@ egl::Error DisplayWGL::makeCurrentSurfaceless(gl::Context *context) ...@@ -650,13 +650,13 @@ egl::Error DisplayWGL::makeCurrentSurfaceless(gl::Context *context)
return egl::NoError(); return egl::NoError();
} }
egl::Error DisplayWGL::waitClient(const gl::Context *context) const egl::Error DisplayWGL::waitClient(const gl::Context *context)
{ {
// Unimplemented as this is not needed for WGL // Unimplemented as this is not needed for WGL
return egl::NoError(); return egl::NoError();
} }
egl::Error DisplayWGL::waitNative(const gl::Context *context, EGLint engine) const egl::Error DisplayWGL::waitNative(const gl::Context *context, EGLint engine)
{ {
// Unimplemented as this is not needed for WGL // Unimplemented as this is not needed for WGL
return egl::NoError(); return egl::NoError();
......
...@@ -65,8 +65,8 @@ class DisplayWGL : public DisplayGL ...@@ -65,8 +65,8 @@ class DisplayWGL : public DisplayGL
std::string getVendorString() const override; std::string getVendorString() const override;
egl::Error waitClient(const gl::Context *context) const override; egl::Error waitClient(const gl::Context *context) override;
egl::Error waitNative(const gl::Context *context, EGLint engine) const override; egl::Error waitNative(const gl::Context *context, EGLint engine) override;
egl::Error makeCurrent(egl::Surface *drawSurface, egl::Error makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface, egl::Surface *readSurface,
......
...@@ -115,12 +115,12 @@ DeviceImpl *DisplayNULL::createDevice() ...@@ -115,12 +115,12 @@ DeviceImpl *DisplayNULL::createDevice()
return new DeviceNULL(); return new DeviceNULL();
} }
egl::Error DisplayNULL::waitClient(const gl::Context *context) const egl::Error DisplayNULL::waitClient(const gl::Context *context)
{ {
return egl::NoError(); return egl::NoError();
} }
egl::Error DisplayNULL::waitNative(const gl::Context *context, EGLint engine) const egl::Error DisplayNULL::waitNative(const gl::Context *context, EGLint engine)
{ {
return egl::NoError(); return egl::NoError();
} }
......
...@@ -41,8 +41,8 @@ class DisplayNULL : public DisplayImpl ...@@ -41,8 +41,8 @@ class DisplayNULL : public DisplayImpl
DeviceImpl *createDevice() override; DeviceImpl *createDevice() override;
egl::Error waitClient(const gl::Context *context) const override; egl::Error waitClient(const gl::Context *context) override;
egl::Error waitNative(const gl::Context *context, EGLint engine) const override; egl::Error waitNative(const gl::Context *context, EGLint engine) override;
gl::Version getMaxSupportedESVersion() const override; gl::Version getMaxSupportedESVersion() const override;
SurfaceImpl *createWindowSurface(const egl::SurfaceState &state, SurfaceImpl *createWindowSurface(const egl::SurfaceState &state,
......
...@@ -76,7 +76,7 @@ DeviceImpl *DisplayVk::createDevice() ...@@ -76,7 +76,7 @@ DeviceImpl *DisplayVk::createDevice()
return nullptr; return nullptr;
} }
egl::Error DisplayVk::waitClient(const gl::Context *context) const egl::Error DisplayVk::waitClient(const gl::Context *context)
{ {
// TODO(jmadill): Call flush instead of finish once it is implemented in RendererVK. // TODO(jmadill): Call flush instead of finish once it is implemented in RendererVK.
// http://anglebug.com/2504 // http://anglebug.com/2504
...@@ -85,7 +85,7 @@ egl::Error DisplayVk::waitClient(const gl::Context *context) const ...@@ -85,7 +85,7 @@ egl::Error DisplayVk::waitClient(const gl::Context *context) const
return mRenderer->finish(context); return mRenderer->finish(context);
} }
egl::Error DisplayVk::waitNative(const gl::Context *context, EGLint engine) const egl::Error DisplayVk::waitNative(const gl::Context *context, EGLint engine)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED();
return egl::EglBadAccess(); return egl::EglBadAccess();
......
...@@ -36,8 +36,8 @@ class DisplayVk : public DisplayImpl ...@@ -36,8 +36,8 @@ class DisplayVk : public DisplayImpl
DeviceImpl *createDevice() override; DeviceImpl *createDevice() override;
egl::Error waitClient(const gl::Context *context) const override; egl::Error waitClient(const gl::Context *context) override;
egl::Error waitNative(const gl::Context *context, EGLint engine) const override; egl::Error waitNative(const gl::Context *context, EGLint engine) override;
SurfaceImpl *createWindowSurface(const egl::SurfaceState &state, SurfaceImpl *createWindowSurface(const egl::SurfaceState &state,
EGLNativeWindowType window, EGLNativeWindowType window,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment