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

Side by Side Diff: services/ui/display/platform_screen_delegate.h

Issue 2356913002: Pass device scale factor from display to ws. (Closed)
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef SERVICES_UI_DISPLAY_PLATFORM_SCREEN_DELEGATE_H_ 5 #ifndef SERVICES_UI_DISPLAY_PLATFORM_SCREEN_DELEGATE_H_
6 #define SERVICES_UI_DISPLAY_PLATFORM_SCREEN_DELEGATE_H_ 6 #define SERVICES_UI_DISPLAY_PLATFORM_SCREEN_DELEGATE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 namespace gfx { 10 namespace gfx {
11 class Rect; 11 class Rect;
12 class Size;
12 } 13 }
13 14
14 namespace display { 15 namespace display {
15 16
16 class PlatformScreen; 17 class PlatformScreen;
17 18
18 // The PlatformScreenDelegate will be informed of changes to the physical 19 // The PlatformScreenDelegate will be informed of changes to the physical
19 // and/or virtual displays by PlatformScreen. 20 // and/or virtual displays by PlatformScreen.
20 class PlatformScreenDelegate { 21 class PlatformScreenDelegate {
21 public: 22 public:
22 // TODO(kylechar): We need to provide more than just the window bounds when
23 // displays are added or modified.
24
25 // Called when a display is added. |bounds| is in DIP. 23 // Called when a display is added. |bounds| is in DIP.
26 virtual void OnDisplayAdded(int64_t id, const gfx::Rect& bounds) = 0; 24 virtual void OnDisplayAdded(int64_t id,
25 const gfx::Rect& bounds,
26 const gfx::Size& pixel_size,
rjkroege 2016/09/21 13:23:46 and pixel_size is not in dip? i.e. in DDP? Please
kylechar 2016/09/21 16:31:12 Done.
27 float scale_factor) = 0;
rjkroege 2016/09/21 13:23:46 If we have the size in DP and the size in DIP, the
kylechar 2016/09/21 16:31:12 Usually, DIP = DDP * (ui_scale_factor / device_sca
27 28
28 // Called when a display is removed. 29 // Called when a display is removed.
29 virtual void OnDisplayRemoved(int64_t id) = 0; 30 virtual void OnDisplayRemoved(int64_t id) = 0;
30 31
31 // Called when a display is modified. |bounds| is in DIP. 32 // Called when a display is modified. |bounds| is in DIP.
32 virtual void OnDisplayModified(int64_t id, const gfx::Rect& bounds) = 0; 33 virtual void OnDisplayModified(int64_t id,
34 const gfx::Rect& bounds,
35 const gfx::Size& pixel_size,
36 float scale_factor) = 0;
33 37
34 protected: 38 protected:
35 virtual ~PlatformScreenDelegate() {} 39 virtual ~PlatformScreenDelegate() {}
36 }; 40 };
37 41
38 } // namespace display 42 } // namespace display
39 43
40 #endif // SERVICES_UI_DISPLAY_PLATFORM_SCREEN_DELEGATE_H_ 44 #endif // SERVICES_UI_DISPLAY_PLATFORM_SCREEN_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | services/ui/display/platform_screen_ozone.h » ('j') | services/ui/display/platform_screen_ozone.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698