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

Unified Diff: ui/ozone/platform/drm/gpu/hardware_display_controller.cc

Issue 2603863002: Remove base::ScopedPtrHashMap from ozone. (Closed)
Patch Set: fixes Created 4 years 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/gpu/hardware_display_controller.h ('k') | ui/ozone/platform/drm/gpu/screen_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/gpu/hardware_display_controller.cc
diff --git a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
index c45ed81146759ef83c64fe507846e9ef399d2ea8..4ea1e2a0210ea4ba31cee4b0195df33c0efd832b 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
+++ b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
@@ -10,6 +10,7 @@
#include <utility>
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/trace_event/trace_event.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "ui/gfx/geometry/point.h"
@@ -114,17 +115,18 @@ bool HardwareDisplayController::ActualSchedulePageFlip(
}
for (const auto& planes : owned_hardware_planes_)
- planes.first->plane_manager()->BeginFrame(planes.second);
+ planes.first->plane_manager()->BeginFrame(planes.second.get());
bool status = true;
for (const auto& controller : crtc_controllers_) {
status &= controller->SchedulePageFlip(
- owned_hardware_planes_.get(controller->drm().get()), pending_planes,
+ owned_hardware_planes_[controller->drm().get()].get(), pending_planes,
test_only, page_flip_request);
}
for (const auto& planes : owned_hardware_planes_) {
- if (!planes.first->plane_manager()->Commit(planes.second, test_only)) {
+ if (!planes.first->plane_manager()->Commit(planes.second.get(),
+ test_only)) {
status = false;
}
}
@@ -178,15 +180,14 @@ bool HardwareDisplayController::MoveCursor(const gfx::Point& location) {
void HardwareDisplayController::AddCrtc(
std::unique_ptr<CrtcController> controller) {
scoped_refptr<DrmDevice> drm = controller->drm();
- owned_hardware_planes_.add(drm.get(),
- std::unique_ptr<HardwareDisplayPlaneList>(
- new HardwareDisplayPlaneList()));
+ owned_hardware_planes_[drm.get()] =
+ base::MakeUnique<HardwareDisplayPlaneList>();
// Check if this controller owns any planes and ensure we keep track of them.
const std::vector<std::unique_ptr<HardwareDisplayPlane>>& all_planes =
drm->plane_manager()->planes();
HardwareDisplayPlaneList* crtc_plane_list =
- owned_hardware_planes_.get(drm.get());
+ owned_hardware_planes_[drm.get()].get();
uint32_t crtc = controller->crtc();
for (const auto& plane : all_planes) {
if (plane->in_use() && (plane->owning_crtc() == crtc))
@@ -217,7 +218,7 @@ std::unique_ptr<CrtcController> HardwareDisplayController::RemoveCrtc(
if (found) {
std::vector<HardwareDisplayPlane*> all_planes;
HardwareDisplayPlaneList* plane_list =
- owned_hardware_planes_.get(drm.get());
+ owned_hardware_planes_[drm.get()].get();
all_planes.swap(plane_list->old_plane_list);
for (auto* plane : all_planes) {
if (plane->owning_crtc() != crtc)
« no previous file with comments | « ui/ozone/platform/drm/gpu/hardware_display_controller.h ('k') | ui/ozone/platform/drm/gpu/screen_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698