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

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

Issue 535963002: ozone: Directly provide size of active mode from HardwareDisplayController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/dri/hardware_display_controller.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/dri/screen_manager.cc
diff --git a/ui/ozone/platform/dri/screen_manager.cc b/ui/ozone/platform/dri/screen_manager.cc
index 0a8af0fc662a8efa3388aa14ea1941228f2cf838..f14b0869b9581f5b4931a14b5170ba9649444625 100644
--- a/ui/ozone/platform/dri/screen_manager.cc
+++ b/ui/ozone/platform/dri/screen_manager.cc
@@ -16,14 +16,6 @@
namespace ui {
-namespace {
-
-gfx::Size GetModeSize(const drmModeModeInfo& mode) {
- return gfx::Size(mode.hdisplay, mode.vdisplay);
-}
-
-} // namespace
-
ScreenManager::ScreenManager(DriWrapper* dri,
ScanoutBufferGenerator* buffer_generator)
: dri_(dri), buffer_generator_(buffer_generator) {
@@ -46,7 +38,8 @@ bool ScreenManager::ConfigureDisplayController(uint32_t crtc,
uint32_t connector,
const gfx::Point& origin,
const drmModeModeInfo& mode) {
- gfx::Rect modeset_bounds(origin, GetModeSize(mode));
+ gfx::Rect modeset_bounds(
+ origin.x(), origin.y(), mode.hdisplay, mode.vdisplay);
HardwareDisplayControllers::iterator it = FindDisplayController(crtc);
HardwareDisplayController* controller = NULL;
if (it != controllers_.end()) {
@@ -143,8 +136,7 @@ ScreenManager::FindActiveDisplayControllerByLocation(const gfx::Rect& bounds) {
for (HardwareDisplayControllers::iterator it = controllers_.begin();
it != controllers_.end();
++it) {
- gfx::Rect controller_bounds((*it)->origin(),
- GetModeSize((*it)->get_mode()));
+ gfx::Rect controller_bounds((*it)->origin(), (*it)->GetModeSize());
// We don't perform a strict check since content_shell will have windows
// smaller than the display size.
if (controller_bounds.Contains(bounds) && !(*it)->IsDisabled())
« no previous file with comments | « ui/ozone/platform/dri/hardware_display_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698