| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
| 9 #include "base/weak_ptr.h" | 9 #include "base/weak_ptr.h" |
| 10 #include "chrome/renderer/command_buffer_proxy.h" | 10 #include "chrome/renderer/command_buffer_proxy.h" |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 return CONTEXT_LOST; | 405 return CONTEXT_LOST; |
| 406 } | 406 } |
| 407 } | 407 } |
| 408 | 408 |
| 409 void Context::SetError(Error error) { | 409 void Context::SetError(Error error) { |
| 410 last_error_ = error; | 410 last_error_ = error; |
| 411 } | 411 } |
| 412 | 412 |
| 413 bool Context::IsCommandBufferContextLost() { | 413 bool Context::IsCommandBufferContextLost() { |
| 414 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); | 414 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); |
| 415 return state.error == gpu::error::kLostContext; | 415 if (state.error == gpu::error::kLostContext) { |
| 416 // Tell the host that the connection was lost right away. |
| 417 channel_->SetStateLost(); |
| 418 return true; |
| 419 } |
| 420 return false; |
| 416 } | 421 } |
| 417 | 422 |
| 418 // TODO(gman): Remove This | 423 // TODO(gman): Remove This |
| 419 void Context::DisableShaderTranslation() { | 424 void Context::DisableShaderTranslation() { |
| 420 gles2_implementation_->CommandBufferEnableCHROMIUM( | 425 gles2_implementation_->CommandBufferEnableCHROMIUM( |
| 421 PEPPER3D_SKIP_GLSL_TRANSLATION); | 426 PEPPER3D_SKIP_GLSL_TRANSLATION); |
| 422 } | 427 } |
| 423 | 428 |
| 424 void Context::OnSwapBuffers() { | 429 void Context::OnSwapBuffers() { |
| 425 if (swap_buffers_callback_.get()) | 430 if (swap_buffers_callback_.get()) |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 } | 571 } |
| 567 | 572 |
| 568 gpu::gles2::GLES2Implementation* GetImplementation(Context* context) { | 573 gpu::gles2::GLES2Implementation* GetImplementation(Context* context) { |
| 569 if (!context) | 574 if (!context) |
| 570 return NULL; | 575 return NULL; |
| 571 | 576 |
| 572 return context->gles2_implementation(); | 577 return context->gles2_implementation(); |
| 573 } | 578 } |
| 574 | 579 |
| 575 } // namespace ggl | 580 } // namespace ggl |
| OLD | NEW |