0
Commit Graph

15524 Commits

Author SHA1 Message Date
c00a822079 viz: Set an explicit layer ID for RenderSurfaceImpl
This change makes it explicit that a layer ID of 0 valid, and sets a
unique id for RenderSurfaceImpl.

Bug: 324460866
Change-Id: Ib3ea70e9f375f49313ec103469b250e4eab0a14e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5912146
Commit-Queue: Michael Tang <tangm@microsoft.com>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1396195}
2024-12-13 13:49:23 -08:00
bedd1c4bca Fix find in page flicker for nine patch scrollbars
Sometimes when using the find in page feature, scrollbars will flicker
for a frame and then go back to normal. Please see the video in the
linked bug.

To repro somewhat consistently (easier to do in local builds):
1. Open a webpage with text.
2. While the page is still loading content, or the main thread is busy,
   use Ctrl+F and find some text.
3. You'll sometimes see the flicker shown in the video.
I've used this page repro: https://jsfiddle.net/nxd230st/
You might need to save the page into a local file to be able to see
the problem.

Root cause:
Scrollbars knowing they have tickmarks present and the paint
invalidation that happens from tickmarks appearing does not necessarily
happen in sync. It can happen that Scrollbar::HasTickmarks() returns
`true` *before* LayoutBox::InvalidatePaintForTickmarks() is called.
If this happens, the layer code will stop scaling scrollbars as 9patch
and present them as if the bitmap was the size of the scrollbar, which
causes the image to be stretched out (as seen on the video). Once the
paint invalidation happens, the scrollbars are re-painted to a bitmap
of an appropriate size and things go back to normal. Usually, this
desynchronization doesn't happen.

Fix:
9 patch scrollbars now re-paint scrollbars when the tickmark status
changes on the scrollbar, that way the values will never be internally
incoherent and we won't see the incorrect stretching of the smaller
bitmap.

Bug: 383174953
Change-Id: I916bff38f8d0b20fa86faf3dc9981fad68ee48ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6086899
Reviewed-by: Yaroslav Shalivskyy <yshalivskyy@microsoft.com>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Commit-Queue: Gaston Rodriguez <gastonr@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1396001}
2024-12-13 09:00:08 -08:00
f26649bc65 [cc/scheduler] Add a feature to throttle main frames to 60Hz
This CL adds a feature to allow decoupling BeginImplFrame() from
BeginMainFrame(). It works by not sending a BeginMainFrame() (but not
marking it as sent either) in the scheduler, on high refresh rate
clients.

Concretely, when the feature is enabled, no more than one BeginMainFrame
is sent per 1/60th of a second, which in practice means that impl-side
scrolling (even when blocked on main, i.e. with a non-passive observer)
and CSS animations work at 120fps, but main updates
(i.e. requestAnimationFrame()) happen at 60fps.

This patch works, but is not 100% complete, hence the feature is
disabled, though exercized with unit tests.

Change-Id: Iab0b0aad76ee4437b4ed7a39137fd88b1b5b8a7e
Bug: 379678455
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6054335
Commit-Queue: Benoit Lize <lizeb@chromium.org>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395984}
2024-12-13 08:31:17 -08:00
dc35b9ce37 [//cc] Rename VizLayers base::Feature to TreesInViz
Provide added clarity as to what this base::Feature is controlling.

Bug: 369883417
Change-Id: I605ef6a2eeed289a8c0009e7c536c733e8734e37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6087932
Reviewed-by: Victor Miura <vmiura@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395970}
2024-12-13 07:57:05 -08:00
2401803bc7 DrawVerticesOp: use SkVertices factory
Instead of copying data explicitly, use SkVertices::MakeCopy to ensure
index sanitization.

Bug: 379776579
Change-Id: I14cd2733cb3d465674036f66ee989c922d5a0ae4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6091689
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395445}
2024-12-12 08:46:52 -08:00
96ade0e5bc [//cc] Add FakeLayerContext and have FakeLayerTreeFrameSink use it
A step toward getting cc_unittests to pass with VizLayers enabled. In
particular, this change gets the TileManager unittests to pass. We will
of course fill in FakeLayerContext as tests show need.

Bug: 383270106
Change-Id: I1ddba6df9aa44159730799804df0281c700fa306
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6089707
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395443}
2024-12-12 08:45:16 -08:00
e0d403bc50 cc: add missing includes for the build with use_libcxx_modules
This is to fix build error when we set use_libcxx_modules=true in
chromium build.

Bug: 40440396
Change-Id: Iad5cc9a276da830f7c6b127aecc7a9dae0d62734
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6090672
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Stefan Zager <szager@chromium.org>
Reviewed-by: Stefan Zager <szager@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395266}
2024-12-11 21:39:49 -08:00
e1bdb14789 Reland "Enable DynamicSafeAreaInsetsSupportedByCC by default"
This reverts commit 572447f0eb.

Reason for revert: <Re-enable this feature after 6085305: Fix the CC position change with DynamicSafeAreaInsetsOnScroll enabled | https://chromium-review.googlesource.com/c/chromium/src/+/6085305>

Original change's description:
> Revert "Enable DynamicSafeAreaInsetsSupportedByCC by default"
>
> This reverts commit ebefd1079b.
>
> Reason for revert: <Will re-enable it after the code change of subtracting the offset with DynamicSafeAreaInsetsOnScroll on>
>
> Original change's description:
> > Enable DynamicSafeAreaInsetsSupportedByCC by default
> >
> > Bug: 373980016
> > Change-Id: Ia058d546279d885599acefa2ec60c834f7ff0e6c
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6085380
> > Auto-Submit: Maggie Chen <magchen@chromium.org>
> > Reviewed-by: Steve Kobes <skobes@chromium.org>
> > Commit-Queue: Steve Kobes <skobes@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#1394556}
>
> Bug: 373980016
> Change-Id: I483a719aa62af26e5633c939ce6ae4572d4701f3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6089650
> Auto-Submit: Maggie Chen <magchen@chromium.org>
> Reviewed-by: Steve Kobes <skobes@chromium.org>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Steve Kobes <skobes@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1394926}

Bug: 373980016
Change-Id: I876262bd97d02675c859638403d370e4e8c0a46f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6089763
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Reviewed-by: Victor Miura <vmiura@chromium.org>
Auto-Submit: Maggie Chen <magchen@chromium.org>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395175}
2024-12-11 16:33:11 -08:00
91423838c1 C++11 std::array rewrite for memory safety [12/19]
Split from:
https://chromium-review.googlesource.com/c/chromium/src/+/6004959/21

Generated patch
---------------
- Tool: ./tool/clang/spanify/rewrite-multiple-platform.sh
- Platform: Linux.
- Filter: This includes 2400/4222 patches. I included the std::array
      ones and excluded build errors.

Google announcement:
--------------------
https://groups.google.com/a/google.com/g/chrome-memory-safety/c/RMiO4gaVLQA/m/Yz-3NCObAgAJ

Benchmarks:
----------
See design doc and
https://chromium-review.googlesource.com/c/chromium/src/+/6004959/21

Description
-----------
The consensus during the memory safety summit was to begin rewriting
relevant C-style arrays to C++11 std::array. It can be done immediately,
offers better developer ergonomics, and fix large chunks of the
-Wunsafe-buffer-usage errors in Chrome.

To clarify, this effort is complementary to the longer plan work with
enabling -fsanitize=array-bounds, and we plan to leverage both,
especially for protecting 3p code.

[Attached] is a document detailing the rationale, benefits, and
considerations for potential compile-time and performance impacts.

[Attached]:https://docs.google.com/document/d/1z5aBDg26lHmNDjXRCysElWKx7E4PAJXqykI_k7ondJI/edit?tab=t.0#heading=h.cqgo7wvp0kzt

NO_IFTTT=No need to update base/debug/stack_trace.h

Bug: 378069401
Change-Id: I9a0271e4b45a2be44dfbb30e95d267745765b5fa
R: dcheng@chromium.org
AX-Relnotes: n/a.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6044118
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395060}
2024-12-11 13:06:30 -08:00
3fbbc57c60 Fix the CC position change with DynamicSafeAreaInsetsOnScroll enabled
Fix the CC position by correcting the transform matrix delta y for
feature DynamicSafeAreaInsetsSupportedByCC when
DynamicSafeAreaInsetsOnScroll on.

(Thanks to skobes@ for the fix on calculating SAIB.)

Bug: 373980016
Change-Id: Id5321adc526311cfe4bc8fa2847b6ccfa4c58f32
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6085305
Reviewed-by: Steve Kobes <skobes@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395041}
2024-12-11 12:32:19 -08:00
5ee1ae393f Cleanup test-only PaintCanvas::drawImageRect method
Change-Id: Ic393cb66eaa27a1cb43534e9d0fc503ddf36bfde
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6089631
Commit-Queue: Philip Rogers <pdr@chromium.org>
Auto-Submit: Philip Rogers <pdr@chromium.org>
Commit-Queue: Alex Mitra <alexmitra@chromium.org>
Reviewed-by: Alex Mitra <alexmitra@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395010}
2024-12-11 11:34:24 -08:00
572447f0eb Revert "Enable DynamicSafeAreaInsetsSupportedByCC by default"
This reverts commit ebefd1079b.

Reason for revert: <Will re-enable it after the code change of subtracting the offset with DynamicSafeAreaInsetsOnScroll on>

Original change's description:
> Enable DynamicSafeAreaInsetsSupportedByCC by default
>
> Bug: 373980016
> Change-Id: Ia058d546279d885599acefa2ec60c834f7ff0e6c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6085380
> Auto-Submit: Maggie Chen <magchen@chromium.org>
> Reviewed-by: Steve Kobes <skobes@chromium.org>
> Commit-Queue: Steve Kobes <skobes@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1394556}

Bug: 373980016
Change-Id: I483a719aa62af26e5633c939ce6ae4572d4701f3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6089650
Auto-Submit: Maggie Chen <magchen@chromium.org>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1394926}
2024-12-11 10:06:57 -08:00
d5d24e330f Reduce amount of log messages recorded during GPU resetart
The dbg bot was failing due to excessive amount of logs during
GPU restart. This CL reduces the amount of log by

1) Using GpuChannelHost::CrashGpuProcessForTestin to  doesn't print
   stack trace.
2) Not logging if CreateGpuMemoryBuffer fails when the gpu channel
   is not connected.

This CL also removes the dependecny to chrome/browser in the test,

Bug: 368538284

Change-Id: I3c43d68036f067a48dc14f8d08a8ee9abb51f007
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072549
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Jonathan Ross <jonross@chromium.org>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1394576}
2024-12-10 23:58:12 +00:00
ebefd1079b Enable DynamicSafeAreaInsetsSupportedByCC by default
Bug: 373980016
Change-Id: Ia058d546279d885599acefa2ec60c834f7ff0e6c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6085380
Auto-Submit: Maggie Chen <magchen@chromium.org>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Commit-Queue: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1394556}
2024-12-10 23:15:11 +00:00
b5fe35f3b9 Handle CC position change from safe_area_inset_bottom
(1) Add new composition flags for supporting SAI in CC.
  CompositingReason::kAffectedBySafeAreaBottom
  compositor_node.moved_by_safe_area_bottom
  transform_tree.nodes_affected_by_safe_area_inset_bottom
These flags are set according to
ComputedStyle::IsBottomRelativeToSafeAreaInset() in Blink.

(2) Plumb |moved_by_safe_area_bottom| and |nodes_affected_by_safe_area_inset_bottom| from Blink to CC.

(3) Calculate and apply the transform y adjustment in CC.

This new feature is put behind the feature flag DynamicSafeAreaInsetsSupportedByCC, and it's disabled by default.

Bug:373980016

Change-Id: I6f9bcd09020b3f1c65246cb4567fa82884a47d0d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6066002
Reviewed-by: Steve Kobes <skobes@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1394502}
2024-12-10 20:43:07 +00:00
1e46e6ea10 Reland "Fix scaling for 9-patch scrollbars."
This is a reland of commit 37855993b8
Added fuzziness to
tests and will queue bots for the broken test.
The issue that caused bots to fail is something unrelated to 9-patch
scaling, for some reason there are some shades of gray different
at the bottom of the scrollbars:
https://ci.chromium.org/ui/p/chromium/builders/ci/mac-skia-alt-arm64-rel-tests/5909/test-results?sortby=&groupby=

Original change's description:
> Fix scaling for 9-patch scrollbars.
>
> When pinch-zooming in a subscroller that is being rendered with nine-
> patch scrolling the track shows strange behavior. In official builds
> the rendering of the thumb and arrows gets distorted and in local
> builds it is clear that the scrollbar's track and buttons are not
> being scaled.
>
> The root causes for this bug were:
> 1. The patch generator was not being passed the scaled rect by the layer
>    code, it was only being given the layer's dimensions.
> 2. The track's bitmap wasn't being repainted when scaled, which in the
>    best case scenario caused the arrows to look blurry, and in the worst
>    it caused the rendering to be completely wrong.
> 3. The aperture wasn't being scaled to consider the bitmap's scaled
>    dimensions, which caused scaled scrollbars to be rendered
>    incorrectly.
>
> This CL:
> 1. Adds a new condition for the scrollbars to be re-painted whenever the
>    layer's internal scale changes.
> 2. Refactors the ScrollbarTheme 9patch-Canvas and 9patch-Aperture code
>    to consider the scale of the layer and return the correct sized
>    values.
> 3. Adds web and unittests to cover the new behavior.
>
> Bug: 378027651
> Change-Id: Ie467ecc8139e2a6b03d5d073ac2c860bf2cd571d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6013524
> Commit-Queue: Gaston Rodriguez <gastonr@microsoft.com>
> Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
> Reviewed-by: Yaroslav Shalivskyy <yshalivskyy@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#1385971}

Bug: 378027651
Change-Id: I57eb380aeb84596083c6db966d7b71eb10d20f68
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6081995
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Gaston Rodriguez <gastonr@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1394355}
2024-12-10 16:59:57 +00:00
44abd23cfe cc: Ensure target render surfaces are added if surfaces require them.
This ensures that if a surface has a CopyOutputRequest, its chain of
target surfaces is also not skipped.

R=nrosenthal@chromium.org

Bug: 382757456
Change-Id: Ia0e0d01708979bdfb8ffed361f8ddda8d8242381
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6081972
Commit-Queue: Vladimir Levin <vmpstr@chromium.org>
Reviewed-by: Noam Rosenthal <nrosenthal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1393935}
2024-12-09 22:41:14 +00:00
f5c74d4526 Add use counter for touch action handwriting keyword
This CL adds a Blink use counter that gets fired when a web page has an
element whose computed style for the touch-action css attribute would
disable handwriting for the element if the handwriting keyword were
implemented.

Handwriting would be disabled when touch-action is specified with any
keyword other than `auto` or `manipulation`. The use counter will be
fired when any other keyword[1] is specified, excepting when
touch-action is declared with the `none` keyword in which case
handwriting would be disabled but that would be by design.


