Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1633)

Unified Diff: cc/test/test_compositor_frame_sink.cc

Issue 2383373002: Reduce SurfaceIdAllocator usage and tie SurfaceFactory to a single FrameSinkId (Closed)
Patch Set: Rebased Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/test_compositor_frame_sink.h ('k') | components/exo/surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/test_compositor_frame_sink.cc
diff --git a/cc/test/test_compositor_frame_sink.cc b/cc/test/test_compositor_frame_sink.cc
index 5930e3a9d7b18311496d3e0cafdd32baf29f8ac8..1037fba98a6a5c9c482c9f7985c795b92cb919ba 100644
--- a/cc/test/test_compositor_frame_sink.cc
+++ b/cc/test/test_compositor_frame_sink.cc
@@ -14,8 +14,7 @@
#include "cc/output/output_surface.h"
#include "cc/output/texture_mailbox_deleter.h"
-static constexpr uint32_t kCompositorClientId = 1;
-static constexpr uint32_t kCompositorSinkId = 1;
+static constexpr cc::FrameSinkId kCompositorFrameSinkId(1, 1);
namespace cc {
@@ -31,10 +30,11 @@ TestCompositorFrameSink::TestCompositorFrameSink(
bool force_disable_reclaim_resources)
: CompositorFrameSink(std::move(compositor_context_provider),
std::move(worker_context_provider)),
+ frame_sink_id_(kCompositorFrameSinkId),
surface_manager_(new SurfaceManager),
- surface_id_allocator_(new SurfaceIdAllocator(
- FrameSinkId(kCompositorClientId, kCompositorSinkId))),
- surface_factory_(new SurfaceFactory(surface_manager_.get(), this)),
+ surface_id_allocator_(new SurfaceIdAllocator(frame_sink_id_)),
+ surface_factory_(
+ new SurfaceFactory(frame_sink_id_, surface_manager_.get(), this)),
weak_ptrs_(this) {
std::unique_ptr<SyntheticBeginFrameSource> begin_frame_source;
std::unique_ptr<DisplayScheduler> scheduler;
@@ -90,11 +90,9 @@ bool TestCompositorFrameSink::BindToClient(CompositorFrameSinkClient* client) {
if (!capabilities_.delegated_sync_points_required && context_provider())
context_provider()->SetLostContextCallback(base::Closure());
- surface_manager_->RegisterFrameSinkId(surface_id_allocator_->frame_sink_id());
- surface_manager_->RegisterSurfaceFactoryClient(
- surface_id_allocator_->frame_sink_id(), this);
- display_->Initialize(this, surface_manager_.get(),
- surface_id_allocator_->frame_sink_id());
+ surface_manager_->RegisterFrameSinkId(frame_sink_id_);
+ surface_manager_->RegisterSurfaceFactoryClient(frame_sink_id_, this);
+ display_->Initialize(this, surface_manager_.get(), frame_sink_id_);
display_->renderer_for_testing()->SetEnlargePassTextureAmountForTesting(
enlarge_pass_texture_amount_);
display_->SetVisible(true);
@@ -107,10 +105,8 @@ void TestCompositorFrameSink::DetachFromClient() {
if (bound_) {
if (!delegated_surface_id_.is_null())
surface_factory_->Destroy(delegated_surface_id_);
- surface_manager_->UnregisterSurfaceFactoryClient(
- surface_id_allocator_->frame_sink_id());
- surface_manager_->InvalidateFrameSinkId(
- surface_id_allocator_->frame_sink_id());
+ surface_manager_->UnregisterSurfaceFactoryClient(frame_sink_id_);
+ surface_manager_->InvalidateFrameSinkId(frame_sink_id_);
bound_ = false;
}
display_ = nullptr;
« no previous file with comments | « cc/test/test_compositor_frame_sink.h ('k') | components/exo/surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698