| OLD | NEW |
| 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 #include "content/common/gpu/client/content_gl_context.h" | 5 #include "content/common/gpu/client/content_gl_context.h" |
| 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/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 { | 413 { |
| 414 TRACE_EVENT0("gpu", "ContentGLContext::Initialize::CreateTransferBuffer"); | 414 TRACE_EVENT0("gpu", "ContentGLContext::Initialize::CreateTransferBuffer"); |
| 415 // Create a transfer buffer used to copy resources between the renderer | 415 // Create a transfer buffer used to copy resources between the renderer |
| 416 // process and the GPU process. | 416 // process and the GPU process. |
| 417 transfer_buffer_ = new gpu::TransferBuffer(gles2_helper_); | 417 transfer_buffer_ = new gpu::TransferBuffer(gles2_helper_); |
| 418 } | 418 } |
| 419 | 419 |
| 420 // Create the object exposing the OpenGL API. | 420 // Create the object exposing the OpenGL API. |
| 421 gles2_implementation_ = new gpu::gles2::GLES2Implementation( | 421 gles2_implementation_ = new gpu::gles2::GLES2Implementation( |
| 422 gles2_helper_, | 422 gles2_helper_, |
| 423 NULL, |
| 423 transfer_buffer_, | 424 transfer_buffer_, |
| 424 share_resources, | 425 share_resources, |
| 425 bind_generates_resources); | 426 bind_generates_resources); |
| 426 | 427 |
| 427 if (!gles2_implementation_->Initialize( | 428 if (!gles2_implementation_->Initialize( |
| 428 kStartTransferBufferSize, | 429 kStartTransferBufferSize, |
| 429 kMinTransferBufferSize, | 430 kMinTransferBufferSize, |
| 430 kMaxTransferBufferSize)) { | 431 kMaxTransferBufferSize)) { |
| 431 Destroy(); | 432 Destroy(); |
| 432 return false; | 433 return false; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 void ContentGLContext::OnContextLost() { | 472 void ContentGLContext::OnContextLost() { |
| 472 if (!context_lost_callback_.is_null()) { | 473 if (!context_lost_callback_.is_null()) { |
| 473 ContentGLContext::ContextLostReason reason = kUnknown; | 474 ContentGLContext::ContextLostReason reason = kUnknown; |
| 474 if (command_buffer_) { | 475 if (command_buffer_) { |
| 475 reason = ConvertReason( | 476 reason = ConvertReason( |
| 476 command_buffer_->GetLastState().context_lost_reason); | 477 command_buffer_->GetLastState().context_lost_reason); |
| 477 } | 478 } |
| 478 context_lost_callback_.Run(reason); | 479 context_lost_callback_.Run(reason); |
| 479 } | 480 } |
| 480 } | 481 } |
| OLD | NEW |