For more context on the cause of this use counter, please see the linked
bug.

[1] https://w3c.github.io/pointerevents/#dfn-touch-action-values

Bug: 378027646
Change-Id: I88e9c1641490382cc8477cb59e97ae671c680ea9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6005047
Reviewed-by: Adam Ettenberger <Adam.Ettenberger@microsoft.com>
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: Gaston Rodriguez <gastonr@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1393914}
2024-12-09 22:07:28 +00:00
3738e1b752 Fix UB introduced in crrev.com/c/6075415.
I failed to realize that the existing redundant-looking comparison was
actually a subtle overflow check. Reintroduce it in a modified form.

Bug: 382554728
Change-Id: I10fc9bebd1ea2f4987aaf36d815a99cd81a5799f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6078697
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1393733}
2024-12-09 17:35:19 +00:00
b559d592ea [gardener] Revert "Fix scaling for 9-patch scrollbars."
This reverts commit 37855993b8.

Reason for revert: Consistent mac-skia-alt-arm64-rel-tests failures after this CL: https://ci.chromium.org/ui/p/chromium/builders/luci.chromium.ci/mac-skia-alt-arm64-rel-tests?limit=1500
First failure: https://ci.chromium.org/ui/p/chromium/builders/ci/mac-skia-alt-arm64-rel-tests/5143/blamelist

Original change's description:
> Fix scaling for 9-patch scrollbars.
>
> When pinch-zooming in a subscroller that is being rendered with nine-
> patch scrolling the track shows strange behavior. In official builds
> the rendering of the thumb and arrows gets distorted and in local
> builds it is clear that the scrollbar's track and buttons are not
> being scaled.
>
> The root causes for this bug were:
> 1. The patch generator was not being passed the scaled rect by the layer
>    code, it was only being given the layer's dimensions.
> 2. The track's bitmap wasn't being repainted when scaled, which in the
>    best case scenario caused the arrows to look blurry, and in the worst
>    it caused the rendering to be completely wrong.
> 3. The aperture wasn't being scaled to consider the bitmap's scaled
>    dimensions, which caused scaled scrollbars to be rendered
>    incorrectly.
>
> This CL:
> 1. Adds a new condition for the scrollbars to be re-painted whenever the
>    layer's internal scale changes.
> 2. Refactors the ScrollbarTheme 9patch-Canvas and 9patch-Aperture code
>    to consider the scale of the layer and return the correct sized
>    values.
> 3. Adds web and unittests to cover the new behavior.
>
> Bug: 378027651
> Change-Id: Ie467ecc8139e2a6b03d5d073ac2c860bf2cd571d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6013524
> Commit-Queue: Gaston Rodriguez <gastonr@microsoft.com>
> Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
> Reviewed-by: Yaroslav Shalivskyy <yshalivskyy@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#1385971}

Bug: 378027651
Change-Id: I2366ec186c5be88ed7580ae526f93cd3d3a6c9e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6079956
Owners-Override: Sergey Poromov <poromov@chromium.org>
Reviewed-by: Fahad Mansoor <fahadmansoor@google.com>
Auto-Submit: Sergey Poromov <poromov@chromium.org>
Commit-Queue: Fahad Mansoor <fahadmansoor@google.com>
Cr-Commit-Position: refs/heads/main@{#1393595}
2024-12-09 12:10:56 +00:00
84dd7f5c87 Revert "Fix performance regression on ChartJS"
This reverts commit f412079bd8.

Reason for revert: This patch fixes the 1% regression on Mac and causes the 6% regression on Windows, so it's better to use DrawOval instead of drawPath.

Original change's description:
> Fix performance regression on ChartJS
>
> Using drawArc instead of drawOval for closed circle to improve
> performance on ChartJS.
>
> Bug: 371233772
>
> Change-Id: Ie5eb75342ec85e2fbeb5ab3ecae2212a504ae02a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5962321
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Yi Xu <yiyix@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1381356}

Bug: 371233772
Change-Id: I1b993d6b80bb2429a5289536bf4e478243cb0d37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6077785
Commit-Queue: Yi Xu <yiyix@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1393472}
2024-12-09 00:30:46 +00:00
a5027748e8 Add tracing events for important scroll-related Mojo messages
This CL adds new tracing events that correspond to the following Mojo
messages being sent:

* blink.mojom.WidgetInputHandler::DispatchEvent from the browser main
  thread to a renderer's compositor
* viz.mojom.BeginFrameObserver::OnStandaloneBeginFrame from Viz to the
  browser main thread (for flings)
* viz.mojom.CompositorFrameSinkClient::OnBeginFrame from Viz to a
  renderer's compositor
* viz.mojom.CompositorFrameSink::SubmitCompositorFrame from a renderer's
  compositor to Viz

PERFETTO_TESTS=`autoninja -C out/Default perfetto_diff_tests && out/Default/bin/run_perfetto_diff_tests`

