Commit c7d98b94 authored by Michael Spang's avatar Michael Spang Committed by Commit Bot

display: Fix DisplayList::UpdateDisplay losing pixel sizes

Updating displays in TestScreen loses the pixel size, which causes later
calls to SetDisplayRotation to revert updates of the display size made by
TestScreen::OnWindowBoundsChanged.

Bug: 1019015

Change-Id: I47d77665102c9500609cfd203740e320ef841af7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1889295
Commit-Queue: Michael Spang <spang@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711138}
parent ef7df346
......@@ -193,9 +193,7 @@ class DISPLAY_EXPORT Display final {
// Returns the display's size in pixel coordinates.
gfx::Size GetSizeInPixel() const;
#if defined(OS_ANDROID)
void set_size_in_pixels(const gfx::Size& size) { size_in_pixels_ = size; }
#endif // defined(OS_ANDROID)
// Returns a string representation of the display;
std::string ToString() const;
......
......@@ -104,6 +104,9 @@ uint32_t DisplayList::UpdateDisplay(const Display& display, Type type) {
local_display->set_color_depth(color_depth);
changed_values |= DisplayObserver::DISPLAY_METRIC_COLOR_SPACE;
}
if (local_display->GetSizeInPixel() != display.GetSizeInPixel()) {
local_display->set_size_in_pixels(display.GetSizeInPixel());
}
if (should_notify_observers()) {
for (DisplayObserver& observer : observers_)
observer.OnDisplayMetricsChanged(*local_display, changed_values);
......
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