Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(714)

Unified Diff: ui/ozone/platform/drm/host/drm_overlay_manager.cc

Issue 1157793004: ozone: Add overlay candidate implementation that queries support via IPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add missing license header Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/drm/host/drm_overlay_manager.h ('k') | ui/ozone/platform/drm/ozone_platform_drm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/host/drm_overlay_manager.cc
diff --git a/ui/ozone/platform/drm/host/drm_overlay_manager.cc b/ui/ozone/platform/drm/host/drm_overlay_manager.cc
index 71430012e318b275f868f7cbf8f745c5c459184f..4f101cc31da73b0c6f7053bbfc8f992bbfe18b50 100644
--- a/ui/ozone/platform/drm/host/drm_overlay_manager.cc
+++ b/ui/ozone/platform/drm/host/drm_overlay_manager.cc
@@ -6,59 +6,17 @@
#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 {
-namespace {
-class SingleOverlay : public OverlayCandidatesOzone {
- public:
- SingleOverlay() {}
- ~SingleOverlay() override {}
-
- void CheckOverlaySupport(OverlaySurfaceCandidateList* candidates) override {
- if (candidates->size() == 2) {
- OverlayCandidatesOzone::OverlaySurfaceCandidate* first =
- &(*candidates)[0];
- OverlayCandidatesOzone::OverlaySurfaceCandidate* second =
- &(*candidates)[1];
- OverlayCandidatesOzone::OverlaySurfaceCandidate* overlay;
- if (first->plane_z_order == 0) {
- overlay = second;
- } else if (second->plane_z_order == 0) {
- overlay = first;
- } else {
- NOTREACHED();
- return;
- }
- // 0.01 constant chosen to match DCHECKs in gfx::ToNearestRect and avoid
- // that code asserting on quads that we accept.
- if (overlay->plane_z_order > 0 &&
- IsTransformSupported(overlay->transform) &&
- gfx::IsNearestRectWithinDistance(overlay->display_rect, 0.01f)) {
- overlay->overlay_handled = true;
- }
- }
- }
-
- private:
- bool IsTransformSupported(gfx::OverlayTransform transform) {
- switch (transform) {
- case gfx::OVERLAY_TRANSFORM_NONE:
- return true;
- default:
- return false;
- }
- }
-
- DISALLOW_COPY_AND_ASSIGN(SingleOverlay);
-};
-
-} // namespace
-
-DrmOverlayManager::DrmOverlayManager(bool allow_surfaceless)
- : allow_surfaceless_(allow_surfaceless) {
+DrmOverlayManager::DrmOverlayManager(
+ bool allow_surfaceless,
+ DrmGpuPlatformSupportHost* platform_support_host)
+ : platform_support_host_(platform_support_host),
+ allow_surfaceless_(allow_surfaceless) {
is_supported_ = base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kOzoneTestSingleOverlaySupport);
}
@@ -70,7 +28,8 @@ scoped_ptr<OverlayCandidatesOzone> DrmOverlayManager::CreateOverlayCandidates(
gfx::AcceleratedWidget w) {
if (!is_supported_)
return nullptr;
- return make_scoped_ptr(new SingleOverlay());
+ return make_scoped_ptr(
+ new DrmOverlayCandidatesHost(w, platform_support_host_));
}
bool DrmOverlayManager::CanShowPrimaryPlaneAsOverlay() {
« no previous file with comments | « ui/ozone/platform/drm/host/drm_overlay_manager.h ('k') | ui/ozone/platform/drm/ozone_platform_drm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698