0

Remove SharedBitmapReporter

This class is no longer needed after converting SharedBitmap to SharedImage

Bug: 40064122
Change-Id: I44a154c2bb28f24e56d19c17525b5c1ba8610912
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6164986
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1406242}
This commit is contained in:
Maggie Chen
2025-01-14 11:16:57 -08:00
committed by Chromium LUCI CQ
parent 7e9102d244
commit d3ce06663f
39 changed files with 2 additions and 338 deletions

@ -34,13 +34,6 @@ void TestLayerTreeFrameSink::DidNotProduceFrame(const viz::BeginFrameAck& ack,
latest_frame_skipped_reason_ = reason;
}
void TestLayerTreeFrameSink::DidAllocateSharedBitmap(
base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) {}
void TestLayerTreeFrameSink::DidDeleteSharedBitmap(
const viz::SharedBitmapId& id) {}
void TestLayerTreeFrameSink::GetFrameResourcesToReturn(
std::vector<viz::ReturnedResource>& return_resources) {
for (auto resource : resources_in_use_) {

@ -46,9 +46,6 @@ class TestLayerTreeFrameSink : public cc::LayerTreeFrameSink {
bool hit_test_data_changed) override;
void DidNotProduceFrame(const viz::BeginFrameAck& ack,
cc::FrameSkippedReason reason) override;
void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) override;
void DidDeleteSharedBitmap(const viz::SharedBitmapId& id) override;
private:
std::vector<viz::TransferableResource> resources_in_use_;

@ -290,19 +290,6 @@ std::unique_ptr<LayerContext> AsyncLayerTreeFrameSink::CreateLayerContext(
host_impl);
}
void AsyncLayerTreeFrameSink::DidAllocateSharedBitmap(
base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) {
DCHECK(compositor_frame_sink_ptr_);
compositor_frame_sink_ptr_->DidAllocateSharedBitmap(std::move(region), id);
}
void AsyncLayerTreeFrameSink::DidDeleteSharedBitmap(
const viz::SharedBitmapId& id) {
DCHECK(compositor_frame_sink_ptr_);
compositor_frame_sink_ptr_->DidDeleteSharedBitmap(id);
}
void AsyncLayerTreeFrameSink::DidReceiveCompositorFrameAck(
std::vector<viz::ReturnedResource> resources) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);

@ -141,9 +141,6 @@ class CC_MOJO_EMBEDDER_EXPORT AsyncLayerTreeFrameSink
FrameSkippedReason reason) override;
std::unique_ptr<LayerContext> CreateLayerContext(
LayerTreeHostImpl& host_impl) override;
void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) override;
void DidDeleteSharedBitmap(const viz::SharedBitmapId& id) override;
const viz::HitTestRegionList& get_last_hit_test_data_for_testing() const {
return last_hit_test_data_;

@ -47,9 +47,6 @@ class TestFrameSinkImpl::TestMojoCompositorFrameSink
void DidNotProduceFrame(const viz::BeginFrameAck& ack) override {
did_not_produce_frame_ = true;
}
void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) override {}
void DidDeleteSharedBitmap(const viz::SharedBitmapId& id) override {}
void InitializeCompositorFrameSinkType(
viz::mojom::CompositorFrameSinkType type) override {}
void BindLayerContext(viz::mojom::PendingLayerContextPtr context) override {}

@ -106,19 +106,6 @@ std::unique_ptr<LayerContext> FakeLayerTreeFrameSink::CreateLayerContext(
return std::make_unique<FakeLayerContext>();
}
void FakeLayerTreeFrameSink::DidAllocateSharedBitmap(
base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) {
DCHECK(!base::Contains(shared_bitmaps_, id));
shared_bitmaps_.push_back(id);
}
void FakeLayerTreeFrameSink::DidDeleteSharedBitmap(
const viz::SharedBitmapId& id) {
DCHECK(base::Contains(shared_bitmaps_, id));
std::erase(shared_bitmaps_, id);
}
void FakeLayerTreeFrameSink::DidReceiveCompositorFrameAck() {
client_->DidReceiveCompositorFrameAck();
}

