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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 221783002: Revert of gpu: Raise GL_OUT_OF_MEMORY when BeginQueryEXT fails to allocate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: gpu/command_buffer/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index bfb99f27718c3244a136e2c122a1f7ea3dee6426..0dd5161662412443da9f94bbc605219e79a3c3bf 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -83,12 +83,11 @@
}
GLES2Implementation::GLES2Implementation(
- GLES2CmdHelper* helper,
- ShareGroup* share_group,
- TransferBufferInterface* transfer_buffer,
- bool bind_generates_resource,
- bool lose_context_when_out_of_memory,
- GpuControl* gpu_control)
+ GLES2CmdHelper* helper,
+ ShareGroup* share_group,
+ TransferBufferInterface* transfer_buffer,
+ bool bind_generates_resource,
+ GpuControl* gpu_control)
: helper_(helper),
transfer_buffer_(transfer_buffer),
angle_pack_reverse_row_order_status_(kUnknownExtensionStatus),
@@ -114,7 +113,6 @@
async_upload_sync_shm_offset_(0),
error_bits_(0),
debug_(false),
- lose_context_when_out_of_memory_(lose_context_when_out_of_memory),
use_count_(0),
error_message_callback_(NULL),
gpu_control_(gpu_control),
@@ -506,11 +504,6 @@
error_message_callback_->OnErrorMessage(temp.c_str(), 0);
}
error_bits_ |= GLES2Util::GLErrorToErrorBit(error);
-
- if (error == GL_OUT_OF_MEMORY && lose_context_when_out_of_memory_) {
- helper_->LoseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB,
- GL_UNKNOWN_CONTEXT_RESET_ARB);
- }
}
void GLES2Implementation::SetGLErrorInvalidEnum(
@@ -898,6 +891,16 @@
helper_->CommandBufferHelper::Finish();
}
+bool GLES2Implementation::MustBeContextLost() {
+ bool context_lost = helper_->IsContextLost();
+ if (!context_lost) {
+ WaitForCmd();
+ context_lost = helper_->IsContextLost();
+ }
+ CHECK(context_lost);
+ return context_lost;
+}
+
void GLES2Implementation::FinishHelper() {
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glFinish()");
TRACE_EVENT0("gpu", "GLES2::Finish");
@@ -3327,9 +3330,7 @@
if (!query) {
query = query_tracker_->CreateQuery(id, target);
if (!query) {
- SetGLError(GL_OUT_OF_MEMORY,
- "glBeginQueryEXT",
- "transfer buffer allocation failed");
+ MustBeContextLost();
return;
}
} else if (query->target() != target) {
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.h ('k') | gpu/command_buffer/client/gles2_implementation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698