| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "blimp/client/feature/compositor/blimp_compositor_manager.h" | 5 #include "blimp/client/feature/compositor/blimp_compositor_manager.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "blimp/client/feature/compositor/blimp_layer_tree_settings.h" | 9 #include "blimp/client/feature/compositor/blimp_layer_tree_settings.h" |
| 10 #include "blimp/client/feature/compositor/client_image_serialization_processor.h
" | 10 #include "blimp/client/feature/compositor/client_image_serialization_processor.h
" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } | 137 } |
| 138 | 138 |
| 139 return settings_.get(); | 139 return settings_.get(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void BlimpCompositorManager::DidCompleteSwapBuffers() { | 142 void BlimpCompositorManager::DidCompleteSwapBuffers() { |
| 143 DCHECK(client_); | 143 DCHECK(client_); |
| 144 client_->OnSwapBuffersCompleted(); | 144 client_->OnSwapBuffersCompleted(); |
| 145 } | 145 } |
| 146 | 146 |
| 147 void BlimpCompositorManager::DidCommitAndDrawFrame() { | |
| 148 DCHECK(client_); | |
| 149 client_->DidCommitAndDrawFrame(); | |
| 150 } | |
| 151 | |
| 152 scoped_refptr<base::SingleThreadTaskRunner> | 147 scoped_refptr<base::SingleThreadTaskRunner> |
| 153 BlimpCompositorManager::GetCompositorTaskRunner() { | 148 BlimpCompositorManager::GetCompositorTaskRunner() { |
| 154 if (compositor_thread_) | 149 if (compositor_thread_) |
| 155 return compositor_thread_->task_runner(); | 150 return compositor_thread_->task_runner(); |
| 156 | 151 |
| 157 base::Thread::Options thread_options; | 152 base::Thread::Options thread_options; |
| 158 #if defined(OS_ANDROID) | 153 #if defined(OS_ANDROID) |
| 159 thread_options.priority = base::ThreadPriority::DISPLAY; | 154 thread_options.priority = base::ThreadPriority::DISPLAY; |
| 160 #endif | 155 #endif |
| 161 compositor_thread_.reset(new base::Thread("Compositor")); | 156 compositor_thread_.reset(new base::Thread("Compositor")); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 199 |
| 205 BlimpCompositor* BlimpCompositorManager::GetCompositor(int render_widget_id) { | 200 BlimpCompositor* BlimpCompositorManager::GetCompositor(int render_widget_id) { |
| 206 CompositorMap::const_iterator it = compositors_.find(render_widget_id); | 201 CompositorMap::const_iterator it = compositors_.find(render_widget_id); |
| 207 if (it == compositors_.end()) | 202 if (it == compositors_.end()) |
| 208 return nullptr; | 203 return nullptr; |
| 209 return it->second.get(); | 204 return it->second.get(); |
| 210 } | 205 } |
| 211 | 206 |
| 212 } // namespace client | 207 } // namespace client |
| 213 } // namespace blimp | 208 } // namespace blimp |
| OLD | NEW |