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

Unified Diff: android_webview/browser/hardware_renderer.cc

Issue 2388753003: Introduce cc::LocalFrameId and use in SurfaceFactory (Closed)
Patch Set: Fix exo_unittests 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
Index: android_webview/browser/hardware_renderer.cc
diff --git a/android_webview/browser/hardware_renderer.cc b/android_webview/browser/hardware_renderer.cc
index 56b9e008b26eee3dd6dc7baad8b2117f24b12de6..403f6f4b238f8fb00a8f48ff385f7ad01cd38c8a 100644
--- a/android_webview/browser/hardware_renderer.cc
+++ b/android_webview/browser/hardware_renderer.cc
@@ -29,8 +29,7 @@ HardwareRenderer::HardwareRenderer(RenderThreadManager* state)
last_egl_context_(eglGetCurrentContext()),
surfaces_(SurfacesInstance::GetOrCreateInstance()),
frame_sink_id_(surfaces_->AllocateFrameSinkId()),
- surface_id_allocator_(
- base::MakeUnique<cc::SurfaceIdAllocator>(frame_sink_id_)),
+ surface_id_allocator_(base::MakeUnique<cc::SurfaceIdAllocator>()),
last_committed_compositor_frame_sink_id_(0u),
last_submitted_compositor_frame_sink_id_(0u) {
DCHECK(last_egl_context_);
@@ -143,7 +142,8 @@ void HardwareRenderer::DrawGL(AwDrawGLInfo* draw_info) {
gfx::Rect clip(draw_info->clip_left, draw_info->clip_top,
draw_info->clip_right - draw_info->clip_left,
draw_info->clip_bottom - draw_info->clip_top);
- surfaces_->DrawAndSwap(viewport, clip, transform, frame_size_, child_id_);
+ surfaces_->DrawAndSwap(viewport, clip, transform, frame_size_,
+ cc::SurfaceId(frame_sink_id_, child_id_));
}
void HardwareRenderer::AllocateSurface() {
@@ -151,15 +151,15 @@ void HardwareRenderer::AllocateSurface() {
DCHECK(surface_factory_);
child_id_ = surface_id_allocator_->GenerateId();
surface_factory_->Create(child_id_);
- surfaces_->AddChildId(child_id_);
+ surfaces_->AddChildId(cc::SurfaceId(frame_sink_id_, child_id_));
}
void HardwareRenderer::DestroySurface() {
DCHECK(!child_id_.is_null());
DCHECK(surface_factory_);
- surfaces_->RemoveChildId(child_id_);
+ surfaces_->RemoveChildId(cc::SurfaceId(frame_sink_id_, child_id_));
surface_factory_->Destroy(child_id_);
- child_id_ = cc::SurfaceId();
+ child_id_ = cc::LocalFrameId();
}
void HardwareRenderer::ReturnResources(

Powered by Google App Engine
This is Rietveld 408576698