| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 | 495 |
| 496 TEST_F(ScreenManagerTest, EnableControllerWhenWindowHasBuffer) { | 496 TEST_F(ScreenManagerTest, EnableControllerWhenWindowHasBuffer) { |
| 497 scoped_ptr<ui::DrmWindow> window( | 497 scoped_ptr<ui::DrmWindow> window( |
| 498 new ui::DrmWindow(1, device_manager_.get(), screen_manager_.get())); | 498 new ui::DrmWindow(1, device_manager_.get(), screen_manager_.get())); |
| 499 window->Initialize(); | 499 window->Initialize(); |
| 500 window->SetBounds(GetPrimaryBounds()); | 500 window->SetBounds(GetPrimaryBounds()); |
| 501 scoped_refptr<ui::ScanoutBuffer> buffer = buffer_generator_->Create( | 501 scoped_refptr<ui::ScanoutBuffer> buffer = buffer_generator_->Create( |
| 502 drm_, gfx::BufferFormat::BGRA_8888, GetPrimaryBounds().size()); | 502 drm_, gfx::BufferFormat::BGRA_8888, GetPrimaryBounds().size()); |
| 503 window->SchedulePageFlip( | 503 window->SchedulePageFlip( |
| 504 std::vector<ui::OverlayPlane>(1, ui::OverlayPlane(buffer)), | 504 std::vector<ui::OverlayPlane>(1, ui::OverlayPlane(buffer)), |
| 505 base::Bind(&EmptySwapCallback)); | 505 base::Bind(&EmptySwapCallback), buffer_generator_.get()); |
| 506 screen_manager_->AddWindow(1, std::move(window)); | 506 screen_manager_->AddWindow(1, std::move(window)); |
| 507 | 507 |
| 508 screen_manager_->AddDisplayController(drm_, kPrimaryCrtc, kPrimaryConnector); | 508 screen_manager_->AddDisplayController(drm_, kPrimaryCrtc, kPrimaryConnector); |
| 509 screen_manager_->ConfigureDisplayController( | 509 screen_manager_->ConfigureDisplayController( |
| 510 drm_, kPrimaryCrtc, kPrimaryConnector, GetPrimaryBounds().origin(), | 510 drm_, kPrimaryCrtc, kPrimaryConnector, GetPrimaryBounds().origin(), |
| 511 kDefaultMode); | 511 kDefaultMode); |
| 512 | 512 |
| 513 EXPECT_EQ(buffer->GetFramebufferId(), drm_->current_framebuffer()); | 513 EXPECT_EQ(buffer->GetFramebufferId(), drm_->current_framebuffer()); |
| 514 | 514 |
| 515 window = screen_manager_->RemoveWindow(1); | 515 window = screen_manager_->RemoveWindow(1); |
| 516 window->Shutdown(); | 516 window->Shutdown(); |
| 517 } | 517 } |
| OLD | NEW |