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/mus/gles2/command_buffer_driver.h" | 5 #include "components/mus/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/mus/gles2/command_buffer_type_conversions.h" | 10 #include "components/mus/gles2/command_buffer_type_conversions.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 decoder_.get())); | 107 decoder_.get())); |
108 decoder_->set_engine(scheduler_.get()); | 108 decoder_->set_engine(scheduler_.get()); |
109 decoder_->SetResizeCallback( | 109 decoder_->SetResizeCallback( |
110 base::Bind(&CommandBufferDriver::OnResize, base::Unretained(this))); | 110 base::Bind(&CommandBufferDriver::OnResize, base::Unretained(this))); |
111 decoder_->SetWaitSyncPointCallback(base::Bind( | 111 decoder_->SetWaitSyncPointCallback(base::Bind( |
112 &CommandBufferDriver::OnWaitSyncPoint, base::Unretained(this))); | 112 &CommandBufferDriver::OnWaitSyncPoint, base::Unretained(this))); |
113 | 113 |
114 gpu::gles2::DisallowedFeatures disallowed_features; | 114 gpu::gles2::DisallowedFeatures disallowed_features; |
115 | 115 |
116 // TODO(piman): attributes. | 116 // TODO(piman): attributes. |
| 117 const bool offscreen = true; |
117 std::vector<int32> attrib_vector; | 118 std::vector<int32> attrib_vector; |
118 if (!decoder_->Initialize(surface_, context_, false /* offscreen */, | 119 if (!decoder_->Initialize(surface_, context_, offscreen, gfx::Size(1, 1), |
119 gfx::Size(1, 1), disallowed_features, | 120 disallowed_features, attrib_vector)) |
120 attrib_vector)) | |
121 return false; | 121 return false; |
122 | 122 |
123 command_buffer_->SetPutOffsetChangeCallback(base::Bind( | 123 command_buffer_->SetPutOffsetChangeCallback(base::Bind( |
124 &gpu::GpuScheduler::PutChanged, base::Unretained(scheduler_.get()))); | 124 &gpu::GpuScheduler::PutChanged, base::Unretained(scheduler_.get()))); |
125 command_buffer_->SetGetBufferChangeCallback(base::Bind( | 125 command_buffer_->SetGetBufferChangeCallback(base::Bind( |
126 &gpu::GpuScheduler::SetGetBuffer, base::Unretained(scheduler_.get()))); | 126 &gpu::GpuScheduler::SetGetBuffer, base::Unretained(scheduler_.get()))); |
127 command_buffer_->SetParseErrorCallback( | 127 command_buffer_->SetParseErrorCallback( |
128 base::Bind(&CommandBufferDriver::OnParseError, base::Unretained(this))); | 128 base::Bind(&CommandBufferDriver::OnParseError, base::Unretained(this))); |
129 | 129 |
130 // TODO(piman): other callbacks | 130 // TODO(piman): other callbacks |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 | 296 |
297 void CommandBufferDriver::DestroyDecoder() { | 297 void CommandBufferDriver::DestroyDecoder() { |
298 if (decoder_) { | 298 if (decoder_) { |
299 bool have_context = decoder_->MakeCurrent(); | 299 bool have_context = decoder_->MakeCurrent(); |
300 decoder_->Destroy(have_context); | 300 decoder_->Destroy(have_context); |
301 decoder_.reset(); | 301 decoder_.reset(); |
302 } | 302 } |
303 } | 303 } |
304 | 304 |
305 } // namespace mus | 305 } // namespace mus |
OLD | NEW |