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

Unified Diff: content/test/test_render_view_host.cc

Issue 2166423002: ui::ContextFactory should not create SurfaceIdAllocators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Dana's nit Created 4 years, 5 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
Index: content/test/test_render_view_host.cc
diff --git a/content/test/test_render_view_host.cc b/content/test/test_render_view_host.cc
index 29fc6f7c8b8d9649435e149c928e37ee873ad415..81252ea09605fce4d6ce0eefcc37450b7e71ab32 100644
--- a/content/test/test_render_view_host.cc
+++ b/content/test/test_render_view_host.cc
@@ -64,17 +64,28 @@ TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh)
is_occluded_(false),
did_swap_compositor_frame_(false) {
#if defined(OS_ANDROID)
- surface_id_allocator_ = CreateSurfaceIdAllocator();
+ surface_id_allocator_.reset(
+ new cc::SurfaceIdAllocator(AllocateSurfaceClientId()));
+ GetSurfaceManager()->RegisterSurfaceClientId(
+ surface_id_allocator_->client_id());
#else
// Not all tests initialize or need an image transport factory.
- if (ImageTransportFactory::GetInstance())
- surface_id_allocator_ = CreateSurfaceIdAllocator();
+ if (ImageTransportFactory::GetInstance()) {
+ surface_id_allocator_.reset(
+ new cc::SurfaceIdAllocator(AllocateSurfaceClientId()));
+ GetSurfaceManager()->RegisterSurfaceClientId(
+ surface_id_allocator_->client_id());
+ }
#endif
rwh_->SetView(this);
}
TestRenderWidgetHostView::~TestRenderWidgetHostView() {
+ if (GetSurfaceManager()) {
+ GetSurfaceManager()->InvalidateSurfaceClientId(
+ surface_id_allocator_->client_id());
+ }
}
RenderWidgetHost* TestRenderWidgetHostView::GetRenderWidgetHost() const {
« no previous file with comments | « content/renderer/android/synchronous_compositor_output_surface.cc ('k') | services/ui/surfaces/display_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698