[Wayland] Implement WaylandWpColorManagementSurface::OnPreferredChanged [chromium/src : main]

0 views
Skip to first unread message

Thomas Anderson (Gerrit)

unread,
Aug 21, 2025, 4:39:17 PMAug 21
to Kramer Ge, Chromium LUCI CQ, chromium...@chromium.org, Sadrul Chowdhury, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
Attention needed from Kramer Ge

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Kramer Ge
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I5885feefb7534de9a3a86fdd2f7f9752c6e559a3
Gerrit-Change-Number: 6868958
Gerrit-PatchSet: 2
Gerrit-Owner: Thomas Anderson <thomasa...@chromium.org>
Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
Gerrit-Reviewer: Thomas Anderson <thomasa...@chromium.org>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Kramer Ge <fang...@chromium.org>
Gerrit-Comment-Date: Thu, 21 Aug 2025 20:39:08 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Thomas Anderson (Gerrit)

unread,
Aug 22, 2025, 5:15:02 PMAug 22
to Kramer Ge, Chromium LUCI CQ, chromium...@chromium.org, Sadrul Chowdhury, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
Attention needed from Kramer Ge

Thomas Anderson added 1 comment

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Thomas Anderson . resolved

pinging Kramer

Open in Gerrit

Related details

Attention is currently required from:
  • Kramer Ge
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I5885feefb7534de9a3a86fdd2f7f9752c6e559a3
Gerrit-Change-Number: 6868958
Gerrit-PatchSet: 6
Gerrit-Owner: Thomas Anderson <thomasa...@chromium.org>
Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
Gerrit-Reviewer: Thomas Anderson <thomasa...@chromium.org>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Kramer Ge <fang...@chromium.org>
Gerrit-Comment-Date: Fri, 22 Aug 2025 21:14:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Kramer Ge (Gerrit)

unread,
Aug 25, 2025, 2:49:43 PM (14 days ago) Aug 25
to Thomas Anderson, Chromium LUCI CQ, chromium...@chromium.org, Sadrul Chowdhury, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
Attention needed from Thomas Anderson

Kramer Ge added 3 comments

File ui/aura/window_tree_host.cc
Line 671, Patchset 6 (Latest): compositor_->SetDisplayColorSpaces(color_spaces->color_spaces());
Kramer Ge . unresolved

Should this be set when `compositor_` is created also?

File ui/ozone/platform/wayland/host/wayland_wp_color_management_surface.cc
Line 86, Patchset 6 (Latest): CHECK_EQ(image_description, image_description_);
Kramer Ge . unresolved

Potentially we can be crashed by compositor sending multiple `preferred_changed` events?

