| 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 "content/browser/compositor/browser_compositor_overlay_candidate_valida
tor_ozone.h" | 5 #include "content/browser/compositor/browser_compositor_overlay_candidate_valida
tor_ozone.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> |
| 8 | 9 |
| 9 #include "cc/output/overlay_strategy_single_on_top.h" | 10 #include "cc/output/overlay_strategy_single_on_top.h" |
| 10 #include "cc/output/overlay_strategy_underlay.h" | 11 #include "cc/output/overlay_strategy_underlay.h" |
| 11 #include "ui/ozone/public/overlay_candidates_ozone.h" | 12 #include "ui/ozone/public/overlay_candidates_ozone.h" |
| 12 | 13 |
| 13 namespace content { | 14 namespace content { |
| 14 | 15 |
| 15 static gfx::BufferFormat GetBufferFormat(cc::ResourceFormat overlay_format) { | 16 static gfx::BufferFormat GetBufferFormat(cc::ResourceFormat overlay_format) { |
| 16 switch (overlay_format) { | 17 switch (overlay_format) { |
| 17 // TODO(dshwang): overlay video still uses RGBA_8888. | 18 // TODO(dshwang): overlay video still uses RGBA_8888. |
| 18 case cc::RGBA_8888: | 19 case cc::RGBA_8888: |
| 19 case cc::BGRA_8888: | 20 case cc::BGRA_8888: |
| 20 return gfx::BufferFormat::BGRA_8888; | 21 return gfx::BufferFormat::BGRA_8888; |
| 21 default: | 22 default: |
| 22 NOTREACHED(); | 23 NOTREACHED(); |
| 23 return gfx::BufferFormat::BGRA_8888; | 24 return gfx::BufferFormat::BGRA_8888; |
| 24 } | 25 } |
| 25 } | 26 } |
| 26 | 27 |
| 27 BrowserCompositorOverlayCandidateValidatorOzone:: | 28 BrowserCompositorOverlayCandidateValidatorOzone:: |
| 28 BrowserCompositorOverlayCandidateValidatorOzone( | 29 BrowserCompositorOverlayCandidateValidatorOzone( |
| 29 gfx::AcceleratedWidget widget, | 30 gfx::AcceleratedWidget widget, |
| 30 scoped_ptr<ui::OverlayCandidatesOzone> overlay_candidates) | 31 scoped_ptr<ui::OverlayCandidatesOzone> overlay_candidates) |
| 31 : widget_(widget), | 32 : widget_(widget), |
| 32 overlay_candidates_(overlay_candidates.Pass()), | 33 overlay_candidates_(std::move(overlay_candidates)), |
| 33 software_mirror_active_(false) { | 34 software_mirror_active_(false) {} |
| 34 } | |
| 35 | 35 |
| 36 BrowserCompositorOverlayCandidateValidatorOzone:: | 36 BrowserCompositorOverlayCandidateValidatorOzone:: |
| 37 ~BrowserCompositorOverlayCandidateValidatorOzone() { | 37 ~BrowserCompositorOverlayCandidateValidatorOzone() { |
| 38 } | 38 } |
| 39 | 39 |
| 40 void BrowserCompositorOverlayCandidateValidatorOzone::GetStrategies( | 40 void BrowserCompositorOverlayCandidateValidatorOzone::GetStrategies( |
| 41 cc::OverlayProcessor::StrategyList* strategies) { | 41 cc::OverlayProcessor::StrategyList* strategies) { |
| 42 strategies->push_back( | 42 strategies->push_back( |
| 43 make_scoped_ptr(new cc::OverlayStrategySingleOnTop(this))); | 43 make_scoped_ptr(new cc::OverlayStrategySingleOnTop(this))); |
| 44 strategies->push_back(make_scoped_ptr(new cc::OverlayStrategyUnderlay(this))); | 44 strategies->push_back(make_scoped_ptr(new cc::OverlayStrategyUnderlay(this))); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 surfaces->at(i).display_rect = ozone_surface_list.at(i).display_rect; | 81 surfaces->at(i).display_rect = ozone_surface_list.at(i).display_rect; |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 | 84 |
| 85 void BrowserCompositorOverlayCandidateValidatorOzone::SetSoftwareMirrorMode( | 85 void BrowserCompositorOverlayCandidateValidatorOzone::SetSoftwareMirrorMode( |
| 86 bool enabled) { | 86 bool enabled) { |
| 87 software_mirror_active_ = enabled; | 87 software_mirror_active_ = enabled; |
| 88 } | 88 } |
| 89 | 89 |
| 90 } // namespace content | 90 } // namespace content |
| OLD | NEW |