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

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: Fix Mac bug. 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..0397b22bdea49c1da1f0babd5df6f3dace00c90d 100644
--- a/content/browser/compositor/delegated_frame_host.cc
+++ b/content/browser/compositor/delegated_frame_host.cc
@@ -65,7 +65,9 @@ DelegatedFrameHost::DelegatedFrameHost(DelegatedFrameHostClient* client)
current_scale_factor_(1.f),
can_lock_compositor_(YES_CAN_LOCK),
delegated_frame_evictor_(new DelegatedFrameEvictor(this)) {
- ImageTransportFactory::GetInstance()->AddObserver(this);
+ ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
+ factory->AddObserver(this);
+ id_allocator_ = factory->GetContextFactory()->CreateSurfaceIdAllocator();
}
void DelegatedFrameHost::WasShown(const ui::LatencyInfo& latency_info) {
@@ -195,6 +197,13 @@ void DelegatedFrameHost::EndFrameSubscription() {
frame_subscriber_.reset();
}
+uint32_t DelegatedFrameHost::GetSurfaceIdNamespace() {
+ if (!use_surfaces_)
+ return 0;
+
+ 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
@@ -365,8 +374,6 @@ void DelegatedFrameHost::SwapDelegatedFrame(
ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
cc::SurfaceManager* manager = factory->GetSurfaceManager();
if (!surface_factory_) {
- id_allocator_ =
- factory->GetContextFactory()->CreateSurfaceIdAllocator();
surface_factory_ =
make_scoped_ptr(new cc::SurfaceFactory(manager, this));
}

Powered by Google App Engine
This is Rietveld 408576698