summaryrefslogtreecommitdiffstats
path: root/ui/ozone/platform/drm/host
diff options
context:
space:
mode:
authorachaulk <achaulk@chromium.org>2015-06-03 14:11:33 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-03 21:12:07 +0000
commite33faae1be4ec394528c0f703639e30c4e0bcd7e (patch)
tree4e9abd9404307497a2eb6402251fd305805896ba /ui/ozone/platform/drm/host
parent0cd8bc4113543b557f48462d95f35441434e0ffe (diff)
downloadchromium_src-e33faae1be4ec394528c0f703639e30c4e0bcd7e.zip
chromium_src-e33faae1be4ec394528c0f703639e30c4e0bcd7e.tar.gz
chromium_src-e33faae1be4ec394528c0f703639e30c4e0bcd7e.tar.bz2
Change ownership of OverlayCandidatesOzone object to compositor
We're going to keep per-compositor state in each object now, so sharing a single object isn't going to work. Review URL: https://codereview.chromium.org/1152363003 Cr-Commit-Position: refs/heads/master@{#332683}
Diffstat (limited to 'ui/ozone/platform/drm/host')
-rw-r--r--ui/ozone/platform/drm/host/drm_overlay_manager.cc11
-rw-r--r--ui/ozone/platform/drm/host/drm_overlay_manager.h5
2 files changed, 8 insertions, 8 deletions
diff --git a/ui/ozone/platform/drm/host/drm_overlay_manager.cc b/ui/ozone/platform/drm/host/drm_overlay_manager.cc
index 747c438..7143001 100644
--- a/ui/ozone/platform/drm/host/drm_overlay_manager.cc
+++ b/ui/ozone/platform/drm/host/drm_overlay_manager.cc
@@ -59,17 +59,18 @@ class SingleOverlay : public OverlayCandidatesOzone {
DrmOverlayManager::DrmOverlayManager(bool allow_surfaceless)
: allow_surfaceless_(allow_surfaceless) {
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kOzoneTestSingleOverlaySupport))
- candidates_ = make_scoped_ptr(new SingleOverlay());
+ is_supported_ = base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kOzoneTestSingleOverlaySupport);
}
DrmOverlayManager::~DrmOverlayManager() {
}
-OverlayCandidatesOzone* DrmOverlayManager::GetOverlayCandidates(
+scoped_ptr<OverlayCandidatesOzone> DrmOverlayManager::CreateOverlayCandidates(
gfx::AcceleratedWidget w) {
- return candidates_.get();
+ if (!is_supported_)
+ return nullptr;
+ return make_scoped_ptr(new SingleOverlay());
}
bool DrmOverlayManager::CanShowPrimaryPlaneAsOverlay() {
diff --git a/ui/ozone/platform/drm/host/drm_overlay_manager.h b/ui/ozone/platform/drm/host/drm_overlay_manager.h
index e02ee30..91bdd51 100644
--- a/ui/ozone/platform/drm/host/drm_overlay_manager.h
+++ b/ui/ozone/platform/drm/host/drm_overlay_manager.h
@@ -16,14 +16,13 @@ class DrmOverlayManager : public OverlayManagerOzone {
~DrmOverlayManager() override;
// OverlayManagerOzone:
- OverlayCandidatesOzone* GetOverlayCandidates(
+ scoped_ptr<OverlayCandidatesOzone> CreateOverlayCandidates(
gfx::AcceleratedWidget w) override;
bool CanShowPrimaryPlaneAsOverlay() override;
private:
bool allow_surfaceless_;
-
- scoped_ptr<OverlayCandidatesOzone> candidates_;
+ bool is_supported_;
DISALLOW_COPY_AND_ASSIGN(DrmOverlayManager);
};