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

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

Issue 2259753003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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 20 matching lines...) Expand all
31 : proxy_(proxy), window_manager_(window_manager), cache_(kMaxCacheSize) { 31 : proxy_(proxy), window_manager_(window_manager), cache_(kMaxCacheSize) {
32 proxy_->RegisterHandlerForDrmOverlayManager(this); 32 proxy_->RegisterHandlerForDrmOverlayManager(this);
33 } 33 }
34 34
35 DrmOverlayManager::~DrmOverlayManager() { 35 DrmOverlayManager::~DrmOverlayManager() {
36 proxy_->UnRegisterHandlerForDrmOverlayManager(); 36 proxy_->UnRegisterHandlerForDrmOverlayManager();
37 } 37 }
38 38
39 std::unique_ptr<OverlayCandidatesOzone> 39 std::unique_ptr<OverlayCandidatesOzone>
40 DrmOverlayManager::CreateOverlayCandidates(gfx::AcceleratedWidget w) { 40 DrmOverlayManager::CreateOverlayCandidates(gfx::AcceleratedWidget w) {
41 return base::WrapUnique(new DrmOverlayCandidatesHost(this, w)); 41 return base::MakeUnique<DrmOverlayCandidatesHost>(this, w);
42 } 42 }
43 43
44 void DrmOverlayManager::CheckOverlaySupport( 44 void DrmOverlayManager::CheckOverlaySupport(
45 OverlayCandidatesOzone::OverlaySurfaceCandidateList* candidates, 45 OverlayCandidatesOzone::OverlaySurfaceCandidateList* candidates,
46 gfx::AcceleratedWidget widget) { 46 gfx::AcceleratedWidget widget) {
47 std::vector<OverlayCheck_Params> overlay_params; 47 std::vector<OverlayCheck_Params> overlay_params;
48 for (auto& candidate : *candidates) { 48 for (auto& candidate : *candidates) {
49 // Reject candidates that don't fall on a pixel boundary. 49 // Reject candidates that don't fall on a pixel boundary.
50 if (!gfx::IsNearestRectWithinDistance(candidate.display_rect, 0.01f)) { 50 if (!gfx::IsNearestRectWithinDistance(candidate.display_rect, 0.01f)) {
51 DCHECK(candidate.plane_z_order != 0); 51 DCHECK(candidate.plane_z_order != 0);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 } 143 }
144 144
145 if (candidate.is_clipped && 145 if (candidate.is_clipped &&
146 !candidate.clip_rect.Contains(candidate.quad_rect_in_target_space)) 146 !candidate.clip_rect.Contains(candidate.quad_rect_in_target_space))
147 return false; 147 return false;
148 148
149 return true; 149 return true;
150 } 150 }
151 151
152 } // namespace ui 152 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/host/drm_display_host_manager.cc ('k') | ui/ozone/platform/drm/ozone_platform_gbm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698