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

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

Issue 1423793003: Optimize plane usage when primary is obscured by Overlay (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check that primary and Overlay formats are same Created 5 years, 2 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/gpu/hardware_display_plane_manager_legacy.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/gpu/hardware_display_plane_manager_unittest.cc
diff --git a/ui/ozone/platform/drm/gpu/hardware_display_plane_manager_unittest.cc b/ui/ozone/platform/drm/gpu/hardware_display_plane_manager_unittest.cc
index 283d5c8cd3aaaef9452745cf000ba2574242c2fe..bc7cf5a76bc65d495ccecb9b4eb09ab2fd252e3b 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_plane_manager_unittest.cc
+++ b/ui/ozone/platform/drm/gpu/hardware_display_plane_manager_unittest.cc
@@ -31,12 +31,14 @@ const uint32_t kDummyFormat = 0;
class FakeScanoutBuffer : public ui::ScanoutBuffer {
public:
- FakeScanoutBuffer(uint32_t format) : format_(format) {}
+ FakeScanoutBuffer(uint32_t format)
+ : format_(format), size_(gfx::Size(2, 2)) {}
// ui::ScanoutBuffer:
uint32_t GetFramebufferId() const override { return 1; }
uint32_t GetHandle() const override { return 0; }
- gfx::Size GetSize() const override { return gfx::Size(1, 1); }
+ void SetSize(const gfx::Size& size) { size_ = size; }
+ gfx::Size GetSize() const override { return size_; }
void SetFramebufferPixelFormat(uint32_t format) { format_ = format; }
uint32_t GetFramebufferPixelFormat() const override { return format_; }
bool RequiresGlFinish() const override { return false; }
@@ -44,6 +46,7 @@ class FakeScanoutBuffer : public ui::ScanoutBuffer {
protected:
~FakeScanoutBuffer() override {}
uint32_t format_;
+ gfx::Size size_;
};
class FakePlaneManager : public ui::HardwareDisplayPlaneManager {
@@ -227,8 +230,12 @@ TEST_F(HardwareDisplayPlaneManagerTest, MultipleFramesDifferentPlanes) {
TEST_F(HardwareDisplayPlaneManagerTest, SharedPlanes) {
ui::OverlayPlaneList assigns;
+ scoped_refptr<FakeScanoutBuffer> buffer =
+ new FakeScanoutBuffer(DRM_FORMAT_XRGB8888);
+ buffer->SetSize(gfx::Size(1, 1));
+
assigns.push_back(ui::OverlayPlane(fake_buffer_));
- assigns.push_back(ui::OverlayPlane(fake_buffer_));
+ assigns.push_back(ui::OverlayPlane(buffer));
plane_manager_->InitForTest(kOnePlanePerCrtcWithShared,
arraysize(kOnePlanePerCrtcWithShared),
default_crtcs_);
@@ -267,10 +274,13 @@ TEST(HardwareDisplayPlaneManagerLegacyTest, UnusedPlanesAreReleased) {
crtcs.push_back(100);
scoped_refptr<ui::MockDrmDevice> drm = new ui::MockDrmDevice(false, crtcs, 2);
ui::OverlayPlaneList assigns;
- scoped_refptr<FakeScanoutBuffer> fake_buffer =
+ scoped_refptr<FakeScanoutBuffer> primary_buffer =
+ new FakeScanoutBuffer(DRM_FORMAT_XRGB8888);
+ scoped_refptr<FakeScanoutBuffer> overlay_buffer =
new FakeScanoutBuffer(DRM_FORMAT_XRGB8888);
- assigns.push_back(ui::OverlayPlane(fake_buffer));
- assigns.push_back(ui::OverlayPlane(fake_buffer));
+ overlay_buffer->SetSize(gfx::Size(1, 1));
+ assigns.push_back(ui::OverlayPlane(primary_buffer));
+ assigns.push_back(ui::OverlayPlane(overlay_buffer));
ui::HardwareDisplayPlaneList hdpl;
ui::CrtcController crtc(drm, crtcs[0], 0);
drm->plane_manager()->BeginFrame(&hdpl);
@@ -278,7 +288,7 @@ TEST(HardwareDisplayPlaneManagerLegacyTest, UnusedPlanesAreReleased) {
crtcs[0], &crtc));
EXPECT_TRUE(drm->plane_manager()->Commit(&hdpl, false));
assigns.clear();
- assigns.push_back(ui::OverlayPlane(fake_buffer));
+ assigns.push_back(ui::OverlayPlane(primary_buffer));
drm->plane_manager()->BeginFrame(&hdpl);
EXPECT_TRUE(drm->plane_manager()->AssignOverlayPlanes(&hdpl, assigns,
crtcs[0], &crtc));
« no previous file with comments | « ui/ozone/platform/drm/gpu/hardware_display_plane_manager_legacy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698