Bug: 374100154
Change-Id: Iecddea6e7cb65f30026dc7a85f8c4d81ffd687b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6049015
Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Commit-Queue: Petr Cermak <petrcermak@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1393202}
2024-12-06 22:44:00 +00:00
4a6de15201 Rename SharedImageUsage.
Rename SharedImageUsage SHARED_IMAGE_USAGE_CPU_WRITE to
SHARED_IMAGE_USAGE_CPU_WRITE_ONLY in order to clarify the intent that
this usage is only meant for write only and not read.

This was required as all the other WRITE usages we have also implies
READ as well.

This CL is a no-op and strictly just a rename.

Bug: 40264379
Change-Id: I7e7a4e5102ad422d1b73b9cf02751c6944cfa12e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6071632
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Kramer Ge <fangzhoug@chromium.org>
Commit-Queue: vikas soni <vikassoni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1393191}
2024-12-06 22:25:26 +00:00
821da9108f metal::HDRCopierLayer: Re-draw on HDR headroom changes
When the metal::HDRCopierLayer is performing its own tone mapping it
needs to re-draw every time that the HDR headroom changes. To ensure
this happens
- make cc::SurfaceLayer::RequiresSetNeedsDisplayOnHdrHeadroomChange
  return true (because it may be the cc::LayerTree representation of
  the content)
- ensure LayerTreeHost::SetDisplayColorSpaces calls SetNeedsCommit
- make -[HDRCopierLayer setHDRContents] re-draw when the HDR headroom
  changes (but only if it is down its own tone mapping)

While in the area, fix the tone mapping math to clamp the gain weight
to [0, 1].

Bug: 343249142
Change-Id: Ic8e6151ceca8e8342df30d2a381e368c57fe329e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6074481
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: ccameron chromium <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1393130}
2024-12-06 20:57:11 +00:00
dc5340357e Safe vector reading/writing for paint ops/paths.
Checking `std::is_trivially_copyable_v<>` on the element type is not
sufficient; that may leave padding bytes we don't want to serialize.

Always using per-element writing avoids span having to discern whether
this might be a safe usage of those intervening padding bytes.

Also adjusts the touched APIs to use refs instead of pointers to comply
with the current style guide and be more obviously non-null-expecting.

Bug: 382041497
Change-Id: I286dcfff63e99d42a3e2e7f3e29961d083af28dd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6075415
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1393120}
2024-12-06 20:42:18 +00:00
89805e1737 cc/viz: Propagate DynamicRangeLimit
Propagate cc::LayerImpl's DynamicRangeLimit to viz::TextureDrawQuad.

Propagate viz::TextureDrawQuad's DynamicRangeLimit over mojo.

In surface aggregator, overwrite viz::TextureDrawQuad's
DynamicRangeLimit if the viz::TextureDrawQuad comes from a
cc::SurfaceLayer that has override flags set.

In viz::SkiaRenderer::GetColorSpaceConversionFilter, use the
DynamicRangeLimit to limit the headroom for drawing.

Move the computation of effective HDR headroom out from the static
helper ComputeHdrHeadroom in PaintOpReader to a member function on
cc::PaintFlags::DynamicRangeLimitMixture.

Bug: 40277822
Change-Id: If64b045f76b24ff9e7dc2b89cc426891c84101f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6068767
Commit-Queue: ccameron chromium <ccameron@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Fernando Serboncini <fserb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1392812}
2024-12-06 11:10:51 +00:00
bfb79529a1 [RasterInducingScroll] Let discardable image map not depend on scroll offset
Previously we regenerated discardable image map on raster-inducing
scroll, but a removed paint worklet (scrolled out of view) might be
still running, and OnPaintWorkletResultsReady() for the worklet
would find inconsistent data structure which caused crash.

Now let the discardable image map not depend on scroll offset. We
collect all images under a DrawScrollingContentsOp, and use the
rect of the op as the image rects. The result is basically the same
as that of composited scrollers. This reduce the amount of work
on scroll, and make the logic simpler and less error-prone.

Bug: 379297064
Change-Id: Idf3384da4a0cf1c20994a47cc055ba41e9c28d31
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6067991
Commit-Queue: Philip Rogers <pdr@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1392574}
2024-12-05 22:19:43 +00:00
ad426e5a71 Update max_safe_area_insets in Blink Page
(1) Scale max_safe_area_insets by the device scale factor in Blink
and pass this scaled insets to CC.
(2) Change the max_safe_area_insets to the float type gfx::InsetsF
(3) In CC, store |max_safe_area_insets| in LayerTreeImpl (the pending
tree and the active tree). It's no longer stored in
LayerTreeHostImpl since |max_safe_area_insets| could change after a new device scale factor .

Bug: 373980016
Change-Id: I05dabead96c9748c130019b51cb0b8cc748e719e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6068811
Commit-Queue: Maggie Chen <magchen@chromium.org>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1392466}
2024-12-05 19:48:35 +00:00
2e74a131b8 [InputVizard] Implement
RenderInputRouterSupportBase::GetVisibleViewportSize.

This CL adds 'visible_viewport_size' field to CompositorFrameMetadata
mojo struct to allow Viz to receive the visible viewport size as
calculated in RenderWidgetHostViewAndroid::GetVisibleViewportSize [1].
This CL uses InnerViewportScrollNode's container bounds in
LayerTreeHostImpl since it denotes visual scroll layers [2]. This is
used by FlingController implementation to create a fling curve in Viz,
see [3].

