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

Unified Diff: android_webview/browser/hardware_renderer.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
« no previous file with comments | « no previous file | android_webview/browser/surfaces_instance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/hardware_renderer.cc
diff --git a/android_webview/browser/hardware_renderer.cc b/android_webview/browser/hardware_renderer.cc
index b1405bef17cbf53c8174f7c6edf12188e4d639f1..4a1f37cbe6c17cfb3f85169d344a4d73be11bb0f 100644
--- a/android_webview/browser/hardware_renderer.cc
+++ b/android_webview/browser/hardware_renderer.cc
@@ -27,10 +27,13 @@ HardwareRenderer::HardwareRenderer(RenderThreadManager* state)
: render_thread_manager_(state),
last_egl_context_(eglGetCurrentContext()),
surfaces_(SurfacesInstance::GetOrCreateInstance()),
- surface_id_allocator_(surfaces_->CreateSurfaceIdAllocator()),
+ surface_id_allocator_(
+ new cc::SurfaceIdAllocator(surfaces_->AllocateSurfaceClientId())),
last_committed_output_surface_id_(0u),
last_submitted_output_surface_id_(0u) {
DCHECK(last_egl_context_);
+ surfaces_->GetSurfaceManager()->RegisterSurfaceClientId(
+ surface_id_allocator_->client_id());
surfaces_->GetSurfaceManager()->RegisterSurfaceFactoryClient(
surface_id_allocator_->client_id(), this);
}
@@ -43,6 +46,8 @@ HardwareRenderer::~HardwareRenderer() {
surface_factory_.reset();
surfaces_->GetSurfaceManager()->UnregisterSurfaceFactoryClient(
surface_id_allocator_->client_id());
+ surfaces_->GetSurfaceManager()->InvalidateSurfaceClientId(
+ surface_id_allocator_->client_id());
// Reset draw constraints.
render_thread_manager_->PostExternalDrawConstraintsToChildCompositorOnRT(
« no previous file with comments | « no previous file | android_webview/browser/surfaces_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698