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

Unified Diff: ui/gfx/display_layout.h

Issue 1813493002: COMPLETED PREVIEW Migrate to Display Placement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gfxmove
Patch Set: Created 4 years, 9 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/gfx/BUILD.gn ('k') | ui/gfx/display_layout.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/display_layout.h
diff --git a/ui/gfx/display_layout.h b/ui/gfx/display_layout.h
index 8d1d57ec7270764e1e154cb3dc061f6e04102e4f..c7215627812d1747d6e08c0a1d929e120e30124e 100644
--- a/ui/gfx/display_layout.h
+++ b/ui/gfx/display_layout.h
@@ -55,14 +55,27 @@ struct GFX_EXPORT DisplayPlacement {
enum Position { TOP, RIGHT, BOTTOM, LEFT };
Position position;
- // The offset of the position of the secondary display. The offset is
- // based on the top/left edge of the primary display.
+ // The offset of the position with respect to the parent.
int offset;
- explicit DisplayPlacement(const DisplayPlacement& placement);
+ // Determines if the offset is relative to the TOP_LEFT or the BOTTOM_RIGHT.
+ // Defaults to TOP_LEFT.
+ enum OffsetReference { TOP_LEFT, BOTTOM_RIGHT };
+ OffsetReference offset_reference;
+
DisplayPlacement(Position position, int offset);
+ DisplayPlacement(Position position,
+ int offset,
+ OffsetReference offset_reference);
+ DisplayPlacement(int64_t display_id,
+ int64_t parent_display_id,
+ Position position,
+ int offset,
+ OffsetReference offset_reference);
DisplayPlacement();
+ DisplayPlacement(const DisplayPlacement& placement);
+
DisplayPlacement& Swap();
std::string ToString() const;
@@ -77,6 +90,19 @@ class GFX_EXPORT DisplayLayout final {
DisplayLayout();
~DisplayLayout();
+ // Applies the layout and updates the bounds of displays in |display_list|.
+ // |updated_ids| contains the ids for displays whose bounds have changed.
+ void ApplyToDisplayList(DisplayList* display_list,
+ std::vector<int64_t>* updated_ids,
+ int minimum_offset_overlap) const;
+
+ // Apply the display placement to the display layout.
+ // Returns true if the display bounds has been updated.
+ bool ApplyDisplayPlacement(const gfx::DisplayPlacement& placement,
+ gfx::DisplayList* display_list,
+ int minimum_offset_overlap) const;
+
+
// Validates the layout object.
static bool Validate(const DisplayIdList& list, const DisplayLayout& layout);
« no previous file with comments | « ui/gfx/BUILD.gn ('k') | ui/gfx/display_layout.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698