Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Unified Diff: gpu/command_buffer/service/error_state.cc

Issue 199443004: gpu: Raise GL_OUT_OF_MEMORY when BeginQueryEXT fails to allocate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: checkmem: benchmark Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/error_state.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/error_state.cc
diff --git a/gpu/command_buffer/service/error_state.cc b/gpu/command_buffer/service/error_state.cc
index 3468c7e7c615d4b9d6cfda1e05611155eeafd392..ce65aa194d03ea79b548640560d6fa562ce5fac8 100644
--- a/gpu/command_buffer/service/error_state.cc
+++ b/gpu/command_buffer/service/error_state.cc
@@ -16,7 +16,7 @@ namespace gles2 {
class ErrorStateImpl : public ErrorState {
public:
- explicit ErrorStateImpl(Logger* logger);
+ explicit ErrorStateImpl(ErrorStateClient* client, Logger* logger);
virtual ~ErrorStateImpl();
virtual uint32 GetGLError() OVERRIDE;
@@ -63,6 +63,7 @@ class ErrorStateImpl : public ErrorState {
// Current GL error bits.
uint32 error_bits_;
+ ErrorStateClient* client_;
Logger* logger_;
DISALLOW_COPY_AND_ASSIGN(ErrorStateImpl);
@@ -72,13 +73,12 @@ ErrorState::ErrorState() {}
ErrorState::~ErrorState() {}
-ErrorState* ErrorState::Create(Logger* logger) {
- return new ErrorStateImpl(logger);
+ErrorState* ErrorState::Create(ErrorStateClient* client, Logger* logger) {
+ return new ErrorStateImpl(client, logger);
}
-ErrorStateImpl::ErrorStateImpl(Logger* logger)
- : error_bits_(0),
- logger_(logger) {}
+ErrorStateImpl::ErrorStateImpl(ErrorStateClient* client, Logger* logger)
+ : error_bits_(0), client_(client), logger_(logger) {}
ErrorStateImpl::~ErrorStateImpl() {}
@@ -125,6 +125,8 @@ void ErrorStateImpl::SetGLError(
function_name + ": " + msg);
}
error_bits_ |= GLES2Util::GLErrorToErrorBit(error);
+ if (error == GL_OUT_OF_MEMORY)
+ client_->OnOutOfMemoryError();
}
void ErrorStateImpl::SetGLErrorInvalidEnum(
« no previous file with comments | « gpu/command_buffer/service/error_state.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698