OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/native_viewport/onscreen_context_provider.h" | 5 #include "components/view_manager/native_viewport/onscreen_context_provider.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "components/view_manager/gles2/command_buffer_driver.h" | 8 #include "components/view_manager/gles2/command_buffer_driver.h" |
9 #include "components/view_manager/gles2/command_buffer_impl.h" | 9 #include "components/view_manager/gles2/command_buffer_impl.h" |
10 #include "components/view_manager/gles2/gpu_state.h" | 10 #include "components/view_manager/gles2/gpu_state.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 void OnscreenContextProvider::OnCommandBufferImplDestroyed() { | 63 void OnscreenContextProvider::OnCommandBufferImplDestroyed() { |
64 DCHECK(command_buffer_impl_); | 64 DCHECK(command_buffer_impl_); |
65 command_buffer_impl_ = nullptr; | 65 command_buffer_impl_ = nullptr; |
66 } | 66 } |
67 | 67 |
68 void OnscreenContextProvider::CreateAndReturnCommandBuffer() { | 68 void OnscreenContextProvider::CreateAndReturnCommandBuffer() { |
69 mojo::CommandBufferPtr cb; | 69 mojo::CommandBufferPtr cb; |
70 scoped_ptr<gles2::CommandBufferDriver> command_buffer_driver( | 70 scoped_ptr<gles2::CommandBufferDriver> command_buffer_driver( |
71 new gles2::CommandBufferDriver( | 71 new gles2::CommandBufferDriver( |
72 widget_, state_->share_group(), state_->mailbox_manager(), | 72 widget_, state_, |
73 state_->sync_point_manager(), | |
74 base::Bind(&OnscreenContextProvider::CommandBufferDestroyed, | 73 base::Bind(&OnscreenContextProvider::CommandBufferDestroyed, |
75 base::Unretained(this)))); | 74 base::Unretained(this)))); |
76 command_buffers_.insert(command_buffer_driver.get()); | 75 command_buffers_.insert(command_buffer_driver.get()); |
77 | 76 |
78 command_buffer_impl_ = new gles2::CommandBufferImpl( | 77 command_buffer_impl_ = |
79 GetProxy(&cb), pending_listener_.Pass(), state_->control_task_runner(), | 78 new gles2::CommandBufferImpl(GetProxy(&cb), pending_listener_.Pass(), |
80 state_->sync_point_manager(), | 79 state_, command_buffer_driver.Pass()); |
81 command_buffer_driver.Pass()); | |
82 command_buffer_impl_->set_observer(this); | 80 command_buffer_impl_->set_observer(this); |
83 pending_create_callback_.Run(cb.Pass()); | 81 pending_create_callback_.Run(cb.Pass()); |
84 pending_create_callback_.reset(); | 82 pending_create_callback_.reset(); |
85 } | 83 } |
86 | 84 |
87 void OnscreenContextProvider::CommandBufferDestroyed( | 85 void OnscreenContextProvider::CommandBufferDestroyed( |
88 gles2::CommandBufferDriver* command_buffer) { | 86 gles2::CommandBufferDriver* command_buffer) { |
89 command_buffers_.erase(command_buffer); | 87 command_buffers_.erase(command_buffer); |
90 } | 88 } |
91 | 89 |
92 } // namespace mojo | 90 } // namespace mojo |
OLD | NEW |