Commit e6339bf9 authored by Daniele Castagna's avatar Daniele Castagna Committed by Commit Bot

ozone/drm: Fix new-vs-free in unittest

HardwareDisplayPlaneManagerUnittest allocated CTMs with new,
while they are deleted with free.
This patch fixes that so that we can run ozone_unittests with
asan on trybots.

Bug: 855588
Test: ozone_unittests
Change-Id: If5827d38b34cb8df2f56c770e8f9d28c587c022a
Reviewed-on: https://chromium-review.googlesource.com/1112964Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569927}
parent e419ff3d
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "ui/gfx/gpu_fence.h" #include "ui/gfx/gpu_fence.h"
#include "ui/gfx/gpu_fence_handle.h" #include "ui/gfx/gpu_fence_handle.h"
#include "ui/ozone/platform/drm/gpu/crtc_controller.h" #include "ui/ozone/platform/drm/gpu/crtc_controller.h"
#include "ui/ozone/platform/drm/gpu/drm_gpu_util.h"
#include "ui/ozone/platform/drm/gpu/hardware_display_plane_atomic.h" #include "ui/ozone/platform/drm/gpu/hardware_display_plane_atomic.h"
#include "ui/ozone/platform/drm/gpu/hardware_display_plane_manager_atomic.h" #include "ui/ozone/platform/drm/gpu/hardware_display_plane_manager_atomic.h"
#include "ui/ozone/platform/drm/gpu/hardware_display_plane_manager_legacy.h" #include "ui/ozone/platform/drm/gpu/hardware_display_plane_manager_legacy.h"
...@@ -370,7 +371,7 @@ TEST_P(HardwareDisplayPlaneManagerAtomicTest, ...@@ -370,7 +371,7 @@ TEST_P(HardwareDisplayPlaneManagerAtomicTest,
fake_drm_->InitializeState(crtc_properties_, plane_properties_, fake_drm_->InitializeState(crtc_properties_, plane_properties_,
property_names_, use_atomic_); property_names_, use_atomic_);
ui::ScopedDrmColorCtmPtr ctm_blob(new drm_color_ctm()); ui::ScopedDrmColorCtmPtr ctm_blob(ui::CreateCTMBlob(std::vector<float>(9)));
EXPECT_TRUE(fake_drm_->plane_manager()->SetColorCorrectionOnAllCrtcPlanes( EXPECT_TRUE(fake_drm_->plane_manager()->SetColorCorrectionOnAllCrtcPlanes(
crtc_properties_[0].id, std::move(ctm_blob))); crtc_properties_[0].id, std::move(ctm_blob)));
EXPECT_EQ(1, fake_drm_->get_commit_count()); EXPECT_EQ(1, fake_drm_->get_commit_count());
...@@ -382,7 +383,7 @@ TEST_P(HardwareDisplayPlaneManagerAtomicTest, ...@@ -382,7 +383,7 @@ TEST_P(HardwareDisplayPlaneManagerAtomicTest,
fake_drm_->InitializeState(crtc_properties_, plane_properties_, fake_drm_->InitializeState(crtc_properties_, plane_properties_,
property_names_, use_atomic_); property_names_, use_atomic_);
ui::ScopedDrmColorCtmPtr ctm_blob(new drm_color_ctm()); ui::ScopedDrmColorCtmPtr ctm_blob(ui::CreateCTMBlob(std::vector<float>(9)));
EXPECT_FALSE(fake_drm_->plane_manager()->SetColorCorrectionOnAllCrtcPlanes( EXPECT_FALSE(fake_drm_->plane_manager()->SetColorCorrectionOnAllCrtcPlanes(
crtc_properties_[0].id, std::move(ctm_blob))); crtc_properties_[0].id, std::move(ctm_blob)));
EXPECT_EQ(0, fake_drm_->get_commit_count()); EXPECT_EQ(0, fake_drm_->get_commit_count());
...@@ -395,7 +396,7 @@ TEST_P(HardwareDisplayPlaneManagerAtomicTest, ...@@ -395,7 +396,7 @@ TEST_P(HardwareDisplayPlaneManagerAtomicTest,
fake_drm_->InitializeState(crtc_properties_, plane_properties_, fake_drm_->InitializeState(crtc_properties_, plane_properties_,
property_names_, use_atomic_); property_names_, use_atomic_);
ui::ScopedDrmColorCtmPtr ctm_blob(new drm_color_ctm()); ui::ScopedDrmColorCtmPtr ctm_blob(ui::CreateCTMBlob(std::vector<float>(9)));
EXPECT_FALSE(fake_drm_->plane_manager()->SetColorCorrectionOnAllCrtcPlanes( EXPECT_FALSE(fake_drm_->plane_manager()->SetColorCorrectionOnAllCrtcPlanes(
crtc_properties_[0].id, std::move(ctm_blob))); crtc_properties_[0].id, std::move(ctm_blob)));
EXPECT_EQ(0, fake_drm_->get_commit_count()); EXPECT_EQ(0, fake_drm_->get_commit_count());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment