diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2023-09-05 12:37:36 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2023-10-17 13:53:46 +0000 |
commit | 5a424f4a7b188b75da63eb697f63558af0b17f6f (patch) | |
tree | 54c427fcbc567dac8181ab5fd22d20e72cc51609 /chromium/cc/mojo_embedder/async_layer_tree_frame_sink.h | |
parent | acbcf08a6dffdfe90a6eaf661fcd6923f0de2447 (diff) |
BASELINE: Update Chromium to 116.0.5845.183
Change-Id: Iaaf57e02c218c93993a5044c659b63674e2c8a12
Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/512320
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/cc/mojo_embedder/async_layer_tree_frame_sink.h')
-rw-r--r-- | chromium/cc/mojo_embedder/async_layer_tree_frame_sink.h | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/chromium/cc/mojo_embedder/async_layer_tree_frame_sink.h b/chromium/cc/mojo_embedder/async_layer_tree_frame_sink.h index 6cdb257d495..7d471a8c6d5 100644 --- a/chromium/cc/mojo_embedder/async_layer_tree_frame_sink.h +++ b/chromium/cc/mojo_embedder/async_layer_tree_frame_sink.h @@ -17,19 +17,21 @@ #include "build/build_config.h" #include "cc/mojo_embedder/mojo_embedder_export.h" #include "cc/trees/layer_tree_frame_sink.h" -#include "components/power_scheduler/power_mode_voter.h" #include "components/viz/common/frame_sinks/begin_frame_source.h" #include "components/viz/common/frame_timing_details_map.h" -#include "components/viz/common/gpu/context_provider.h" +#include "components/viz/common/gpu/raster_context_provider.h" #include "components/viz/common/surfaces/parent_local_surface_id_allocator.h" #include "components/viz/common/surfaces/surface_id.h" +#include "gpu/ipc/client/client_shared_image_interface.h" #include "mojo/public/cpp/bindings/associated_remote.h" +#include "mojo/public/cpp/bindings/direct_receiver.h" #include "mojo/public/cpp/bindings/pending_associated_remote.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/viz/public/mojom/compositing/compositor_frame_sink.mojom.h" +#include "third_party/abseil-cpp/absl/types/variant.h" namespace cc { @@ -73,12 +75,21 @@ class CC_MOJO_EMBEDDER_EXPORT AsyncLayerTreeFrameSink UnboundMessagePipes pipes; bool wants_animate_only_begin_frames = false; base::PlatformThreadId io_thread_id = base::kInvalidThreadId; + base::PlatformThreadId main_thread_id = base::kInvalidThreadId; + + // If `true`, the CompositorFrameSinkClient receiver will receive IPC + // directly to the thread on which the AsyncLayerTreeFrameSink lives, rather + // than hopping through the I/O thread first. Only usable if the + // AsyncLayerTreeFrameSink lives on a thread which uses an IO message pump. + bool use_direct_client_receiver = false; }; - AsyncLayerTreeFrameSink(scoped_refptr<viz::ContextProvider> context_provider, - scoped_refptr<RasterContextProviderWrapper> - worker_context_provider_wrapper, - InitParams* params); + AsyncLayerTreeFrameSink( + scoped_refptr<viz::RasterContextProvider> context_provider, + scoped_refptr<RasterContextProviderWrapper> + worker_context_provider_wrapper, + std::unique_ptr<gpu::ClientSharedImageInterface> shared_image_interface, + InitParams* params); AsyncLayerTreeFrameSink(const AsyncLayerTreeFrameSink&) = delete; ~AsyncLayerTreeFrameSink() override; @@ -123,6 +134,7 @@ class CC_MOJO_EMBEDDER_EXPORT AsyncLayerTreeFrameSink void OnMojoConnectionError(uint32_t custom_reason, const std::string& description); + const bool use_direct_client_receiver_; bool begin_frames_paused_ = false; bool needs_begin_frames_ = false; viz::LocalSurfaceId local_surface_id_; @@ -130,6 +142,7 @@ class CC_MOJO_EMBEDDER_EXPORT AsyncLayerTreeFrameSink std::unique_ptr<viz::SyntheticBeginFrameSource> synthetic_begin_frame_source_; #if BUILDFLAG(IS_ANDROID) base::PlatformThreadId io_thread_id_; + base::PlatformThreadId main_thread_id_; #endif // Message pipes that will be bound when BindToClient() is called. @@ -143,7 +156,12 @@ class CC_MOJO_EMBEDDER_EXPORT AsyncLayerTreeFrameSink // point to message pipe we want to use. It must be declared last and cleared // first. raw_ptr<viz::mojom::CompositorFrameSink> compositor_frame_sink_ptr_ = nullptr; - mojo::Receiver<viz::mojom::CompositorFrameSinkClient> client_receiver_{this}; + + using ClientReceiver = mojo::Receiver<viz::mojom::CompositorFrameSinkClient>; + using DirectClientReceiver = + mojo::DirectReceiver<viz::mojom::CompositorFrameSinkClient>; + absl::variant<absl::monostate, ClientReceiver, DirectClientReceiver> + client_receiver_; THREAD_CHECKER(thread_checker_); const bool wants_animate_only_begin_frames_; @@ -154,8 +172,6 @@ class CC_MOJO_EMBEDDER_EXPORT AsyncLayerTreeFrameSink float last_submitted_device_scale_factor_ = 1.f; gfx::Size last_submitted_size_in_pixels_; - power_scheduler::FrameProductionPowerModeVoter power_mode_voter_; - base::WeakPtrFactory<AsyncLayerTreeFrameSink> weak_factory_{this}; }; |