Commit 9dd0cf0a by Jamie Madill

Do not use notify feature of testDeviceLost.

This is part one of a simplification of testDeviceLost. This patch changes the instances where we would use the notify parameter to notify the Display directly. We can do this by using the Display attached to the Renderer in some cases. BUG=angle:795 Change-Id: I24fd827989d47b0b2cefef7afb99fa62581ddc1b Reviewed-on: https://chromium-review.googlesource.com/228910Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent b23deb26
......@@ -12,6 +12,7 @@
#include "common/utilities.h"
#include "common/platform.h"
#include "libANGLE/Buffer.h"
#include "libANGLE/Display.h"
#include "libANGLE/Fence.h"
#include "libANGLE/Framebuffer.h"
#include "libANGLE/FramebufferAttachment.h"
......@@ -21,6 +22,7 @@
#include "libANGLE/Query.h"
#include "libANGLE/ResourceManager.h"
#include "libANGLE/Sampler.h"
#include "libANGLE/Surface.h"
#include "libANGLE/Texture.h"
#include "libANGLE/TransformFeedback.h"
#include "libANGLE/VertexArray.h"
......@@ -28,8 +30,6 @@
#include "libANGLE/validationES.h"
#include "libANGLE/renderer/Renderer.h"
#include "libANGLE/Surface.h"
#include <sstream>
#include <iterator>
......@@ -1387,7 +1387,10 @@ GLenum Context::getResetStatus()
{
// mResetStatus will be set by the markContextLost callback
// in the case a notification is sent
mRenderer->testDeviceLost(true);
if (mRenderer->testDeviceLost(false))
{
mRenderer->notifyDeviceLost();
}
}
GLenum status = mResetStatus;
......
......@@ -144,8 +144,9 @@ gl::Error Query11::testQuery()
break;
}
if (!mQueryFinished && mRenderer->testDeviceLost(true))
if (!mQueryFinished && mRenderer->testDeviceLost(false))
{
mRenderer->notifyDeviceLost();
return gl::Error(GL_OUT_OF_MEMORY, "Failed to test get query result, device is lost.");
}
}
......
......@@ -505,8 +505,9 @@ gl::Error Renderer11::sync(bool block)
// Keep polling, but allow other threads to do something useful first
ScheduleYield();
if (testDeviceLost(true))
if (testDeviceLost(false))
{
mDisplay->notifyDeviceLost();
return gl::Error(GL_OUT_OF_MEMORY, "Device was lost while waiting for sync.");
}
}
......
......@@ -131,8 +131,9 @@ gl::Error Query9::testQuery()
mRenderer->notifyDeviceLost();
return gl::Error(GL_OUT_OF_MEMORY, "Failed to test get query result, device is lost.");
}
else if (mRenderer->testDeviceLost(true))
else if (mRenderer->testDeviceLost(false))
{
mRenderer->notifyDeviceLost();
return gl::Error(GL_OUT_OF_MEMORY, "Failed to test get query result, device is lost.");
}
}
......
......@@ -989,8 +989,9 @@ EGLBoolean __stdcall eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface
if (dpy != EGL_NO_DISPLAY && display->isInitialized())
{
rx::Renderer *renderer = display->getRenderer();
if (renderer->testDeviceLost(true))
if (renderer->testDeviceLost(false))
{
display->notifyDeviceLost();
return EGL_FALSE;
}
......
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