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

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 10822029: Use EXT_robustness where available on GLES2 platforms to detect and respond to resets of the graphi… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review feedback. Rebuilt and re-tested. Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if defined(ENABLE_GPU) 5 #if defined(ENABLE_GPU)
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 272
273 // The scheduler has raw references to the decoder and the command buffer so 273 // The scheduler has raw references to the decoder and the command buffer so
274 // destroy it before those. 274 // destroy it before those.
275 scheduler_.reset(); 275 scheduler_.reset();
276 276
277 while (!delayed_echos_.empty()) { 277 while (!delayed_echos_.empty()) {
278 delete delayed_echos_.front(); 278 delete delayed_echos_.front();
279 delayed_echos_.pop_front(); 279 delayed_echos_.pop_front();
280 } 280 }
281 281
282 bool have_context = false;
282 if (decoder_.get()) 283 if (decoder_.get())
283 decoder_->MakeCurrent(); 284 have_context = decoder_->MakeCurrent();
284 FOR_EACH_OBSERVER(DestructionObserver, 285 FOR_EACH_OBSERVER(DestructionObserver,
285 destruction_observers_, 286 destruction_observers_,
286 OnWillDestroyStub(this)); 287 OnWillDestroyStub(this));
287 288
288 if (decoder_.get()) { 289 if (decoder_.get()) {
289 decoder_->Destroy(true); 290 decoder_->Destroy(have_context);
290 decoder_.reset(); 291 decoder_.reset();
291 } 292 }
292 293
293 command_buffer_.reset(); 294 command_buffer_.reset();
294 295
295 context_ = NULL; 296 context_ = NULL;
296 surface_ = NULL; 297 surface_ = NULL;
297 298
298 channel_->gpu_channel_manager()->gpu_memory_manager()->ScheduleManage(false); 299 channel_->gpu_channel_manager()->gpu_memory_manager()->ScheduleManage(false);
299 } 300 }
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 const GpuMemoryAllocation& allocation) { 803 const GpuMemoryAllocation& allocation) {
803 Send(new GpuCommandBufferMsg_SetMemoryAllocation(route_id_, allocation)); 804 Send(new GpuCommandBufferMsg_SetMemoryAllocation(route_id_, allocation));
804 // This can be called outside of OnMessageReceived, so the context needs to be 805 // This can be called outside of OnMessageReceived, so the context needs to be
805 // made current before calling methods on the surface. 806 // made current before calling methods on the surface.
806 if (!surface_ || !MakeCurrent()) 807 if (!surface_ || !MakeCurrent())
807 return; 808 return;
808 surface_->SetFrontbufferAllocation(allocation.suggest_have_frontbuffer); 809 surface_->SetFrontbufferAllocation(allocation.suggest_have_frontbuffer);
809 } 810 }
810 811
811 #endif // defined(ENABLE_GPU) 812 #endif // defined(ENABLE_GPU)
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698