@ -102,9 +102,6 @@ class FakeLayerTreeFrameSink : public LayerTreeFrameSink {
FrameSkippedReason reason) override;
std::unique_ptr<LayerContext> CreateLayerContext(
LayerTreeHostImpl& host_impl) override;
void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) override;
void DidDeleteSharedBitmap(const viz::SharedBitmapId& id) override;
viz::CompositorFrame* last_sent_frame() { return last_sent_frame_.get(); }
size_t num_sent_frames() { return num_sent_frames_; }
@ -117,10 +114,6 @@ class FakeLayerTreeFrameSink : public LayerTreeFrameSink {
gfx::Rect last_swap_rect() const { return last_swap_rect_; }
const std::vector<viz::SharedBitmapId>& shared_bitmaps() const {
return shared_bitmaps_;
}
void ReturnResourcesHeldByParent();
// A BeginFrame request usually comes with the frames that have been
@ -136,7 +129,6 @@ class FakeLayerTreeFrameSink : public LayerTreeFrameSink {
gpu::TestGpuMemoryBufferManager test_gpu_memory_buffer_manager_;
std::vector<viz::SharedBitmapId> shared_bitmaps_;
std::unique_ptr<viz::CompositorFrame> last_sent_frame_;
size_t num_sent_frames_ = 0;
std::vector<viz::TransferableResource> resources_held_by_parent_;

@ -265,15 +265,6 @@ void TestLayerTreeFrameSink::DidNotProduceFrame(const viz::BeginFrameAck& ack,
support_->DidNotProduceFrame(ack);
}
void TestLayerTreeFrameSink::DidAllocateSharedBitmap(
base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) {
}
void TestLayerTreeFrameSink::DidDeleteSharedBitmap(
const viz::SharedBitmapId& id) {
}
void TestLayerTreeFrameSink::DidReceiveCompositorFrameAck(
std::vector<viz::ReturnedResource> resources) {
DebugScopedSetImplThread impl(task_runner_provider_);

@ -100,9 +100,6 @@ class TestLayerTreeFrameSink : public LayerTreeFrameSink,
bool hit_test_data_changed) override;
void DidNotProduceFrame(const viz::BeginFrameAck& ack,
FrameSkippedReason reason) override;
void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion buffer,
const viz::SharedBitmapId& id) override;
void DidDeleteSharedBitmap(const viz::SharedBitmapId& id) override;
// mojom::CompositorFrameSinkClient implementation.
void DidReceiveCompositorFrameAck(

@ -17,7 +17,6 @@
#include "cc/cc_export.h"
#include "cc/scheduler/scheduler.h"
#include "cc/trees/raster_context_provider_wrapper.h"
#include "components/viz/client/shared_bitmap_reporter.h"
#include "components/viz/common/gpu/context_lost_observer.h"
#include "components/viz/common/gpu/context_provider.h"
#include "components/viz/common/gpu/raster_context_provider.h"
@ -48,8 +47,7 @@ class LayerTreeHostImpl;
// If a context_provider() is present, frames should be submitted with
// OpenGL resources (created with the context_provider()). If not, then
// SharedMemory resources should be used.
class CC_EXPORT LayerTreeFrameSink : public viz::SharedBitmapReporter,
public viz::ContextLostObserver,
class CC_EXPORT LayerTreeFrameSink : public viz::ContextLostObserver,
public gpu::GpuChannelLostObserver {
public:
// Constructor for a frame sink local to the GPU process.
@ -150,11 +148,6 @@ class CC_EXPORT LayerTreeFrameSink : public viz::SharedBitmapReporter,
virtual std::unique_ptr<LayerContext> CreateLayerContext(
LayerTreeHostImpl& host_impl);
// viz::SharedBitmapReporter implementation.
void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) override = 0;
void DidDeleteSharedBitmap(const viz::SharedBitmapId& id) override = 0;
class ContextLostForwarder;
// viz::ContextLostObserver:

@ -45,9 +45,6 @@ class StubLayerTreeFrameSink : public LayerTreeFrameSink {
}
void DidNotProduceFrame(const viz::BeginFrameAck& ack,
FrameSkippedReason reason) override {}
void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) override {}
void DidDeleteSharedBitmap(const viz::SharedBitmapId& id) override {}
};
TEST(LayerTreeFrameSinkTest, ContextLossInformsClient) {

@ -248,9 +248,6 @@ class StubCompositorFrameSink
std::optional<viz::HitTestRegionList> hit_test_region_list,
uint64_t submit_time) override {}
void DidNotProduceFrame(const viz::BeginFrameAck& begin_frame_ack) override {}
void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) override {}
void DidDeleteSharedBitmap(const viz::SharedBitmapId& id) override {}
void SubmitCompositorFrameSync(
const viz::LocalSurfaceId& local_surface_id,
viz::CompositorFrame frame,

@ -12,8 +12,6 @@ viz_component("client") {
"frame_eviction_manager.h",
"frame_evictor.cc",
"frame_evictor.h",
"shared_bitmap_reporter.cc",
"shared_bitmap_reporter.h",
]
defines = [ "VIZ_CLIENT_IMPLEMENTATION" ]

@ -1,11 +0,0 @@
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/viz/client/shared_bitmap_reporter.h"
namespace viz {
SharedBitmapReporter::~SharedBitmapReporter() = default;
} // namespace viz

@ -1,35 +0,0 @@
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_VIZ_CLIENT_SHARED_BITMAP_REPORTER_H_
#define COMPONENTS_VIZ_CLIENT_SHARED_BITMAP_REPORTER_H_
#include "base/memory/read_only_shared_memory_region.h"
#include "components/viz/client/viz_client_export.h"
#include "components/viz/common/resources/shared_bitmap.h"
namespace viz {
// An interface that can be used for code without a direct connection to the viz
// display compositor, as an intermediary in order to notify the display
// compositor about SharedMemory allocated for shared bitmaps. The
// implementation of this interface would be responsible to passing the
// notifications on to the display compositor via the CompositorFrameSink.
class VIZ_CLIENT_EXPORT SharedBitmapReporter {
public:
// Associates a SharedBitmapId with a shared buffer handle.
virtual void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
const SharedBitmapId& id) = 0;
// Disassociates a SharedBitmapId previously passed to
// DidAllocateSharedBitmap.
virtual void DidDeleteSharedBitmap(const SharedBitmapId& id) = 0;
protected:
virtual ~SharedBitmapReporter();
};
} // namespace viz
#endif // COMPONENTS_VIZ_CLIENT_SHARED_BITMAP_REPORTER_H_

@ -189,20 +189,6 @@ void CompositorFrameSinkImpl::DidNotProduceFrame(
support_->DidNotProduceFrame(begin_frame_ack);
}
void CompositorFrameSinkImpl::DidAllocateSharedBitmap(
base::ReadOnlySharedMemoryRegion region,
const SharedBitmapId& id) {
if (!support_->DidAllocateSharedBitmap(std::move(region), id)) {
DLOG(ERROR) << "DidAllocateSharedBitmap failed for duplicate "
<< "SharedBitmapId";
compositor_frame_sink_receiver_.reset();
}
}
void CompositorFrameSinkImpl::DidDeleteSharedBitmap(const SharedBitmapId& id) {
support_->DidDeleteSharedBitmap(id);
}
void CompositorFrameSinkImpl::InitializeCompositorFrameSinkType(
mojom::CompositorFrameSinkType type) {
support_->InitializeCompositorFrameSinkType(type);

@ -58,9 +58,6 @@ class CompositorFrameSinkImpl : public mojom::CompositorFrameSink {
uint64_t submit_time,
SubmitCompositorFrameSyncCallback callback) override;
void DidNotProduceFrame(const BeginFrameAck& begin_frame_ack) override;
void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
const SharedBitmapId& id) override;
void DidDeleteSharedBitmap(const SharedBitmapId& id) override;
void InitializeCompositorFrameSinkType(
mojom::CompositorFrameSinkType type) override;
void BindLayerContext(mojom::PendingLayerContextPtr context) override;