[1]:
https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/render_widget_host_view_android.cc;l=1196;drc=30ae5d527dd8718477b6cac5a9f7fec713d6e3ec
[2]:
https://source.chromium.org/chromium/chromium/src/+/main:cc/layers/viewport.h;l=21;drc=981ce1e8f82050b33153a9c4652f2ad1cefabff1
[3]:
https://source.chromium.org/chromium/chromium/src/+/main:components/input/fling_controller.cc;l=426-434;drc=a04e2f2e67fd2dcaf1d577c9179511420fe16b01

Bug: b:374119530
Change-Id: I2d977c8a4092b50b878d9a10827a41ed1752c53f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6058412
Reviewed-by: Kyle Charbonneau <kylechar@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Aman Verma <amanvr@google.com>
Cr-Commit-Position: refs/heads/main@{#1392167}
2024-12-05 11:06:01 +00:00
fe7eb63751 Style: Fix array initializations with size mismatches [8/8] #cleanup
Split 8/8 from:
https://chromium-review.googlesource.com/c/chromium/src/+/6055399

This patch addresses inconsistencies in array initialization where the
declared array size does not match the number of elements provided in
the initializer list. This can lead to confusion and potential errors,
as the remaining elements are implicitly initialized to zero. For
example, initializing with = {2} might mislead developers into thinking
the entire array is filled with 2s, when in fact only the first element
is assigned that value.
https://godbolt.org/z/4sbd9nreT

The changes ensure that:
- Array sizes accurately reflect the number of elements being explicitly
  initialized.
- Zero-initialization is explicitly expressed using {} when intended.

This improves code clarity and maintainability by making the
initialization intent clear and consistent.

This change also aims to allow the std::array rewriter to "crash" when
encountering a mismatching size where it would be difficult to rewrite.
Not having any occurrences of this pattern in the codebase will avoid the issue.

Bug: 356643982
Change-Id: Ie2df5a02a5a2e96a117b5ae4bc86df2b031da972
AX-Relnotes: n/a.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6063246
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1391754}
2024-12-04 18:03:47 +00:00
cd75d25321 cc: Remove old flag AnimatedImageRemove
R=khushalsagar@chromium.org

Bug: 356235394
Change-Id: I34f0ef2dc15ea41f63f12a2291c65c8d10f32254
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6064440
Commit-Queue: Vladimir Levin <vmpstr@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1391659}
2024-12-04 15:19:07 +00:00
2f7c1003b0 Better type use/const correctness for rtree.
No functional change, just cleanup/reformatting.

Bug: none
Change-Id: I21d5eaa21814eea41205065eb6a22154e806735a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6060898
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1391090}
2024-12-03 17:58:25 +00:00
7c1cf08f39 Remove unused canvas when collecting discardable images from draw record shader
The canvas has not been used since crrev.com/1289572 (M126), which was
a mistake, but we haven't found any bug since then. The differences
between the original canvas and this canvas are
1. The original canvas has clips from previous paint ops;
2. The original canvas has transforms from previous paint ops, while
   this canvas only has the scale components.

We won't use the previous clips and transforms to map op_rect [1].
The ctm will be passed to DrawImage which affects:
- DrawImage::matrix_is_decomposable(), which can be different with the
  different canvases, but it doesn't look incorrect to determine the
  filter quality based on the total ctm instead of the ctm under the
  shader.
- DrawImage::scale(), which should be the same.

[1] https://source.chromium.org/chromium/chromium/src/+/main:cc/paint/discardable_image_map.cc;drc=0eb474d6793456826037bf33212ccba9da236402;l=102

Change-Id: I9dbfc88b9ee02771b5884f1cdcfc092b188aa41b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6065362
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1391068}
2024-12-03 17:34:45 +00:00
1661c5506a [CodeHealth] Spanify WriteData in paint_op_writer.cc
Fixed: 326458765
Change-Id: If3e04cbd1a579f2a0f1bfbce34ae2b9cce9f0c54
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5596530
Commit-Queue: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Victor Miura <vmiura@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1391002}
2024-12-03 15:28:42 +00:00
3afb5d4033 Revert previously deleted underscores
The following commits are involved:

http://crrev.com/c/chromium/src/+/6038453
http://crrev.com/c/chromium/src/+/6031409
http://crrev.com/c/chromium/src/+/5981525
http://crrev.com/c/chromium/src/+/5992954

Reason: https://groups.google.com/a/chromium.org/g/chromium-dev/c/KxzyXKv7adQ

Based on the discussion here, I have decided to terminate this work.