Line 98, Patchset 6 (Latest): uint32_t identity) {
Kramer Ge . unresolved

we don't need `identity` here, is it because we only retain one description at a time?

Open in Gerrit

Related details

Attention is currently required from:
  • Thomas Anderson
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I5885feefb7534de9a3a86fdd2f7f9752c6e559a3
    Gerrit-Change-Number: 6868958
    Gerrit-PatchSet: 6
    Gerrit-Owner: Thomas Anderson <thomasa...@chromium.org>
    Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
    Gerrit-Reviewer: Thomas Anderson <thomasa...@chromium.org>
    Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
    Gerrit-Attention: Thomas Anderson <thomasa...@chromium.org>
    Gerrit-Comment-Date: Mon, 25 Aug 2025 18:49:38 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Thomas Anderson (Gerrit)

    unread,
    Aug 25, 2025, 4:36:30 PM (13 days ago) Aug 25
    to Kramer Ge, Chromium LUCI CQ, chromium...@chromium.org, Sadrul Chowdhury, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
    Attention needed from Kramer Ge

    Thomas Anderson voted and added 3 comments

    Votes added by Thomas Anderson

    Commit-Queue+1

    3 comments

    File ui/aura/window_tree_host.cc
    Line 671, Patchset 6: compositor_->SetDisplayColorSpaces(color_spaces->color_spaces());
    Kramer Ge . resolved

    Should this be set when `compositor_` is created also?

    Thomas Anderson

    It is, on L574

    File ui/ozone/platform/wayland/host/wayland_wp_color_management_surface.cc
    Line 86, Patchset 6: CHECK_EQ(image_description, image_description_);
    Kramer Ge . resolved

    Potentially we can be crashed by compositor sending multiple `preferred_changed` events?

    Thomas Anderson

    Yes, removed.

    Line 98, Patchset 6: uint32_t identity) {
    Kramer Ge . resolved

    we don't need `identity` here, is it because we only retain one description at a time?

    Thomas Anderson

    We always recreate the WaylandWpImageDescription in this method, so `identity` isn't needed. Possibly it can be used to cache the description in a followup so a round-trip wouldn't be required.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Kramer Ge
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I5885feefb7534de9a3a86fdd2f7f9752c6e559a3
    Gerrit-Change-Number: 6868958
    Gerrit-PatchSet: 8
    Gerrit-Owner: Thomas Anderson <thomasa...@chromium.org>
    Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
    Gerrit-Reviewer: Thomas Anderson <thomasa...@chromium.org>
    Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
    Gerrit-Attention: Kramer Ge <fang...@chromium.org>
    Gerrit-Comment-Date: Mon, 25 Aug 2025 20:36:19 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Kramer Ge <fang...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kramer Ge (Gerrit)

    unread,
    Aug 25, 2025, 5:06:18 PM (13 days ago) Aug 25
    to Thomas Anderson, Chromium LUCI CQ, chromium...@chromium.org, Sadrul Chowdhury, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
    Attention needed from Thomas Anderson

    Kramer Ge voted and added 1 comment

    Votes added by Kramer Ge

    Code-Review+1

    1 comment

    Patchset-level comments
    File-level comment, Patchset 8 (Latest):
    Kramer Ge . resolved

    Thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Thomas Anderson
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I5885feefb7534de9a3a86fdd2f7f9752c6e559a3
      Gerrit-Change-Number: 6868958
      Gerrit-PatchSet: 8
      Gerrit-Owner: Thomas Anderson <thomasa...@chromium.org>
      Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
      Gerrit-Reviewer: Thomas Anderson <thomasa...@chromium.org>
      Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
      Gerrit-Attention: Thomas Anderson <thomasa...@chromium.org>
      Gerrit-Comment-Date: Mon, 25 Aug 2025 21:06:08 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Thomas Anderson (Gerrit)

      unread,
      Aug 25, 2025, 5:23:11 PM (13 days ago) Aug 25
      to Avi Drissman, Chromium LUCI CQ, chromium...@chromium.org, Sadrul Chowdhury, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
      Attention needed from Avi Drissman

      Thomas Anderson added 1 comment

      Patchset-level comments
      Thomas Anderson . resolved

      +avi@ for //ui approval

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Avi Drissman
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I5885feefb7534de9a3a86fdd2f7f9752c6e559a3
      Gerrit-Change-Number: 6868958
      Gerrit-PatchSet: 8
      Gerrit-Owner: Thomas Anderson <thomasa...@chromium.org>
      Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
      Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
      Gerrit-Reviewer: Thomas Anderson <thomasa...@chromium.org>
      Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
      Gerrit-Attention: Avi Drissman <a...@chromium.org>
      Gerrit-Comment-Date: Mon, 25 Aug 2025 21:23:01 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Avi Drissman (Gerrit)

      unread,
      Aug 25, 2025, 5:29:50 PM (13 days ago) Aug 25
      to Thomas Anderson, Avi Drissman, Chromium LUCI CQ, chromium...@chromium.org, Sadrul Chowdhury, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
      Attention needed from Thomas Anderson

      Avi Drissman voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Thomas Anderson
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I5885feefb7534de9a3a86fdd2f7f9752c6e559a3
      Gerrit-Change-Number: 6868958
      Gerrit-PatchSet: 8
      Gerrit-Owner: Thomas Anderson <thomasa...@chromium.org>
      Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
      Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
      Gerrit-Reviewer: Thomas Anderson <thomasa...@chromium.org>
      Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
      Gerrit-Attention: Thomas Anderson <thomasa...@chromium.org>
      Gerrit-Comment-Date: Mon, 25 Aug 2025 21:29:45 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Thomas Anderson (Gerrit)

      unread,
      Aug 25, 2025, 5:33:17 PM (13 days ago) Aug 25
      to Avi Drissman, Chromium LUCI CQ, chromium...@chromium.org, Sadrul Chowdhury, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org

      Thomas Anderson voted Commit-Queue+2

      Commit-Queue+2
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I5885feefb7534de9a3a86fdd2f7f9752c6e559a3
      Gerrit-Change-Number: 6868958
      Gerrit-PatchSet: 8
      Gerrit-Owner: Thomas Anderson <thomasa...@chromium.org>
      Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
      Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
      Gerrit-Reviewer: Thomas Anderson <thomasa...@chromium.org>
      Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
      Gerrit-Comment-Date: Mon, 25 Aug 2025 21:33:07 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Aug 25, 2025, 6:27:18 PM (13 days ago) Aug 25
      to Thomas Anderson, Avi Drissman, Kramer Ge, chromium...@chromium.org, Sadrul Chowdhury, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org

      Chromium LUCI CQ submitted the change

      Change information

      Commit message:
      [Wayland] Implement WaylandWpColorManagementSurface::OnPreferredChanged

      * Move DisplayColorSpacesRef from Display private to a public class.
      This is required Because DisplayColorSpaces is large and probably
      shouldn't be copied.
      * Add WindowTreeHost::display_color_spaces_ to hold the explicitly-set
      DisplayColorSpaces.
      * Move conversion code into
      WaylandWpImageDescription::AsDisplayColorSpaces and reuse it for the
      OnPreferredChanged callback.
      Fixed: 375959958
      Change-Id: I5885feefb7534de9a3a86fdd2f7f9752c6e559a3
      Reviewed-by: Avi Drissman <a...@chromium.org>
      Reviewed-by: Kramer Ge <fang...@chromium.org>
      Commit-Queue: Thomas Anderson <thomasa...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1506174}
      Files:
      • M ui/aura/window_tree_host.cc
      • M ui/aura/window_tree_host.h
      • M ui/aura/window_tree_host_platform.cc
      • M ui/aura/window_tree_host_platform.h
      • M ui/display/display.cc
      • M ui/display/display.h
      • M ui/gfx/display_color_spaces.cc
      • M ui/gfx/display_color_spaces.h
      • M ui/ozone/platform/wayland/host/wayland_screen.cc
      • M ui/ozone/platform/wayland/host/wayland_window.cc
      • M ui/ozone/platform/wayland/host/wayland_window.h
      • M ui/ozone/platform/wayland/host/wayland_wp_color_management_output.cc
      • M ui/ozone/platform/wayland/host/wayland_wp_color_management_output.h
      • M ui/ozone/platform/wayland/host/wayland_wp_color_management_surface.cc
      • M ui/ozone/platform/wayland/host/wayland_wp_color_management_surface.h
      • M ui/ozone/platform/wayland/host/wayland_wp_image_description.cc
      • M ui/ozone/platform/wayland/host/wayland_wp_image_description.h
      • M ui/platform_window/platform_window_delegate.cc
      • M ui/platform_window/platform_window_delegate.h
      Change size: M
      Delta: 19 files changed, 157 insertions(+), 72 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Kramer Ge, +1 by Avi Drissman
      Open in Gerrit
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: merged
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I5885feefb7534de9a3a86fdd2f7f9752c6e559a3
      Gerrit-Change-Number: 6868958
      Gerrit-PatchSet: 9
      Gerrit-Owner: Thomas Anderson <thomasa...@chromium.org>
      Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
      Gerrit-Reviewer: Thomas Anderson <thomasa...@chromium.org>
      open
      diffy
      satisfied_requirement

      Mitsuru Oshima (Gerrit)

      unread,
      Aug 26, 2025, 11:55:27 PM (12 days ago) Aug 26
      to Chromium LUCI CQ, Thomas Anderson, Avi Drissman, chromium...@chromium.org, Sadrul Chowdhury, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
      Attention needed from Thomas Anderson

      Mitsuru Oshima added 1 comment

      File ui/aura/window_tree_host.cc
      Line 575, Patchset 9 (Latest): : display.GetColorSpaces());
      Mitsuru Oshima . unresolved

      Hi, can you explain why this change is needed (and can't be done via display)? This creates another source of the truth about color space, which can be error prone.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Thomas Anderson
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I5885feefb7534de9a3a86fdd2f7f9752c6e559a3
      Gerrit-Change-Number: 6868958
      Gerrit-PatchSet: 9
      Gerrit-Owner: Thomas Anderson <thomasa...@chromium.org>
      Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
      Gerrit-Reviewer: Thomas Anderson <thomasa...@chromium.org>
      Gerrit-CC: Mitsuru Oshima <osh...@chromium.org>
      Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
      Gerrit-Attention: Thomas Anderson <thomasa...@chromium.org>
      Gerrit-Comment-Date: Wed, 27 Aug 2025 03:55:16 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      open
      diffy

      Thomas Anderson (Gerrit)

      unread,
      Aug 27, 2025, 1:42:38 PM (12 days ago) Aug 27
      to Chromium LUCI CQ, Mitsuru Oshima, Avi Drissman, chromium...@chromium.org, Sadrul Chowdhury, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org

      Thomas Anderson added 1 comment

      File ui/aura/window_tree_host.cc
      Line 575, Patchset 9 (Latest): : display.GetColorSpaces());
      Mitsuru Oshima . resolved

      Hi, can you explain why this change is needed (and can't be done via display)? This creates another source of the truth about color space, which can be error prone.

      Thomas Anderson

      It must be per-surface and cannot go in display because on Wayland, clients don't get to know their global window coordinates, so the position is always treated as 0,0. So if you have 2 monitors side-by-side with the left HDR and the right SDR, no matter where the window is placed, it will think it's on the HDR monitor. So colors will be wrong if the window is on the SDR monitor. The solution is to handle a signal sent from the compositor, which is sent per-window, that indicates the desired color space.

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I5885feefb7534de9a3a86fdd2f7f9752c6e559a3
      Gerrit-Change-Number: 6868958
      Gerrit-PatchSet: 9
      Gerrit-Owner: Thomas Anderson <thomasa...@chromium.org>
      Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
      Gerrit-Reviewer: Thomas Anderson <thomasa...@chromium.org>
      Gerrit-CC: Mitsuru Oshima <osh...@chromium.org>
      Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
      Gerrit-Comment-Date: Wed, 27 Aug 2025 17:42:28 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Mitsuru Oshima <osh...@chromium.org>
      satisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages