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"
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
) {
31 return make_scoped_ptr(
32 new DrmOverlayCandidatesHost(w
, platform_support_host_
));
35 bool DrmOverlayManager::CanShowPrimaryPlaneAsOverlay() {
36 return allow_surfaceless_
;