Commit 989bc9a3 by Jamie Madill Committed by Commit Bot

Move ANGLE Platform Methods init to GetDisplay.

Moving the Platform Methods init to GetDisplay allows us to override the platform methods as soon as possible. This lets Chromium override the methods via ANGLEGetDisplayPlatform. It also lets us reset the platform methods when making a new display. Note that because the methods pointer is global it's a bit tricky to manage between swapping configs in ANGLE tests. Using a separate test process for each config should help. Bug: angleproject:3393 Change-Id: I351f86422e53075563f6d8fce32efbd40023cd23 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1592045 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent 7d36b55e
...@@ -312,11 +312,6 @@ void Display_logInfo(angle::PlatformMethods *platform, const char *infoMessage) ...@@ -312,11 +312,6 @@ void Display_logInfo(angle::PlatformMethods *platform, const char *infoMessage)
void ANGLESetDefaultDisplayPlatform(angle::EGLDisplayType display) void ANGLESetDefaultDisplayPlatform(angle::EGLDisplayType display)
{ {
angle::PlatformMethods *platformMethods = ANGLEPlatformCurrent(); angle::PlatformMethods *platformMethods = ANGLEPlatformCurrent();
if (platformMethods->logError != angle::DefaultLogError)
{
// Don't reset pre-set Platform to Default
return;
}
ANGLEResetDisplayPlatform(display); ANGLEResetDisplayPlatform(display);
platformMethods->logError = Display_logError; platformMethods->logError = Display_logError;
...@@ -490,12 +485,6 @@ void Display::setAttributes(rx::DisplayImpl *impl, const AttributeMap &attribMap ...@@ -490,12 +485,6 @@ void Display::setAttributes(rx::DisplayImpl *impl, const AttributeMap &attribMap
mImplementation = impl; mImplementation = impl;
mAttributeMap = attribMap; mAttributeMap = attribMap;
}
Error Display::initialize()
{
ASSERT(mImplementation != nullptr);
mImplementation->setBlobCache(&mBlobCache);
// TODO(jmadill): Store Platform in Display and init here. // TODO(jmadill): Store Platform in Display and init here.
const angle::PlatformMethods *platformMethods = const angle::PlatformMethods *platformMethods =
...@@ -509,6 +498,12 @@ Error Display::initialize() ...@@ -509,6 +498,12 @@ Error Display::initialize()
{ {
ANGLESetDefaultDisplayPlatform(this); ANGLESetDefaultDisplayPlatform(this);
} }
}
Error Display::initialize()
{
ASSERT(mImplementation != nullptr);
mImplementation->setBlobCache(&mBlobCache);
gl::InitializeDebugAnnotations(&mAnnotator); gl::InitializeDebugAnnotations(&mAnnotator);
......
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