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 "mojo/services/gles2/command_buffer_impl.h" | 5 #include "mojo/services/gles2/command_buffer_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
9 | 9 |
10 #include "gpu/command_buffer/common/constants.h" | 10 #include "gpu/command_buffer/common/constants.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 if (!decoder_->Initialize(surface, | 106 if (!decoder_->Initialize(surface, |
107 context, | 107 context, |
108 false /* offscreen */, | 108 false /* offscreen */, |
109 size_, | 109 size_, |
110 disallowed_features, | 110 disallowed_features, |
111 attrib_vector)) | 111 attrib_vector)) |
112 return false; | 112 return false; |
113 | 113 |
114 gpu_control_.reset( | 114 gpu_control_.reset( |
115 new gpu::GpuControlService(context_group->image_manager(), | 115 new gpu::GpuControlService(context_group->image_manager(), |
116 NULL, | |
117 context_group->mailbox_manager(), | 116 context_group->mailbox_manager(), |
118 NULL, | 117 NULL)); |
119 decoder_->GetCapabilities())); | |
120 | 118 |
121 command_buffer_->SetPutOffsetChangeCallback(base::Bind( | 119 command_buffer_->SetPutOffsetChangeCallback(base::Bind( |
122 &gpu::GpuScheduler::PutChanged, base::Unretained(scheduler_.get()))); | 120 &gpu::GpuScheduler::PutChanged, base::Unretained(scheduler_.get()))); |
123 command_buffer_->SetGetBufferChangeCallback(base::Bind( | 121 command_buffer_->SetGetBufferChangeCallback(base::Bind( |
124 &gpu::GpuScheduler::SetGetBuffer, base::Unretained(scheduler_.get()))); | 122 &gpu::GpuScheduler::SetGetBuffer, base::Unretained(scheduler_.get()))); |
125 command_buffer_->SetParseErrorCallback( | 123 command_buffer_->SetParseErrorCallback( |
126 base::Bind(&CommandBufferImpl::OnParseError, base::Unretained(this))); | 124 base::Bind(&CommandBufferImpl::OnParseError, base::Unretained(this))); |
127 | 125 |
128 // TODO(piman): other callbacks | 126 // TODO(piman): other callbacks |
129 | 127 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 183 |
186 void CommandBufferImpl::OnParseError() { | 184 void CommandBufferImpl::OnParseError() { |
187 gpu::CommandBuffer::State state = command_buffer_->GetState(); | 185 gpu::CommandBuffer::State state = command_buffer_->GetState(); |
188 client_->LostContext(state.context_lost_reason); | 186 client_->LostContext(state.context_lost_reason); |
189 } | 187 } |
190 | 188 |
191 void CommandBufferImpl::DrawAnimationFrame() { client_->DrawAnimationFrame(); } | 189 void CommandBufferImpl::DrawAnimationFrame() { client_->DrawAnimationFrame(); } |
192 | 190 |
193 } // namespace services | 191 } // namespace services |
194 } // namespace mojo | 192 } // namespace mojo |
OLD | NEW |