Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / ui / ozone / platform / drm / host / drm_overlay_manager.cc
blob4f101cc31da73b0c6f7053bbfc8f992bbfe18b50
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
3 // found in the LICENSE file.
5 #include "ui/ozone/platform/drm/host/drm_overlay_manager.h"
7 #include "base/command_line.h"
8 #include "ui/gfx/geometry/rect_conversions.h"
9 #include "ui/ozone/platform/drm/host/drm_overlay_candidates_host.h"
10 #include "ui/ozone/public/overlay_candidates_ozone.h"
11 #include "ui/ozone/public/ozone_switches.h"
13 namespace ui {
15 DrmOverlayManager::DrmOverlayManager(
16 bool allow_surfaceless,
17 DrmGpuPlatformSupportHost* platform_support_host)
18 : platform_support_host_(platform_support_host),
19 allow_surfaceless_(allow_surfaceless) {
20 is_supported_ = base::CommandLine::ForCurrentProcess()->HasSwitch(
21 switches::kOzoneTestSingleOverlaySupport);
24 DrmOverlayManager::~DrmOverlayManager() {
27 scoped_ptr<OverlayCandidatesOzone> DrmOverlayManager::CreateOverlayCandidates(
28 gfx::AcceleratedWidget w) {
29 if (!is_supported_)
30 return nullptr;
31 return make_scoped_ptr(
32 new DrmOverlayCandidatesHost(w, platform_support_host_));
35 bool DrmOverlayManager::CanShowPrimaryPlaneAsOverlay() {
36 return allow_surfaceless_;
39 } // namespace ui