summaryrefslogtreecommitdiffstats
path: root/ui/ozone/platform/drm/host/drm_overlay_manager.cc
blob: 70880db3680a4545868b4c2a4593a8622f6bd537 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/ozone/platform/drm/host/drm_overlay_manager.h"

#include "base/command_line.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/ozone/platform/drm/host/drm_overlay_candidates_host.h"
#include "ui/ozone/public/overlay_candidates_ozone.h"
#include "ui/ozone/public/ozone_switches.h"

namespace ui {

DrmOverlayManager::DrmOverlayManager(
    DrmGpuPlatformSupportHost* platform_support_host)
    : platform_support_host_(platform_support_host) {
  is_supported_ = base::CommandLine::ForCurrentProcess()->HasSwitch(
      switches::kOzoneTestSingleOverlaySupport);
}

DrmOverlayManager::~DrmOverlayManager() {
}

scoped_ptr<OverlayCandidatesOzone> DrmOverlayManager::CreateOverlayCandidates(
    gfx::AcceleratedWidget w) {
  if (!is_supported_)
    return nullptr;
  return make_scoped_ptr(
      new DrmOverlayCandidatesHost(w, platform_support_host_));
}

}  // namespace ui