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

Unified Diff: gpu/command_buffer/tests/gl_manager.cc

Issue 11568029: Add a command to lose the context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add docs, lose parent and children, fix typo Created 8 years 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/tests/gl_manager.h ('k') | gpu/command_buffer/tests/gl_test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/tests/gl_manager.cc
diff --git a/gpu/command_buffer/tests/gl_manager.cc b/gpu/command_buffer/tests/gl_manager.cc
index 6ec309755a0bde61dc26de58aa2135ed773973cf..57abc341d77fed024898b857abe5bfe7ca537157 100644
--- a/gpu/command_buffer/tests/gl_manager.cc
+++ b/gpu/command_buffer/tests/gl_manager.cc
@@ -29,10 +29,12 @@ GLManager::Options::Options()
share_group_manager(NULL),
share_mailbox_manager(NULL),
virtual_manager(NULL),
- bind_generates_resource(false) {
+ bind_generates_resource(false),
+ context_lost_allowed(false) {
}
-GLManager::GLManager() {
+GLManager::GLManager()
+ : context_lost_allowed_(false) {
}
GLManager::~GLManager() {
@@ -45,6 +47,8 @@ void GLManager::Initialize(const GLManager::Options& options) {
const size_t kMaxTransferBufferSize = 16 * 1024 * 1024;
const bool kShareResources = true;
+ context_lost_allowed_ = options.context_lost_allowed;
+
gles2::MailboxManager* mailbox_manager = NULL;
if (options.share_mailbox_manager) {
mailbox_manager = options.share_mailbox_manager->mailbox_manager();
@@ -198,7 +202,9 @@ void GLManager::PumpCommands() {
decoder_->MakeCurrent();
gpu_scheduler_->PutChanged();
::gpu::CommandBuffer::State state = command_buffer_->GetState();
- ASSERT_EQ(::gpu::error::kNoError, state.error);
+ if (!context_lost_allowed_) {
+ ASSERT_EQ(::gpu::error::kNoError, state.error);
+ }
}
bool GLManager::GetBufferChanged(int32 transfer_buffer_id) {
« no previous file with comments | « gpu/command_buffer/tests/gl_manager.h ('k') | gpu/command_buffer/tests/gl_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698