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

Unified Diff: ui/ozone/platform/dri/dri_surface_factory_unittest.cc

Issue 393233005: [Ozone-DRI] Convert HardwareDisplayController to use scanout buffers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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 side-by-side diff with in-line comments
Download patch
Index: ui/ozone/platform/dri/dri_surface_factory_unittest.cc
diff --git a/ui/ozone/platform/dri/dri_surface_factory_unittest.cc b/ui/ozone/platform/dri/dri_surface_factory_unittest.cc
index e5bf3c0ddc661df8e6744ec53f805dc3ccbd3d55..edebaa173c1ec3a3e822f1d7e29312f48343f1f6 100644
--- a/ui/ozone/platform/dri/dri_surface_factory_unittest.cc
+++ b/ui/ozone/platform/dri/dri_surface_factory_unittest.cc
@@ -16,7 +16,6 @@
#include "ui/ozone/platform/dri/hardware_display_controller.h"
#include "ui/ozone/platform/dri/screen_manager.h"
#include "ui/ozone/platform/dri/test/mock_dri_wrapper.h"
-#include "ui/ozone/platform/dri/test/mock_surface_generator.h"
#include "ui/ozone/public/surface_factory_ozone.h"
#include "ui/ozone/public/surface_ozone_canvas.h"
@@ -28,8 +27,8 @@ const drmModeModeInfo kDefaultMode =
class MockScreenManager : public ui::ScreenManager {
public:
MockScreenManager(ui::DriWrapper* dri,
- ui::ScanoutSurfaceGenerator* surface_generator)
- : ScreenManager(dri, surface_generator),
+ ui::ScanoutBufferGenerator* buffer_generator)
+ : ScreenManager(dri, buffer_generator),
dri_(dri) {}
virtual ~MockScreenManager() {}
@@ -56,7 +55,7 @@ class DriSurfaceFactoryTest : public testing::Test {
protected:
scoped_ptr<base::MessageLoop> message_loop_;
scoped_ptr<ui::MockDriWrapper> dri_;
- scoped_ptr<ui::MockSurfaceGenerator> surface_generator_;
+ scoped_ptr<ui::DriBufferGenerator> buffer_generator_;
scoped_ptr<MockScreenManager> screen_manager_;
scoped_ptr<ui::DriSurfaceFactory> factory_;
@@ -67,9 +66,9 @@ class DriSurfaceFactoryTest : public testing::Test {
void DriSurfaceFactoryTest::SetUp() {
message_loop_.reset(new base::MessageLoopForUI);
dri_.reset(new ui::MockDriWrapper(3));
- surface_generator_.reset(new ui::MockSurfaceGenerator(dri_.get()));
+ buffer_generator_.reset(new ui::DriBufferGenerator(dri_.get()));
screen_manager_.reset(new MockScreenManager(dri_.get(),
- surface_generator_.get()));
+ buffer_generator_.get()));
factory_.reset(new ui::DriSurfaceFactory(dri_.get(), screen_manager_.get()));
}
@@ -120,11 +119,12 @@ TEST_F(DriSurfaceFactoryTest, CheckNativeSurfaceContents) {
gfx::Rect(0, 0, kDefaultMode.hdisplay / 2, kDefaultMode.vdisplay / 2));
SkBitmap image;
- // Buffers 0 and 1 are the cursor buffers and 2 and 3 are the surface buffers.
- // Buffer 3 is the backbuffer we just painted in, so we want to make sure its
+ // Buffers 0 and 1 are the cursor buffers, 2 is the modeset buffer, and
+ // 3 and 4 are the surface buffers.
+ // Buffer 4 is the backbuffer we just painted in, so we want to make sure its
// contents are correct.
- image.setInfo(dri_->buffers()[3]->getCanvas()->imageInfo());
- EXPECT_TRUE(dri_->buffers()[3]->getCanvas()->readPixels(&image, 0, 0));
+ image.setInfo(dri_->buffers()[4]->getCanvas()->imageInfo());
+ EXPECT_TRUE(dri_->buffers()[4]->getCanvas()->readPixels(&image, 0, 0));
EXPECT_EQ(kDefaultMode.hdisplay, image.width());
EXPECT_EQ(kDefaultMode.vdisplay, image.height());

Powered by Google App Engine
This is Rietveld 408576698