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

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

Issue 7021014: GLContext no longer holds a pointer to a GLSurface. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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 | content/gpu/gpu_info_collector.cc » ('j') | ui/gfx/gl/gl_context_glx.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "base/shared_memory.h" 10 #include "base/shared_memory.h"
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 } 398 }
399 399
400 void GpuCommandBufferStub::ViewResized() { 400 void GpuCommandBufferStub::ViewResized() {
401 #if defined(OS_LINUX) && !defined(TOUCH_UI) || defined(OS_WIN) 401 #if defined(OS_LINUX) && !defined(TOUCH_UI) || defined(OS_WIN)
402 DCHECK(handle_ != gfx::kNullPluginWindow); 402 DCHECK(handle_ != gfx::kNullPluginWindow);
403 scheduler_->SetScheduled(true); 403 scheduler_->SetScheduled(true);
404 404
405 // Recreate the view surface to match the window size. TODO(apatrick): this is 405 // Recreate the view surface to match the window size. TODO(apatrick): this is
406 // likely not necessary on all platforms. 406 // likely not necessary on all platforms.
407 gfx::GLContext* context = scheduler_->decoder()->GetGLContext(); 407 gfx::GLContext* context = scheduler_->decoder()->GetGLContext();
408 context->ReleaseCurrent(); 408 gfx::GLSurface* surface = scheduler_->decoder()->GetGLSurface();
409 gfx::GLSurface* surface = context->GetSurface(); 409 context->ReleaseCurrent(surface);
410 if (surface) { 410 if (surface) {
411 surface->Destroy(); 411 surface->Destroy();
412 surface->Initialize(); 412 surface->Initialize();
413 } 413 }
414 #endif 414 #endif
415 } 415 }
416 416
417 void GpuCommandBufferStub::ReportState() { 417 void GpuCommandBufferStub::ReportState() {
418 gpu::CommandBuffer::State state = command_buffer_->GetState(); 418 gpu::CommandBuffer::State state = command_buffer_->GetState();
419 if (state.error == gpu::error::kLostContext && 419 if (state.error == gpu::error::kLostContext &&
420 gfx::GLContext::LosesAllContextsOnContextLost()) { 420 gfx::GLContext::LosesAllContextsOnContextLost()) {
421 channel_->LoseAllContexts(); 421 channel_->LoseAllContexts();
422 } else { 422 } else {
423 IPC::Message* msg = new GpuCommandBufferMsg_UpdateState(route_id_, state); 423 IPC::Message* msg = new GpuCommandBufferMsg_UpdateState(route_id_, state);
424 msg->set_unblock(true); 424 msg->set_unblock(true);
425 Send(msg); 425 Send(msg);
426 } 426 }
427 } 427 }
428 428
429 #endif // defined(ENABLE_GPU) 429 #endif // defined(ENABLE_GPU)
OLDNEW
« no previous file with comments | « no previous file | content/gpu/gpu_info_collector.cc » ('j') | ui/gfx/gl/gl_context_glx.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698