| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/view_manager/gles2/command_buffer_driver.h" | 5 #include "components/view_manager/gles2/command_buffer_driver.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
| 10 #include "components/view_manager/gles2/command_buffer_type_conversions.h" | 10 #include "components/view_manager/gles2/command_buffer_type_conversions.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 decoder_->set_engine(scheduler_.get()); | 112 decoder_->set_engine(scheduler_.get()); |
| 113 decoder_->SetResizeCallback( | 113 decoder_->SetResizeCallback( |
| 114 base::Bind(&CommandBufferDriver::OnResize, base::Unretained(this))); | 114 base::Bind(&CommandBufferDriver::OnResize, base::Unretained(this))); |
| 115 decoder_->SetWaitSyncPointCallback(base::Bind( | 115 decoder_->SetWaitSyncPointCallback(base::Bind( |
| 116 &CommandBufferDriver::OnWaitSyncPoint, base::Unretained(this))); | 116 &CommandBufferDriver::OnWaitSyncPoint, base::Unretained(this))); |
| 117 | 117 |
| 118 gpu::gles2::DisallowedFeatures disallowed_features; | 118 gpu::gles2::DisallowedFeatures disallowed_features; |
| 119 | 119 |
| 120 // TODO(piman): attributes. | 120 // TODO(piman): attributes. |
| 121 std::vector<int32> attrib_vector; | 121 std::vector<int32> attrib_vector; |
| 122 if (!decoder_->Initialize(surface_, context_, false /* offscreen */, | 122 if (!decoder_->Initialize(surface_, context_, true /* offscreen */, |
| 123 gfx::Size(1, 1), disallowed_features, | 123 gfx::Size(1, 1), disallowed_features, |
| 124 attrib_vector)) | 124 attrib_vector)) |
| 125 return false; | 125 return false; |
| 126 | 126 |
| 127 command_buffer_->SetPutOffsetChangeCallback(base::Bind( | 127 command_buffer_->SetPutOffsetChangeCallback(base::Bind( |
| 128 &gpu::GpuScheduler::PutChanged, base::Unretained(scheduler_.get()))); | 128 &gpu::GpuScheduler::PutChanged, base::Unretained(scheduler_.get()))); |
| 129 command_buffer_->SetGetBufferChangeCallback(base::Bind( | 129 command_buffer_->SetGetBufferChangeCallback(base::Bind( |
| 130 &gpu::GpuScheduler::SetGetBuffer, base::Unretained(scheduler_.get()))); | 130 &gpu::GpuScheduler::SetGetBuffer, base::Unretained(scheduler_.get()))); |
| 131 command_buffer_->SetParseErrorCallback( | 131 command_buffer_->SetParseErrorCallback( |
| 132 base::Bind(&CommandBufferDriver::OnParseError, base::Unretained(this))); | 132 base::Bind(&CommandBufferDriver::OnParseError, base::Unretained(this))); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 | 301 |
| 302 void CommandBufferDriver::DestroyDecoder() { | 302 void CommandBufferDriver::DestroyDecoder() { |
| 303 if (decoder_) { | 303 if (decoder_) { |
| 304 bool have_context = decoder_->MakeCurrent(); | 304 bool have_context = decoder_->MakeCurrent(); |
| 305 decoder_->Destroy(have_context); | 305 decoder_->Destroy(have_context); |
| 306 decoder_.reset(); | 306 decoder_.reset(); |
| 307 } | 307 } |
| 308 } | 308 } |
| 309 | 309 |
| 310 } // namespace gles2 | 310 } // namespace gles2 |
| OLD | NEW |