| 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/core/compositor/blob_image_serialization_processor.h" | 9 #include "blimp/client/core/compositor/blob_image_serialization_processor.h" |
| 10 #include "blimp/client/feature/compositor/blimp_layer_tree_settings.h" | 10 #include "blimp/client/feature/compositor/blimp_layer_tree_settings.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } | 66 } |
| 67 | 67 |
| 68 void BlimpCompositorManager::GenerateLayerTreeSettings( | 68 void BlimpCompositorManager::GenerateLayerTreeSettings( |
| 69 cc::LayerTreeSettings* settings) { | 69 cc::LayerTreeSettings* settings) { |
| 70 PopulateCommonLayerTreeSettings(settings); | 70 PopulateCommonLayerTreeSettings(settings); |
| 71 } | 71 } |
| 72 | 72 |
| 73 std::unique_ptr<BlimpCompositor> BlimpCompositorManager::CreateBlimpCompositor( | 73 std::unique_ptr<BlimpCompositor> BlimpCompositorManager::CreateBlimpCompositor( |
| 74 int render_widget_id, | 74 int render_widget_id, |
| 75 BlimpCompositorClient* client) { | 75 BlimpCompositorClient* client) { |
| 76 return base::WrapUnique(new BlimpCompositor(render_widget_id, client)); | 76 return base::MakeUnique<BlimpCompositor>(render_widget_id, client); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void BlimpCompositorManager::OnRenderWidgetCreated(int render_widget_id) { | 79 void BlimpCompositorManager::OnRenderWidgetCreated(int render_widget_id) { |
| 80 CHECK(!GetCompositor(render_widget_id)); | 80 CHECK(!GetCompositor(render_widget_id)); |
| 81 | 81 |
| 82 compositors_[render_widget_id] = CreateBlimpCompositor(render_widget_id, | 82 compositors_[render_widget_id] = CreateBlimpCompositor(render_widget_id, |
| 83 this); | 83 this); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void BlimpCompositorManager::OnRenderWidgetInitialized(int render_widget_id) { | 86 void BlimpCompositorManager::OnRenderWidgetInitialized(int render_widget_id) { |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 206 |
| 207 BlimpCompositor* BlimpCompositorManager::GetCompositor(int render_widget_id) { | 207 BlimpCompositor* BlimpCompositorManager::GetCompositor(int render_widget_id) { |
| 208 CompositorMap::const_iterator it = compositors_.find(render_widget_id); | 208 CompositorMap::const_iterator it = compositors_.find(render_widget_id); |
| 209 if (it == compositors_.end()) | 209 if (it == compositors_.end()) |
| 210 return nullptr; | 210 return nullptr; |
| 211 return it->second.get(); | 211 return it->second.get(); |
| 212 } | 212 } |
| 213 | 213 |
| 214 } // namespace client | 214 } // namespace client |
| 215 } // namespace blimp | 215 } // namespace blimp |
| OLD | NEW |