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

Unified Diff: content/browser/compositor/delegated_frame_host.cc

Issue 1129883003: Pass Surface ID namespace to renderer compositors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Set initial namespace value Created 5 years, 7 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/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_) {
« no previous file with comments | « content/browser/compositor/delegated_frame_host.h ('k') | content/browser/frame_host/render_widget_host_view_child_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698