| OLD | NEW |
| 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 Loading... |
| 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) |
| OLD | NEW |