Commit a254fa28 by Shahbaz Youssefi Committed by Commit Bot

Rename getCurrentDisplay to getDisplay

There is always only one display that can be associated with a context, so get*Current*Display is confusing. Bug: None Change-Id: Iff3a9fc5ad1154b046bb30d7f46a468802ba7fcc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1558958Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent af0301a8
......@@ -299,7 +299,7 @@ Context::Context(rx::EGLImplFactory *implFactory,
mSurfacelessSupported(displayExtensions.surfacelessContext),
mExplicitContextAvailable(clientExtensions.explicitContext),
mCurrentSurface(static_cast<egl::Surface *>(EGL_NO_SURFACE)),
mCurrentDisplay(static_cast<egl::Display *>(EGL_NO_DISPLAY)),
mDisplay(static_cast<egl::Display *>(EGL_NO_DISPLAY)),
mWebGLContext(GetWebGLContext(attribs)),
mBufferAccessValidationEnabled(false),
mExtensionsEnabled(GetExtensionsEnabled(attribs, mWebGLContext)),
......@@ -570,7 +570,7 @@ EGLLabelKHR Context::getLabel() const
egl::Error Context::makeCurrent(egl::Display *display, egl::Surface *surface)
{
mCurrentDisplay = display;
mDisplay = display;
if (!mHasBeenCurrent)
{
......@@ -3235,8 +3235,8 @@ Extensions Context::generateSupportedExtensions() const
}
// If EGL_KHR_fence_sync is not enabled, don't expose GL_OES_EGL_sync.
ASSERT(mCurrentDisplay);
if (!mCurrentDisplay->getExtensions().fenceSync)
ASSERT(mDisplay);
if (!mDisplay->getExtensions().fenceSync)
{
supportedExtensions.eglSync = false;
}
......
......@@ -1796,7 +1796,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
MemoryProgramCache *getMemoryProgramCache() const { return mMemoryProgramCache; }
bool hasBeenCurrent() const { return mHasBeenCurrent; }
egl::Display *getCurrentDisplay() const { return mCurrentDisplay; }
egl::Display *getDisplay() const { return mDisplay; }
egl::Surface *getCurrentDrawSurface() const { return mCurrentSurface; }
egl::Surface *getCurrentReadSurface() const { return mCurrentSurface; }
......@@ -1988,7 +1988,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
const bool mSurfacelessSupported;
const bool mExplicitContextAvailable;
egl::Surface *mCurrentSurface;
egl::Display *mCurrentDisplay;
egl::Display *mDisplay;
const bool mWebGLContext;
bool mBufferAccessValidationEnabled;
const bool mExtensionsEnabled;
......
......@@ -47,7 +47,7 @@ gl::ImageIndex GetImageIndex(EGLenum eglTarget, const egl::AttributeMap &attribs
const Display *DisplayFromContext(const gl::Context *context)
{
return (context ? context->getCurrentDisplay() : nullptr);
return (context ? context->getDisplay() : nullptr);
}
} // anonymous namespace
......
......@@ -185,7 +185,7 @@ Error Surface::setIsCurrent(const gl::Context *context, bool isCurrent)
return NoError();
}
return releaseRef(context->getCurrentDisplay());
return releaseRef(context->getDisplay());
}
Error Surface::releaseRef(const Display *display)
......@@ -435,7 +435,7 @@ Error Surface::releaseTexImageFromTexture(const gl::Context *context)
{
ASSERT(mTexture);
mTexture = nullptr;
return releaseRef(context->getCurrentDisplay());
return releaseRef(context->getDisplay());
}
gl::Extents Surface::getAttachmentSize(const gl::ImageIndex & /*target*/) const
......
......@@ -107,11 +107,11 @@ gl::Context *Thread::getValidContext() const
return mContext;
}
Display *Thread::getCurrentDisplay() const
Display *Thread::getDisplay() const
{
if (mContext)
{
return mContext->getCurrentDisplay();
return mContext->getDisplay();
}
return nullptr;
}
......
......@@ -48,7 +48,7 @@ class Thread : public LabeledObject
Surface *getCurrentReadSurface() const;
gl::Context *getContext() const;
gl::Context *getValidContext() const;
Display *getCurrentDisplay() const;
Display *getDisplay() const;
private:
EGLLabelKHR mLabel;
......
......@@ -346,7 +346,7 @@ egl::Error SurfaceD3D::checkForOutOfDateSwapChain(DisplayD3D *displayD3D)
egl::Error SurfaceD3D::swap(const gl::Context *context)
{
DisplayD3D *displayD3D = GetImplAs<DisplayD3D>(context->getCurrentDisplay());
DisplayD3D *displayD3D = GetImplAs<DisplayD3D>(context->getDisplay());
return swapRect(displayD3D, 0, 0, mWidth, mHeight);
}
......@@ -356,7 +356,7 @@ egl::Error SurfaceD3D::postSubBuffer(const gl::Context *context,
EGLint width,
EGLint height)
{
DisplayD3D *displayD3D = GetImplAs<DisplayD3D>(context->getCurrentDisplay());
DisplayD3D *displayD3D = GetImplAs<DisplayD3D>(context->getDisplay());
return swapRect(displayD3D, x, y, width, height);
}
......
......@@ -681,14 +681,14 @@ egl::Error WindowSurfaceVk::swapWithDamage(const gl::Context *context,
EGLint *rects,
EGLint n_rects)
{
DisplayVk *displayVk = vk::GetImpl(context->getCurrentDisplay());
DisplayVk *displayVk = vk::GetImpl(context->getDisplay());
angle::Result result = swapImpl(displayVk, rects, n_rects);
return angle::ToEGL(result, displayVk, EGL_BAD_SURFACE);
}
egl::Error WindowSurfaceVk::swap(const gl::Context *context)
{
DisplayVk *displayVk = vk::GetImpl(context->getCurrentDisplay());
DisplayVk *displayVk = vk::GetImpl(context->getDisplay());
angle::Result result = swapImpl(displayVk, nullptr, 0);
return angle::ToEGL(result, displayVk, EGL_BAD_SURFACE);
}
......
......@@ -3364,8 +3364,8 @@ bool ValidateEGLImageTargetTexture2DOES(Context *context, TextureType type, GLeg
egl::Image *imageObject = static_cast<egl::Image *>(image);
ASSERT(context->getCurrentDisplay());
if (!context->getCurrentDisplay()->isValidImage(imageObject))
ASSERT(context->getDisplay());
if (!context->getDisplay()->isValidImage(imageObject))
{
context->validationError(GL_INVALID_VALUE, kInvalidEGLImage);
return false;
......@@ -3408,8 +3408,8 @@ bool ValidateEGLImageTargetRenderbufferStorageOES(Context *context,
egl::Image *imageObject = static_cast<egl::Image *>(image);
ASSERT(context->getCurrentDisplay());
if (!context->getCurrentDisplay()->isValidImage(imageObject))
ASSERT(context->getDisplay());
if (!context->getDisplay()->isValidImage(imageObject))
{
context->validationError(GL_INVALID_VALUE, kInvalidEGLImage);
return false;
......
......@@ -497,7 +497,7 @@ EGLDisplay EGLAPIENTRY EGL_GetCurrentDisplay(void)
thread->setSuccess();
if (thread->getContext() != nullptr)
{
return thread->getContext()->getCurrentDisplay();
return thread->getContext()->getDisplay();
}
return EGL_NO_DISPLAY;
}
......@@ -532,7 +532,7 @@ EGLBoolean EGLAPIENTRY EGL_WaitGL(void)
EVENT("()");
Thread *thread = egl::GetCurrentThread();
egl::Display *display = thread->getCurrentDisplay();
egl::Display *display = thread->getDisplay();
ANGLE_EGL_TRY_RETURN(thread, ValidateDisplay(display), "eglWaitGL", GetDisplayIfValid(display),
EGL_FALSE);
......@@ -552,7 +552,7 @@ EGLBoolean EGLAPIENTRY EGL_WaitNative(EGLint engine)
EVENT("(EGLint engine = %d)", engine);
Thread *thread = egl::GetCurrentThread();
egl::Display *display = thread->getCurrentDisplay();
egl::Display *display = thread->getDisplay();
ANGLE_EGL_TRY_RETURN(thread, ValidateWaitNative(display, engine), "eglWaitNative",
GetThreadIfValid(thread), EGL_FALSE);
......@@ -779,7 +779,7 @@ EGLBoolean EGLAPIENTRY EGL_ReleaseThread(void)
Surface *previousDraw = thread->getCurrentDrawSurface();
Surface *previousRead = thread->getCurrentReadSurface();
gl::Context *previousContext = thread->getContext();
egl::Display *previousDisplay = thread->getCurrentDisplay();
egl::Display *previousDisplay = thread->getDisplay();
// Only call makeCurrent if the context or surfaces have changed.
if (previousDraw != EGL_NO_SURFACE || previousRead != EGL_NO_SURFACE ||
......@@ -812,7 +812,7 @@ EGLBoolean EGLAPIENTRY EGL_WaitClient(void)
EVENT("()");
Thread *thread = egl::GetCurrentThread();
egl::Display *display = thread->getCurrentDisplay();
egl::Display *display = thread->getDisplay();
gl::Context *context = thread->getContext();
ANGLE_EGL_TRY_RETURN(thread, ValidateDisplay(display), "eglWaitClient",
......@@ -851,7 +851,7 @@ EGLSync EGLAPIENTRY EGL_CreateSync(EGLDisplay dpy, EGLenum type, const EGLAttrib
AttributeMap attributes = AttributeMap::CreateFromAttribArray(attrib_list);
gl::Context *currentContext = thread->getContext();
egl::Display *currentDisplay = currentContext ? currentContext->getCurrentDisplay() : nullptr;
egl::Display *currentDisplay = currentContext ? currentContext->getDisplay() : nullptr;
ANGLE_EGL_TRY_RETURN(
thread, ValidateCreateSyncKHR(display, type, attributes, currentDisplay, currentContext),
......
......@@ -891,7 +891,7 @@ ANGLE_EXPORT EGLSync EGLAPIENTRY EGL_CreateSyncKHR(EGLDisplay dpy,
AttributeMap attributes = AttributeMap::CreateFromIntArray(attrib_list);
gl::Context *currentContext = thread->getContext();
egl::Display *currentDisplay = currentContext ? currentContext->getCurrentDisplay() : nullptr;
egl::Display *currentDisplay = currentContext ? currentContext->getDisplay() : nullptr;
ANGLE_EGL_TRY_RETURN(
thread, ValidateCreateSyncKHR(display, type, attributes, currentDisplay, currentContext),
......
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