Bug: 377144451
Change-Id: I96030026d559656c7e044c94517d918e6b8508e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6061839
Reviewed-by: Zijie He <zijiehe@google.com>
Commit-Queue: Ho Cheung <hocheung@chromium.org>
Reviewed-by: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: Kyle Charbonneau <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390697}
2024-12-03 00:19:42 +00:00
20425f7afe Fix "see image_transfer_cache_entry.cc" in paint_op_writer.h
Change-Id: I6272eeb8e6a71a1aecd90ffca3f76a4648e62911
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6064578
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Auto-Submit: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390555}
2024-12-02 20:44:48 +00:00
4270363a2d cc::SurfaceLayer: Add interface to propagate cc::PaintFlags to children
Add a parameter on cc::SurfaceLayer to cause the viz::SurfaceDrawQuad::
override_child_filter_quality and override_child_dynamic_range_limit
properties to be set.

The next change will call this in blink::SurfaceLayerBridge.

This is incidental clean-up being done while implementing the
dynamic-range-limit CSS property.

Bug: 40277822, 380896841
Change-Id: I48c02d80f5281382f0927681608c2ad2630df039
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6049749
Commit-Queue: ccameron chromium <ccameron@chromium.org>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1389719}
2024-11-29 11:06:08 +00:00
aebe9d1b30 viz::SurfaceDrawQuad: Add parameters to override child paint flags
Videos and canvases have their own viz::Surface. This means that instead
of the cc::LayerTree emitting the viz::DrawQuad for the content, the
cc::LayerTree has a cc::SurfaceLayer, which emits a
viz::SurfaceDrawQuad, which refers to a viz::DrawQuad which is
submitted to a separate frame sink.

As a consequence of this architecture, the cc::Layer that knows the
cc::PaintFlags::FilterQuality and cc::PaintFlags::DynamicRangeLimit
is the cc::SurfaceLayer, which has no direct way to propagate those
parameters to the viz::TextureDrawQuad that will need to use them
(because that quad is submitted to the separate frame sink).

These cc::PaintFlags are propagated via various unreliable methods,
and as a result there are bugs (e.g, when they are changed on an
offscreen canvas, they have no effect until the canvas updates its
contents), and lots of complexity.

This architectural choice is one of many expedient hacks done to work
around the inefficiency of the cc::LayerTree implementation.

Add a mechanism whereby the cc::SurfaceLayer will be able to
propagate these parameters down to their child layers. To do this:
* For cc::PaintFlags::FilterQuality and DynamicRangeLimit, add new
  mojom interfaces.
* To viz::SurfaceDrawQuad, add optional override_child_filter_quality
  and override_child_dynamic_range_limit.
* In SurfaceAggregator::EmitSurfaceContent, propagate these parameters
  from to viz::SurfaceAggregator::CopyQuadsToPass.
* In viz::SurfaceAggregator::CopyQuadsToPass, if these parameters are
  present, use them to override viz::TextureDrawQuad::nearest_neighbor.

Add several tests for the new viz::SurfaceAggregator behavior, and for
the new mojo serialization.

This is not actually used anywhere except for several new unit tests.
The next patch will propagate this back through viz::SurfaceLayer to
blink.

This is incidental clean-up being done while implementing the
dynamic-range-limit CSS property.

Bug: 40277822, 380896841
Change-Id: I4f822849c31dffb45ffcb373aaee30331b879696
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6049919
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: ccameron chromium <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1389689}
2024-11-29 09:29:33 +00:00
97af2fe4d4 Remove usage of base::make_span(): cc/
Replace with span() CTAD use, or more targeted helpers.

Bug: 341907909
Change-Id: Ic0616121082ff224dfd941b750a57d717c9b6e15
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6058371
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1389518}
2024-11-28 19:37:04 +00:00
bcbbbc4030 Temporarily silence more -Wunsafe-buffer-usage warnings.
Trunk Clang now warns on constructors when -Wunsafe-buffer-usage is
turned on. Temporarily adding allow_unsafe_buffers pragma in few files
so they can be compiled to trunk clang. Once the clang changes are
rolled in (crbug.com/375635728), the code owners should consider
removing the pragma and fixing those warning instances.

Bug: 377326291
Change-Id: I07fe41cd86af29501c07cc20ecd790a85c760f15
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6054357
Reviewed-by: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Auto-Submit: Hans Wennborg <hans@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1389412}
2024-11-28 15:19:44 +00:00
890cc838a0 Remove impulse scroll animation curve and WSP feature
The CL removes remaining references to Windows Scrolling Personality
features - percent-based scrolling and impulse scroll animation.

I reverted the WSP-related changes to track-scroll.html web test made
in the CL [1]. The test fails on Mac due to the bug: crbug.com/40701909,
so I temporarily disabled it.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/2612518

Bug: 359747082
Change-Id: I1efd57bcd12a375c5d6d5add8e315037b0502e6a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6040435
Reviewed-by: Peter Boström <pbos@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: Yaroslav Shalivskyy <yshalivskyy@microsoft.com>
Reviewed-by: Olga Gerchikov <gerchiko@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1388551}
2024-11-27 00:17:50 +00:00
1a9374dc01 Fix more cc unsafe buffer usage
These usages just required converting C style array to std::array.

Bug: 40285824
Change-Id: I728f9d76fdc1f51805461a3d9c40ea1cec290f80
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6018828
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Kyle Charbonneau <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1388494}
2024-11-26 22:19:23 +00:00
4cde7cea05 Plumb MaxSafeAreaInsets from blink to cc
Bug:373980016

Change-Id: Ie870ca288d967bbfea13d27257c9622e1367c39b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6028230
Reviewed-by: Steve Kobes <skobes@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1388269}
2024-11-26 16:26:32 +00:00
c48b1dd240 Move TransferableResource::origin setting to TextureLayer users
There are exactly four use-cases that create layer with flipped = true:
* DrawingBuffer, flip depends on composition and MESA_framebuffer_flip
* ImageLayerBridge: This used to update flip for each resource
* PepperPluginInstanceImpl for Graphics3D case. This is the only case
  which uses SetTransferableResource instead of TextureClient
* TestPlugin: Always uses bottom-left.

This CL makes TransferableResource adjustment right the place where
we pass it to TextureLayer, to make sure it's no-op.

Follow-up will push them closer to place where we create the resource.

This allows to remove flip from TextureLayer entirely.

Bug: 378688985
Change-Id: Ide4b81711db84ecb469bf3ee3731ec3e055489fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6039385
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Kyle Charbonneau <kylechar@chromium.org>
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1388225}
2024-11-26 15:02:01 +00:00
8860090413 Pass flipped to TextureLayer ctor
TextureLayer was flipped by default, but most production use-cases
would call SetFlipped right after that. This CL adds param to ctor to
avoid default value.

It also updates all unit tests that don't care about flipped to pass
false.

Bug: 378688985
Change-Id: I33235d0970bc023155ae9bb70c591c7f4239aa0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6039088
Reviewed-by: Kyle Charbonneau <kylechar@chromium.org>
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1388200}
2024-11-26 14:02:29 +00:00
5331692b47 Remove the feature flag kMediaSharedBitmapToSharedImage
kMediaSharedBitmapToSharedImage has been enabled by default since M124

SharedBitmapReporter and SharedBitmapId are removed from
SoftwarePlaneResource. They are no longer used after converting media
SharedBitmap to SharedImage.

Bug: 40064122
Change-Id: Id22fd38bf2a48cba2fced33082ad0a29cd683983
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6044504
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1388006}
2024-11-26 03:03:33 +00:00
29bb017b9a CSS image-rendering: Move FilterQuality to base cc::Layer
The CSS image-rendering property determines the cc::FilterQuality
to use when rendering an image. When blink renders an image, it
stores the cc::FilterQuality in blink::ScopedImageRenderingSettings
(this structure also includes DyanmicRangeLimit -- more on that later).

When viz renders an image or a canvas, this property is set on the
cc::TextureLayer. But not quite. We actually just set a boolean
for "nearest neighbor". This property is already present on
NinePatchLayer and TextureLayer, but will also be needed for
VideoLayer and SurfaceLayer.

Remove the various sub-class booleans and replace them with a
member in the base class' cc::Layer::RareInputs. Plumb the
DynamicRangeLimitMixture through the same path.

Ensure that both of these properties cause a commit when changed
(and add tests for this).

Bug: 40277822
Change-Id: I4b702ce52e210e6ebd78e22d3425d8b728f5df6c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6000365
Reviewed-by: ccameron chromium <ccameron@chromium.org>
Reviewed-by: Fernando Serboncini <fserb@chromium.org>
Commit-Queue: ccameron chromium <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1387523}
2024-11-25 11:24:20 +00:00
abac128e25 Nit: Spell out fcp i.e FirstContentfulPaint in DroppedFrameCounter
This CL also fixes a typo of `DroppedFrameCounter::EnableReporForUI()`
and removes a default variable for a virtual method.

Change-Id: Ia8155bc5b98c1a02d52a200bd824d3a60b222db7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6043148
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Zoraiz Naeem <zoraiznaeem@chromium.org>
Commit-Queue: Zoraiz Naeem <zoraiznaeem@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1387321}
2024-11-24 05:41:29 +00:00
a1b139e0d7 Nit: Remove constructor for FrameSequenceMetrics::CustomReportData
As we add more data to the struct, it becomes challenging and messy
to maintain the constructor.

Change-Id: I950435c0c251b38e8c125abb13516dc7a2755d70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6039507
Commit-Queue: Zoraiz Naeem <zoraiznaeem@chromium.org>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1387188}
2024-11-23 01:27:01 +00:00
48de4863fa [Part 2] Rename ThroughputTracker to CompositorMetricsTracker
ThroughputTracker can track any compositor metrics over a sequence of
time. It current name reflect its usage to collect smoothness related
metrics. However, we want to use mechanism to track other metrics
(paint) as well. The naming convention should reflect this
genericness.

In crrev.com/c/6040362, we did renaming in ui/compositor and ash/
directories. In this CL, we are renaming cc/ and blink/ directories. (mostly)

Bug: b:380318532
Change-Id: I71e60a3312d30224b77fa51dbf04ebbc55837f3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6042895
Commit-Queue: Zoraiz Naeem <zoraiznaeem@chromium.org>
Reviewed-by: Stefan Zager <szager@chromium.org>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1387187}
2024-11-23 01:26:07 +00:00