| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/display_compositor/compositor_overlay_candidate_validator_o
zone.h" | 5 #include "components/display_compositor/compositor_overlay_candidate_validator_o
zone.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
| 14 #include "cc/output/overlay_strategy_fullscreen.h" | 14 #include "cc/output/overlay_strategy_fullscreen.h" |
| 15 #include "cc/output/overlay_strategy_single_on_top.h" | 15 #include "cc/output/overlay_strategy_single_on_top.h" |
| 16 #include "cc/output/overlay_strategy_underlay.h" | 16 #include "cc/output/overlay_strategy_underlay.h" |
| 17 #include "cc/output/overlay_strategy_underlay_cast.h" |
| 17 #include "ui/ozone/public/overlay_candidates_ozone.h" | 18 #include "ui/ozone/public/overlay_candidates_ozone.h" |
| 18 | 19 |
| 19 namespace display_compositor { | 20 namespace display_compositor { |
| 20 namespace { | 21 namespace { |
| 21 // Templated function used to create an OverlayProcessor::Strategy | 22 // Templated function used to create an OverlayProcessor::Strategy |
| 22 // of type |S|. | 23 // of type |S|. |
| 23 template <typename S> | 24 template <typename S> |
| 24 std::unique_ptr<cc::OverlayProcessor::Strategy> MakeOverlayStrategy( | 25 std::unique_ptr<cc::OverlayProcessor::Strategy> MakeOverlayStrategy( |
| 25 CompositorOverlayCandidateValidatorOzone* capability_checker) { | 26 CompositorOverlayCandidateValidatorOzone* capability_checker) { |
| 26 return base::MakeUnique<S>(capability_checker); | 27 return base::MakeUnique<S>(capability_checker); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 base::SPLIT_WANT_NONEMPTY)) { | 61 base::SPLIT_WANT_NONEMPTY)) { |
| 61 if (strategy_name == "single-fullscreen") { | 62 if (strategy_name == "single-fullscreen") { |
| 62 strategies_instantiators_.push_back( | 63 strategies_instantiators_.push_back( |
| 63 base::Bind(MakeOverlayStrategy<cc::OverlayStrategyFullscreen>)); | 64 base::Bind(MakeOverlayStrategy<cc::OverlayStrategyFullscreen>)); |
| 64 } else if (strategy_name == "single-on-top") { | 65 } else if (strategy_name == "single-on-top") { |
| 65 strategies_instantiators_.push_back( | 66 strategies_instantiators_.push_back( |
| 66 base::Bind(MakeOverlayStrategy<cc::OverlayStrategySingleOnTop>)); | 67 base::Bind(MakeOverlayStrategy<cc::OverlayStrategySingleOnTop>)); |
| 67 } else if (strategy_name == "underlay") { | 68 } else if (strategy_name == "underlay") { |
| 68 strategies_instantiators_.push_back( | 69 strategies_instantiators_.push_back( |
| 69 base::Bind(MakeOverlayStrategy<cc::OverlayStrategyUnderlay>)); | 70 base::Bind(MakeOverlayStrategy<cc::OverlayStrategyUnderlay>)); |
| 71 } else if (strategy_name == "cast") { |
| 72 strategies_instantiators_.push_back( |
| 73 base::Bind(MakeOverlayStrategy<cc::OverlayStrategyUnderlayCast>)); |
| 70 } else { | 74 } else { |
| 71 LOG(WARNING) << "Unrecognized overlay strategy " << strategy_name; | 75 LOG(WARNING) << "Unrecognized overlay strategy " << strategy_name; |
| 72 } | 76 } |
| 73 } | 77 } |
| 74 } | 78 } |
| 75 | 79 |
| 76 CompositorOverlayCandidateValidatorOzone:: | 80 CompositorOverlayCandidateValidatorOzone:: |
| 77 ~CompositorOverlayCandidateValidatorOzone() {} | 81 ~CompositorOverlayCandidateValidatorOzone() {} |
| 78 | 82 |
| 79 void CompositorOverlayCandidateValidatorOzone::GetStrategies( | 83 void CompositorOverlayCandidateValidatorOzone::GetStrategies( |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 surfaces->at(i).display_rect = ozone_surface_list.at(i).display_rect; | 127 surfaces->at(i).display_rect = ozone_surface_list.at(i).display_rect; |
| 124 } | 128 } |
| 125 } | 129 } |
| 126 | 130 |
| 127 void CompositorOverlayCandidateValidatorOzone::SetSoftwareMirrorMode( | 131 void CompositorOverlayCandidateValidatorOzone::SetSoftwareMirrorMode( |
| 128 bool enabled) { | 132 bool enabled) { |
| 129 software_mirror_active_ = enabled; | 133 software_mirror_active_ = enabled; |
| 130 } | 134 } |
| 131 | 135 |
| 132 } // namespace display_compositor | 136 } // namespace display_compositor |
| OLD | NEW |