@ -167,12 +167,6 @@ CompositorFrameSinkSupport::~CompositorFrameSinkSupport() {
// clear the requests here regardless.
ClearAllPendingCopyOutputRequests();
// The display compositor has ownership of shared memory for each
// SharedBitmapId that has been reported from the client. Since the client is
// gone that memory can be freed. If we don't then it would leak.
for (const auto& id : owned_bitmaps_)
frame_sink_manager_->shared_bitmap_manager()->ChildDeletedSharedBitmap(id);
// No video capture clients should remain after calling
// UnregisterCompositorFrameSinkSupport().
DCHECK(capture_clients_.empty());
@ -720,24 +714,6 @@ void CompositorFrameSinkSupport::SubmitCompositorFrame(
DCHECK_EQ(result, SubmitResult::ACCEPTED);
}
bool CompositorFrameSinkSupport::DidAllocateSharedBitmap(
base::ReadOnlySharedMemoryRegion region,
const SharedBitmapId& id) {
if (!frame_sink_manager_->shared_bitmap_manager()->ChildAllocatedSharedBitmap(
region.Map(), id)) {
return false;
}
owned_bitmaps_.insert(id);
return true;
}
void CompositorFrameSinkSupport::DidDeleteSharedBitmap(
const SharedBitmapId& id) {
frame_sink_manager_->shared_bitmap_manager()->ChildDeletedSharedBitmap(id);
owned_bitmaps_.erase(id);
}
void CompositorFrameSinkSupport::SubmitCompositorFrameLocally(
const SurfaceId& surface_id,
CompositorFrame frame,

@ -191,10 +191,6 @@ class VIZ_SERVICE_EXPORT CompositorFrameSinkSupport
CompositorFrame frame,
std::optional<HitTestRegionList> hit_test_region_list = std::nullopt,
uint64_t submit_time = 0);
// Returns false if the notification was not valid (a duplicate).
bool DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
const SharedBitmapId& id);
void DidDeleteSharedBitmap(const SharedBitmapId& id);
// Mark |id| and all surfaces with smaller ids for destruction. Note that |id|
// doesn't have to exist at the time of calling.
@ -455,11 +451,6 @@ class VIZ_SERVICE_EXPORT CompositorFrameSinkSupport
std::vector<raw_ptr<CapturableFrameSink::Client, VectorExperimental>>
capture_clients_;
// The set of SharedBitmapIds that have been reported as allocated to this
// interface. On closing this interface, the display compositor should drop
// ownership of the bitmaps with these ids to avoid leaking them.
std::set<SharedBitmapId> owned_bitmaps_;
// These are the CopyOutputRequests made on the frame sink (as opposed to
// being included as a part of a CompositorFrame). They stay here until a
// Surface with a LocalSurfaceId which is at least the stored LocalSurfaceId

