Commit 5396f2a6 by Luc Ferron Committed by Commit Bot

Return Error from onMakeCurrent

- Preliminary change for gl_PointCoords fix for Vulkan. Bug: angleproject:2673 Change-Id: Ie43e8aeccf75a8daa4a137b98292d848522ea2f0 Reviewed-on: https://chromium-review.googlesource.com/1134877Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
parent c9c259cc
......@@ -632,7 +632,7 @@ egl::Error Context::makeCurrent(egl::Display *display, egl::Surface *surface)
}
// Notify the renderer of a context switch
mImplementation->onMakeCurrent(this);
ANGLE_TRY(mImplementation->onMakeCurrent(this));
return egl::NoError();
}
......
......@@ -148,7 +148,7 @@ class ContextImpl : public GLImplFactory
virtual GLint64 getTimestamp() = 0;
// Context switching
virtual void onMakeCurrent(const gl::Context *context) = 0;
virtual gl::Error onMakeCurrent(const gl::Context *context) = 0;
// Native capabilities, unmodified by gl::Context.
virtual gl::Caps getNativeCaps() const = 0;
......
......@@ -424,9 +424,10 @@ GLint64 Context11::getTimestamp()
return mRenderer->getTimestamp();
}
void Context11::onMakeCurrent(const gl::Context *context)
gl::Error Context11::onMakeCurrent(const gl::Context *context)
{
ANGLE_SWALLOW_ERR(mRenderer->getStateManager()->onMakeCurrent(context));
ANGLE_TRY(mRenderer->getStateManager()->onMakeCurrent(context));
return gl::NoError();
}
gl::Caps Context11::getNativeCaps() const
......
......@@ -128,7 +128,7 @@ class Context11 : public ContextImpl, public MultisampleTextureInitializer
GLint64 getTimestamp() override;
// Context switching
void onMakeCurrent(const gl::Context *context) override;
gl::Error onMakeCurrent(const gl::Context *context) override;
// Caps queries
gl::Caps getNativeCaps() const override;
......
......@@ -276,8 +276,9 @@ GLint64 Context9::getTimestamp()
return mRenderer->getTimestamp();
}
void Context9::onMakeCurrent(const gl::Context *context)
gl::Error Context9::onMakeCurrent(const gl::Context *context)
{
return gl::NoError();
}
gl::Caps Context9::getNativeCaps() const
......
......@@ -128,7 +128,7 @@ class Context9 : public ContextImpl
GLint64 getTimestamp() override;
// Context switching
void onMakeCurrent(const gl::Context *context) override;
gl::Error onMakeCurrent(const gl::Context *context) override;
// Caps queries
gl::Caps getNativeCaps() const override;
......
......@@ -381,10 +381,11 @@ GLint64 ContextGL::getTimestamp()
return mRenderer->getTimestamp();
}
void ContextGL::onMakeCurrent(const gl::Context *context)
gl::Error ContextGL::onMakeCurrent(const gl::Context *context)
{
// Queries need to be paused/resumed on context switches
ANGLE_SWALLOW_ERR(mRenderer->getStateManager()->onMakeCurrent(context));
ANGLE_TRY(mRenderer->getStateManager()->onMakeCurrent(context));
return gl::NoError();
}
gl::Caps ContextGL::getNativeCaps() const
......
......@@ -181,7 +181,7 @@ class ContextGL : public ContextImpl
GLint64 getTimestamp() override;
// Context switching
void onMakeCurrent(const gl::Context *context) override;
gl::Error onMakeCurrent(const gl::Context *context) override;
// Caps queries
gl::Caps getNativeCaps() const override;
......
......@@ -310,8 +310,9 @@ GLint64 ContextNULL::getTimestamp()
return 0;
}
void ContextNULL::onMakeCurrent(const gl::Context *context)
gl::Error ContextNULL::onMakeCurrent(const gl::Context *context)
{
return gl::NoError();
}
gl::Caps ContextNULL::getNativeCaps() const
......
......@@ -149,7 +149,7 @@ class ContextNULL : public ContextImpl
GLint64 getTimestamp() override;
// Context switching
void onMakeCurrent(const gl::Context *context) override;
gl::Error onMakeCurrent(const gl::Context *context) override;
// Native capabilities, unmodified by gl::Context.
gl::Caps getNativeCaps() const override;
......
......@@ -691,7 +691,7 @@ GLint64 ContextVk::getTimestamp()
return GLint64();
}
void ContextVk::onMakeCurrent(const gl::Context *context)
gl::Error ContextVk::onMakeCurrent(const gl::Context *context)
{
// Flip viewports if FeaturesVk::flipViewportY is enabled and the user did not request that the
// surface is flipped.
......@@ -703,6 +703,7 @@ void ContextVk::onMakeCurrent(const gl::Context *context)
const gl::State &glState = context->getGLState();
updateFlipViewportDrawFramebuffer(glState);
updateFlipViewportReadFramebuffer(glState);
return gl::NoError();
}
void ContextVk::updateFlipViewportDrawFramebuffer(const gl::State &glState)
......
......@@ -98,7 +98,7 @@ class ContextVk : public ContextImpl
GLint64 getTimestamp() override;
// Context switching
void onMakeCurrent(const gl::Context *context) override;
gl::Error onMakeCurrent(const gl::Context *context) override;
// Native capabilities, unmodified by gl::Context.
gl::Caps getNativeCaps() const override;
......
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