Chromium Code Reviews| Index: content/browser/compositor/delegated_frame_host.cc |
| diff --git a/content/browser/compositor/delegated_frame_host.cc b/content/browser/compositor/delegated_frame_host.cc |
| index f45e7f40c1c3028defaba8746b6d81954ee7bd0f..394720c774c4a958673ae2f406eb7e0d5092f52a 100644 |
| --- a/content/browser/compositor/delegated_frame_host.cc |
| +++ b/content/browser/compositor/delegated_frame_host.cc |
| @@ -195,6 +195,19 @@ void DelegatedFrameHost::EndFrameSubscription() { |
| frame_subscriber_.reset(); |
| } |
| +uint32_t DelegatedFrameHost::GetSurfaceIdNamespace() { |
| + if (!use_surfaces_) |
| + return 0; |
| + |
| + if (!surface_factory_) { |
| + ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); |
| + cc::SurfaceManager* manager = factory->GetSurfaceManager(); |
| + id_allocator_ = factory->GetContextFactory()->CreateSurfaceIdAllocator(); |
| + surface_factory_ = make_scoped_ptr(new cc::SurfaceFactory(manager, this)); |
| + } |
| + return id_allocator_->id_namespace(); |
| +} |
| + |
| bool DelegatedFrameHost::ShouldSkipFrame(gfx::Size size_in_dip) const { |
| // Should skip a frame only when another frame from the renderer is guaranteed |
| // to replace it. Otherwise may cause hangs when the renderer is waiting for |
| @@ -369,6 +382,8 @@ void DelegatedFrameHost::SwapDelegatedFrame( |
| factory->GetContextFactory()->CreateSurfaceIdAllocator(); |
| surface_factory_ = |
| make_scoped_ptr(new cc::SurfaceFactory(manager, this)); |
| + client_->DelegatedFrameHostUpdateSurfaceIdNamespace( |
|
jbauman
2015/05/12 00:09:12
Let's just create the id_allocator_ in the constru
kenrb
2015/05/12 20:01:41
Done.
|
| + id_allocator_->id_namespace()); |
| } |
| if (surface_id_.is_null() || frame_size != current_surface_size_ || |
| frame_size_in_dip != current_frame_size_in_dip_) { |