@ -328,11 +328,6 @@ void FrameSinkBundleImpl::Submit(
sink->DidNotProduceFrame(
submission->data->get_did_not_produce_frame());
break;
case mojom::BundledFrameSubmissionData::Tag::kDidDeleteSharedBitmap:
sink->DidDeleteSharedBitmap(
submission->data->get_did_delete_shared_bitmap());
break;
}
}
}
@ -350,15 +345,6 @@ void FrameSinkBundleImpl::Submit(
}
}
void FrameSinkBundleImpl::DidAllocateSharedBitmap(
uint32_t sink_id,
base::ReadOnlySharedMemoryRegion region,
const SharedBitmapId& id) {
if (auto* sink = GetFrameSink(sink_id)) {
sink->DidAllocateSharedBitmap(std::move(region), id);
}
}
#if BUILDFLAG(IS_ANDROID)
void FrameSinkBundleImpl::SetThreads(uint32_t sink_id,
const std::vector<Thread>& threads) {

@ -69,9 +69,7 @@ class FrameSinkBundleImpl : public mojom::FrameSinkBundle {
void SetWantsBeginFrameAcks(uint32_t sink_id) override;
void Submit(
std::vector<mojom::BundledFrameSubmissionPtr> submissions) override;
void DidAllocateSharedBitmap(uint32_t sink_id,
base::ReadOnlySharedMemoryRegion region,
const SharedBitmapId& id) override;
#if BUILDFLAG(IS_ANDROID)
void SetThreads(uint32_t sink_id,
const std::vector<Thread>& threads) override;

@ -559,21 +559,6 @@ void RootCompositorFrameSinkImpl::DidNotProduceFrame(
support_->DidNotProduceFrame(begin_frame_ack);
}
void RootCompositorFrameSinkImpl::DidAllocateSharedBitmap(
base::ReadOnlySharedMemoryRegion region,
const SharedBitmapId& id) {
if (!support_->DidAllocateSharedBitmap(std::move(region), id)) {
DLOG(ERROR) << "DidAllocateSharedBitmap failed for duplicate "
<< "SharedBitmapId";
compositor_frame_sink_receiver_.reset();
}
}
void RootCompositorFrameSinkImpl::DidDeleteSharedBitmap(
const SharedBitmapId& id) {
support_->DidDeleteSharedBitmap(id);
}
void RootCompositorFrameSinkImpl::InitializeCompositorFrameSinkType(
mojom::CompositorFrameSinkType type) {
support_->InitializeCompositorFrameSinkType(type);

@ -119,9 +119,6 @@ class VIZ_SERVICE_EXPORT RootCompositorFrameSinkImpl
std::optional<HitTestRegionList> hit_test_region_list,
uint64_t submit_time) override;
void DidNotProduceFrame(const BeginFrameAck& begin_frame_ack) override;
void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
const SharedBitmapId& id) override;
void DidDeleteSharedBitmap(const SharedBitmapId& id) override;
void SubmitCompositorFrameSync(
const LocalSurfaceId& local_surface_id,
CompositorFrame frame,

@ -1014,12 +1014,6 @@ void LayerContextImpl::DidNotProduceFrame(const BeginFrameAck& ack,
compositor_sink_->DidNotProduceFrame(ack);
}
void LayerContextImpl::DidAllocateSharedBitmap(
base::ReadOnlySharedMemoryRegion region,
const SharedBitmapId& id) {}
void LayerContextImpl::DidDeleteSharedBitmap(const SharedBitmapId& id) {}
void LayerContextImpl::DidAppendQuadsWithResources(
const std::vector<TransferableResource>& resources) {
next_frame_resources_.insert(next_frame_resources_.end(), resources.begin(),

@ -110,9 +110,6 @@ class LayerContextImpl : public cc::LayerTreeHostImplClient,
bool hit_test_data_changed) override;
void DidNotProduceFrame(const BeginFrameAck& ack,
cc::FrameSkippedReason reason) override;
void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
const SharedBitmapId& id) override;
void DidDeleteSharedBitmap(const SharedBitmapId& id) override;
// cc::TileDisplayLayerImpl::Client:
void DidAppendQuadsWithResources(

@ -88,17 +88,6 @@ interface CompositorFrameSink {
// CompositorFrame was produced as a result of it.
DidNotProduceFrame(BeginFrameAck ack);
// Informs the display compositor that the client allocated a shared bitmap.
// The |id| can then be used in subsequent CompositorFrames given to
// SubmitCompositorFrame. The |id| is a SharedBitmapId.
DidAllocateSharedBitmap(mojo_base.mojom.ReadOnlySharedMemoryRegion region,
SharedBitmapId id);
// Informs the display compositor that the client deleted a shared bitmap. This
// allows the service to free the shared memory that was previously given to it
// via DidAllocateSharedBitmap(). The |id| is a SharedBitmapId.
DidDeleteSharedBitmap(SharedBitmapId id);
// This should be called atmost once for the lifetime of this frame sink. Once
// the value has been set to anything other than kUnspecified, subsequent calls
// are silently ignored.

@ -34,9 +34,6 @@ union BundledFrameSubmissionData {
// Data for a DidNotProduceFrame call.
BeginFrameAck did_not_produce_frame;
// Data for a DidDeleteSharedBitmap call.
SharedBitmapId did_delete_shared_bitmap;
};
// SubmitCompositorFrame parameters, as bundled by BundledFrameSubmissionData
@ -71,12 +68,6 @@ interface FrameSinkBundle {
[UnlimitedSize]
Submit(array<BundledFrameSubmission> submissions);
// Corresponds to a single message of the same name on CompositorFrameSink
// for the identified sink.
DidAllocateSharedBitmap(
uint32 sink_id, mojo_base.mojom.ReadOnlySharedMemoryRegion region,
SharedBitmapId id);
// Corresponds to a single message of the same name on CompositorFrameSink
// for the identified sink.
[EnableIf=is_android]

@ -485,19 +485,6 @@ void CanvasResourceDispatcher::Reshape(const gfx::Size& size) {
}
}
void CanvasResourceDispatcher::DidAllocateSharedBitmap(
base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) {
if (sink_)
sink_->DidAllocateSharedBitmap(std::move(region), id);
}
void CanvasResourceDispatcher::DidDeleteSharedBitmap(
const viz::SharedBitmapId& id) {
if (sink_)
sink_->DidDeleteSharedBitmap(id);
}
void CanvasResourceDispatcher::SetPlaceholderCanvasDispatcher(
int placeholder_canvas_id) {
// `agent_group_scheduler_compositor_task_runner_` may be null if this

@ -121,10 +121,6 @@ class PLATFORM_EXPORT CanvasResourceDispatcher
uint32_t sequence_id) final {}
void OnSurfaceEvicted(const viz::LocalSurfaceId& local_surface_id) final {}
void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id);
void DidDeleteSharedBitmap(const viz::SharedBitmapId& id);
void SetFilterQuality(cc::PaintFlags::FilterQuality filter_quality);
void SetPlaceholderCanvasDispatcher(int placeholder_canvas_id);

@ -62,10 +62,6 @@ class MockCompositorFrameSink : public viz::mojom::blink::CompositorFrameSink {
}
MOCK_METHOD1(SubmitCompositorFrameSync_, void(viz::CompositorFrame*));
MOCK_METHOD1(DidNotProduceFrame, void(const viz::BeginFrameAck&));
MOCK_METHOD2(DidAllocateSharedBitmap,
void(base::ReadOnlySharedMemoryRegion,
const viz::SharedBitmapId&));
MOCK_METHOD1(DidDeleteSharedBitmap, void(const viz::SharedBitmapId&));
MOCK_METHOD1(SetPreferredFrameInterval, void(base::TimeDelta));
MOCK_METHOD1(InitializeCompositorFrameSinkType,
void(viz::mojom::CompositorFrameSinkType));

@ -42,10 +42,6 @@ class MockFrameSinkBundle : public viz::mojom::blink::FrameSinkBundle {
MOCK_METHOD1(SetWantsBeginFrameAcks, void(uint32_t));
MOCK_METHOD1(Submit,
void(WTF::Vector<viz::mojom::blink::BundledFrameSubmissionPtr>));
MOCK_METHOD3(DidAllocateSharedBitmap,
void(uint32_t,
base::ReadOnlySharedMemoryRegion,
const viz::SharedBitmapId&));
#if BUILDFLAG(IS_ANDROID)
MOCK_METHOD2(SetThreads, void(uint32_t, const WTF::Vector<viz::Thread>&));
#endif

@ -197,25 +197,6 @@ void VideoFrameSinkBundle::DidNotProduceFrame(uint32_t sink_id,
}
}
void VideoFrameSinkBundle::DidAllocateSharedBitmap(
uint32_t sink_id,
base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) {
bundle_->DidAllocateSharedBitmap(sink_id, std::move(region), id);
}
void VideoFrameSinkBundle::DidDeleteSharedBitmap(
uint32_t sink_id,
const viz::SharedBitmapId& id) {
// These messages are not urgent, but they must be well-ordered with respect
// to frame submissions. Hence they are batched in the same queue and
// flushed whenever any other messages are fit to flush.
submission_queue_.push_back(viz::mojom::blink::BundledFrameSubmission::New(
sink_id,
viz::mojom::blink::BundledFrameSubmissionData::NewDidDeleteSharedBitmap(
id)));
}
#if BUILDFLAG(IS_ANDROID)
void VideoFrameSinkBundle::SetThreads(uint32_t sink_id,
const WTF::Vector<viz::Thread>& threads) {

@ -123,10 +123,6 @@ class PLATFORM_EXPORT VideoFrameSinkBundle
std::optional<viz::HitTestRegionList> hit_test_region_list,
uint64_t submit_time);
void DidNotProduceFrame(uint32_t sink_id, const viz::BeginFrameAck& ack);
void DidAllocateSharedBitmap(uint32_t sink_id,
base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id);
void DidDeleteSharedBitmap(uint32_t sink_id, const viz::SharedBitmapId& id);
#if BUILDFLAG(IS_ANDROID)
void SetThreads(uint32_t sink_id, const WTF::Vector<viz::Thread>& threads);
#endif

@ -160,22 +160,6 @@ class VideoFrameSubmitter::FrameSinkBundleProxy
bundle_->DidNotProduceFrame(frame_sink_id_.sink_id(), ack);
}
void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) override {
if (!bundle_) {
return;
}
bundle_->DidAllocateSharedBitmap(frame_sink_id_.sink_id(),
std::move(region), id);
}
void DidDeleteSharedBitmap(const viz::SharedBitmapId& id) override {
if (!bundle_) {
return;
}
bundle_->DidDeleteSharedBitmap(frame_sink_id_.sink_id(), id);
}
void InitializeCompositorFrameSinkType(
viz::mojom::blink::CompositorFrameSinkType type) override {
if (!bundle_) {

@ -116,10 +116,6 @@ class VideoMockCompositorFrameSink
}
MOCK_METHOD1(DidNotProduceFrame, void(const viz::BeginFrameAck&));
MOCK_METHOD2(DidAllocateSharedBitmap,
void(base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id));
MOCK_METHOD1(DidDeleteSharedBitmap, void(const viz::SharedBitmapId& id));
MOCK_METHOD1(InitializeCompositorFrameSinkType,
void(viz::mojom::CompositorFrameSinkType));
MOCK_METHOD1(BindLayerContext,

@ -425,20 +425,6 @@ void SynchronousLayerTreeFrameSink::DidNotProduceFrame(
// submission of frame depends on DemandDraw calls.
}
void SynchronousLayerTreeFrameSink::DidAllocateSharedBitmap(
base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) {
// Webview does not use software compositing (other than resourceless draws,
// but this is called for software /resources/).
NOTREACHED();
}
void SynchronousLayerTreeFrameSink::DidDeleteSharedBitmap(
const viz::SharedBitmapId& id) {
// Webview does not use software compositing (other than resourceless draws,
// but this is called for software /resources/).
NOTREACHED();
}
void SynchronousLayerTreeFrameSink::Invalidate(bool needs_draw) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);

@ -108,9 +108,6 @@ class SynchronousLayerTreeFrameSink
bool hit_test_data_changed) override;
void DidNotProduceFrame(const viz::BeginFrameAck& ack,
cc::FrameSkippedReason reason) override;
void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) override;
void DidDeleteSharedBitmap(const viz::SharedBitmapId& id) override;
void Invalidate(bool needs_draw) override;
// viz::mojom::CompositorFrameSinkClient implementation.

@ -140,18 +140,6 @@ void DirectLayerTreeFrameSink::DidNotProduceFrame(
support_->DidNotProduceFrame(ack);
}
void DirectLayerTreeFrameSink::DidAllocateSharedBitmap(
base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) {
bool ok = support_->DidAllocateSharedBitmap(std::move(region), id);
DCHECK(ok);
}
void DirectLayerTreeFrameSink::DidDeleteSharedBitmap(
const viz::SharedBitmapId& id) {
support_->DidDeleteSharedBitmap(id);
}
void DirectLayerTreeFrameSink::DisplayOutputSurfaceLost() {
is_lost_ = true;
client_->DidLoseLayerTreeFrameSink();

@ -55,9 +55,6 @@ class DirectLayerTreeFrameSink : public cc::LayerTreeFrameSink,
bool hit_test_data_changed) override;
void DidNotProduceFrame(const viz::BeginFrameAck& ack,
cc::FrameSkippedReason reason) override;
void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) override;
void DidDeleteSharedBitmap(const viz::SharedBitmapId& id) override;
// viz::DisplayClient implementation.
void DisplayOutputSurfaceLost() override;