fix: revive offscreen rendering support (#22160)
This commit is contained in:
parent
e28f7aadc7
commit
36f982aee2
10 changed files with 722 additions and 206 deletions
|
@ -17,11 +17,8 @@
|
|||
#include "base/process/kill.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "base/time/time.h"
|
||||
#include "components/viz/common/frame_sinks/begin_frame_args.h"
|
||||
#include "components/viz/common/frame_sinks/begin_frame_source.h"
|
||||
#include "components/viz/common/quads/compositor_frame.h"
|
||||
#include "components/viz/common/surfaces/parent_local_surface_id_allocator.h"
|
||||
#include "content/browser/frame_host/render_widget_host_view_guest.h" // nogncheck
|
||||
#include "content/browser/renderer_host/delegated_frame_host.h" // nogncheck
|
||||
#include "content/browser/renderer_host/input/mouse_wheel_phase_handler.h" // nogncheck
|
||||
#include "content/browser/renderer_host/render_widget_host_impl.h" // nogncheck
|
||||
|
@ -99,8 +96,6 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
|
|||
bool LockMouse(bool request_unadjusted_movement) override;
|
||||
void UnlockMouse(void) override;
|
||||
void TakeFallbackContentFrom(content::RenderWidgetHostView* view) override;
|
||||
void SetNeedsBeginFrames(bool needs_begin_frames) override;
|
||||
void SetWantsAnimateOnlyBeginFrames() override;
|
||||
#if defined(OS_MACOSX)
|
||||
void SetActive(bool active) override;
|
||||
void ShowDefinitionForSelection() override;
|
||||
|
@ -109,13 +104,6 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
|
|||
#endif // defined(OS_MACOSX)
|
||||
|
||||
// content::RenderWidgetHostViewBase:
|
||||
void DidCreateNewRendererCompositorFrameSink(
|
||||
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink)
|
||||
override;
|
||||
void SubmitCompositorFrame(
|
||||
const viz::LocalSurfaceId& local_surface_id,
|
||||
viz::CompositorFrame frame,
|
||||
base::Optional<viz::HitTestRegionList> hit_test_region_list) override;
|
||||
|
||||
void ResetFallbackToFirstNavigationSurface() override;
|
||||
void InitAsPopup(content::RenderWidgetHostView* rwhv,
|
||||
|
@ -134,8 +122,6 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
|
|||
const gfx::Size& output_size,
|
||||
base::OnceCallback<void(const SkBitmap&)> callback) override;
|
||||
void GetScreenInfo(content::ScreenInfo* results) override;
|
||||
void InitAsGuest(content::RenderWidgetHostView*,
|
||||
content::RenderWidgetHostViewGuest*) override;
|
||||
void TransformPointToRootSurface(gfx::PointF* point) override;
|
||||
gfx::Rect GetBoundsInRootWindow(void) override;
|
||||
viz::SurfaceId GetCurrentSurfaceId() const override;
|
||||
|
@ -167,9 +153,6 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
|
|||
|
||||
bool InstallTransparency();
|
||||
|
||||
void OnBeginFrameTimerTick();
|
||||
void SendBeginFrame(base::TimeTicks frame_time, base::TimeDelta vsync_period);
|
||||
|
||||
void CancelWidget();
|
||||
void AddGuestHostView(OffScreenRenderWidgetHostView* guest_host);
|
||||
void RemoveGuestHostView(OffScreenRenderWidgetHostView* guest_host);
|
||||
|
@ -230,7 +213,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
|
|||
void SetupFrameRate(bool force);
|
||||
void ResizeRootLayer(bool force);
|
||||
|
||||
viz::FrameSinkId AllocateFrameSinkId(bool is_guest_view_hack);
|
||||
viz::FrameSinkId AllocateFrameSinkId();
|
||||
|
||||
// Applies background color without notifying the RenderWidget about
|
||||
// opaqueness changes.
|
||||
|
@ -279,22 +262,14 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
|
|||
|
||||
std::unique_ptr<content::CursorManager> cursor_manager_;
|
||||
|
||||
std::unique_ptr<ElectronBeginFrameTimer> begin_frame_timer_;
|
||||
OffScreenHostDisplayClient* host_display_client_;
|
||||
std::unique_ptr<OffScreenVideoConsumer> video_consumer_;
|
||||
|
||||
// Provides |source_id| for BeginFrameArgs that we create.
|
||||
viz::StubBeginFrameSource begin_frame_source_;
|
||||
uint64_t begin_frame_number_ = viz::BeginFrameArgs::kStartingFrameNumber;
|
||||
|
||||
std::unique_ptr<ElectronDelegatedFrameHostClient>
|
||||
delegated_frame_host_client_;
|
||||
|
||||
content::MouseWheelPhaseHandler mouse_wheel_phase_handler_;
|
||||
|
||||
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink_ =
|
||||
nullptr;
|
||||
|
||||
// Latest capture sequence number which is incremented when the caller
|
||||
// requests surfaces be synchronized via
|
||||
// EnsureSurfaceSynchronizedForWebTest().
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue