Skip to content

Cherry pick PR #8962: cobalt: Move VideoGeometrySetterService on gpu thread#9284

Open
cobalt-github-releaser-bot wants to merge 1 commit into26.androidfrom
cherry-pick-26.android-8962
Open

Cherry pick PR #8962: cobalt: Move VideoGeometrySetterService on gpu thread#9284
cobalt-github-releaser-bot wants to merge 1 commit into26.androidfrom
cherry-pick-26.android-8962

Conversation

@cobalt-github-releaser-bot
Copy link
Collaborator

Refer to the original PR: #8962

Relocate the VideoGeometrySetterService from the browser process to
the GPU process. This change instantiates the service within the
CobaltContentGpuClient, allowing it to be managed directly on the GPU
thread.

This improves performance and reduces IPC overhead for video geometry
updates by co-locating the service closer to the GPU and compositing
operations. The StarboardRendererWrapper now directly subscribes to
video geometry changes from this local service.

Mojo communications:

  • Before: viz (gpu) --> browser thread --> StarboardRendererClient (media) --> StarboardRendererWrapper (gpu)
  • After: viz (gpu) --> StarboardRendererWrapper (gpu)

Note this is called nearly per UI frame update.

Issue: 405424096

@cobalt-github-releaser-bot
Copy link
Collaborator Author

MERGE CONFLICT CAT

Caution

There were merge conflicts while cherry picking! Check out cherry-pick-26.android-8962 and fix the conflicts before proceeding. Check the log at https://github.com/youtube/cobalt/actions/runs/22469574074 for details.

@github-actions
Copy link
Contributor

🤖 Gemini Suggested Commit Message


cobalt: Move VideoGeometrySetterService to GPU thread

Relocate the VideoGeometrySetterService from the browser process to
the GPU process. This change instantiates the service within the
CobaltContentGpuClient, allowing it to be managed directly on the GPU
thread.

This improves performance and reduces IPC overhead for video geometry
updates by co-locating the service closer to the GPU and compositing
operations. The StarboardRendererWrapper now directly subscribes to
video geometry changes from this local service, eliminating a
frequently used IPC hop through the browser process.

Bug: 405424096

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

@borongc borongc force-pushed the cherry-pick-26.android-8962 branch from d974f30 to 54e7ba8 Compare February 27, 2026 03:12
Relocate the VideoGeometrySetterService from the browser process to
the GPU process. This change instantiates the service within the
CobaltContentGpuClient, allowing it to be managed directly on the GPU
thread.

This improves performance and reduces IPC overhead for video geometry
updates by co-locating the service closer to the GPU and compositing
operations. The StarboardRendererWrapper now directly subscribes to
video geometry changes from this local service.

Mojo communications:
- Before: viz (gpu) --> browser thread --> StarboardRendererClient
(media) --> StarboardRendererWrapper (gpu)
- After: viz (gpu) --> StarboardRendererWrapper (gpu)

Note this is called nearly per UI frame update.

Issue: 405424096
(cherry picked from commit d1376b1)
@borongc borongc force-pushed the cherry-pick-26.android-8962 branch from 54e7ba8 to 5e9e7a5 Compare February 27, 2026 03:27
@borongc borongc marked this pull request as ready for review February 27, 2026 03:28
@borongc borongc requested review from a team as code owners February 27, 2026 03:28
@borongc borongc requested a review from oxve February 27, 2026 03:28
@borongc borongc removed the request for review from oxve February 27, 2026 03:28
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully relocates the VideoGeometrySetterService from the browser process to the GPU process, aligning with the goal of improving performance and reducing IPC overhead for video geometry updates. The changes involve removing the service from CobaltContentBrowserClient and integrating it into CobaltContentGpuClient and StarboardRendererWrapper. Dependencies and interfaces have been updated accordingly across various files. The overall approach seems sound and achieves the stated objective.

const gfx::RectF& rect_f,
gfx::OverlayTransform /* transform */) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
gfx::Rect new_bounds = gfx::ToNearestRect(rect_f);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The previous implementation in StarboardRendererClient::OnVideoGeometryChange used gfx::ToEnclosingRect (cobalt/renderer/cobalt_content_renderer_client.cc, line 291 in the LEFT side of the diff) to convert the floating-point rectangle to an integer rectangle. This change to gfx::ToNearestRect might subtly alter how video geometry is rounded. ToEnclosingRect ensures the entire float rectangle is contained, while ToNearestRect rounds to the closest integer rectangle, which could potentially clip a small portion of the video if the float rect is not perfectly centered. Please confirm if this change in rounding behavior is intentional and if it has been evaluated for any visual impact on video rendering.

Suggested change
gfx::Rect new_bounds = gfx::ToNearestRect(rect_f);
gfx::Rect new_bounds = gfx::ToEnclosingRect(rect_f);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants