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

Side by Side Diff: ui/ozone/platform/drm/host/drm_overlay_manager.cc

Issue 2122303003: Remove kOzoneTestSingleOverlaySupport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation. Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « ui/ozone/platform/drm/host/drm_overlay_manager.h ('k') | ui/ozone/public/ozone_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/ozone/platform/drm/host/drm_overlay_manager.h" 5 #include "ui/ozone/platform/drm/host/drm_overlay_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 11 matching lines...) Expand all
22 OverlaySurfaceCandidateList; 22 OverlaySurfaceCandidateList;
23 typedef OverlayCandidatesOzone::OverlaySurfaceCandidate OverlaySurfaceCandidate; 23 typedef OverlayCandidatesOzone::OverlaySurfaceCandidate OverlaySurfaceCandidate;
24 24
25 namespace { 25 namespace {
26 const size_t kMaxCacheSize = 200; 26 const size_t kMaxCacheSize = 200;
27 } // namespace 27 } // namespace
28 28
29 DrmOverlayManager::DrmOverlayManager(GpuThreadAdapter* proxy, 29 DrmOverlayManager::DrmOverlayManager(GpuThreadAdapter* proxy,
30 DrmWindowHostManager* window_manager) 30 DrmWindowHostManager* window_manager)
31 : proxy_(proxy), window_manager_(window_manager), cache_(kMaxCacheSize) { 31 : proxy_(proxy), window_manager_(window_manager), cache_(kMaxCacheSize) {
32 is_supported_ = base::CommandLine::ForCurrentProcess()->HasSwitch(
33 switches::kOzoneTestSingleOverlaySupport);
34 proxy_->RegisterHandlerForDrmOverlayManager(this); 32 proxy_->RegisterHandlerForDrmOverlayManager(this);
35 } 33 }
36 34
37 DrmOverlayManager::~DrmOverlayManager() { 35 DrmOverlayManager::~DrmOverlayManager() {
38 proxy_->UnRegisterHandlerForDrmOverlayManager(); 36 proxy_->UnRegisterHandlerForDrmOverlayManager();
39 } 37 }
40 38
41 std::unique_ptr<OverlayCandidatesOzone> 39 std::unique_ptr<OverlayCandidatesOzone>
42 DrmOverlayManager::CreateOverlayCandidates(gfx::AcceleratedWidget w) { 40 DrmOverlayManager::CreateOverlayCandidates(gfx::AcceleratedWidget w) {
43 if (!is_supported_)
44 return nullptr;
45 return base::WrapUnique(new DrmOverlayCandidatesHost(this, w)); 41 return base::WrapUnique(new DrmOverlayCandidatesHost(this, w));
46 } 42 }
47 43
48 void DrmOverlayManager::CheckOverlaySupport( 44 void DrmOverlayManager::CheckOverlaySupport(
49 OverlayCandidatesOzone::OverlaySurfaceCandidateList* candidates, 45 OverlayCandidatesOzone::OverlaySurfaceCandidateList* candidates,
50 gfx::AcceleratedWidget widget) { 46 gfx::AcceleratedWidget widget) {
51 std::vector<OverlayCheck_Params> overlay_params; 47 std::vector<OverlayCheck_Params> overlay_params;
52 for (auto& candidate : *candidates) { 48 for (auto& candidate : *candidates) {
53 // Reject candidates that don't fall on a pixel boundary. 49 // Reject candidates that don't fall on a pixel boundary.
54 if (!gfx::IsNearestRectWithinDistance(candidate.display_rect, 0.01f)) { 50 if (!gfx::IsNearestRectWithinDistance(candidate.display_rect, 0.01f)) {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 143 }
148 144
149 if (candidate.is_clipped && 145 if (candidate.is_clipped &&
150 !candidate.clip_rect.Contains(candidate.quad_rect_in_target_space)) 146 !candidate.clip_rect.Contains(candidate.quad_rect_in_target_space))
151 return false; 147 return false;
152 148
153 return true; 149 return true;
154 } 150 }
155 151
156 } // namespace ui 152 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/host/drm_overlay_manager.h ('k') | ui/ozone/public/ozone_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698