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

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

Issue 1124523003: Revert of Enable BeginFrame scheduling on aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/browser_compositor_output_surface.cc
diff --git a/content/browser/compositor/browser_compositor_output_surface.cc b/content/browser/compositor/browser_compositor_output_surface.cc
index a7181842ce6d0dedd401b779c0b26183bb3d755c..6839457196ed4eb2fccdf4c621ad2054e5a00b47 100644
--- a/content/browser/compositor/browser_compositor_output_surface.cc
+++ b/content/browser/compositor/browser_compositor_output_surface.cc
@@ -15,17 +15,21 @@
BrowserCompositorOutputSurface::BrowserCompositorOutputSurface(
const scoped_refptr<cc::ContextProvider>& context_provider,
+ const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager,
scoped_ptr<BrowserCompositorOverlayCandidateValidator>
overlay_candidate_validator)
: OutputSurface(context_provider),
+ vsync_manager_(vsync_manager),
reflector_(nullptr) {
overlay_candidate_validator_ = overlay_candidate_validator.Pass();
Initialize();
}
BrowserCompositorOutputSurface::BrowserCompositorOutputSurface(
- scoped_ptr<cc::SoftwareOutputDevice> software_device)
+ scoped_ptr<cc::SoftwareOutputDevice> software_device,
+ const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager)
: OutputSurface(software_device.Pass()),
+ vsync_manager_(vsync_manager),
reflector_(nullptr) {
Initialize();
}
@@ -34,6 +38,9 @@
if (reflector_)
reflector_->DetachFromOutputSurface();
DCHECK(!reflector_);
+ if (!HasClient())
+ return;
+ vsync_manager_->RemoveObserver(this);
}
void BrowserCompositorOutputSurface::Initialize() {
@@ -41,11 +48,27 @@
capabilities_.adjust_deadline_for_parent = false;
}
+bool BrowserCompositorOutputSurface::BindToClient(
+ cc::OutputSurfaceClient* client) {
+ if (!OutputSurface::BindToClient(client))
+ return false;
+ // Don't want vsync notifications until there is a client.
+ vsync_manager_->AddObserver(this);
+ return true;
+}
+
+void BrowserCompositorOutputSurface::OnUpdateVSyncParameters(
+ base::TimeTicks timebase,
+ base::TimeDelta interval) {
+ DCHECK(HasClient());
+ CommitVSyncParameters(timebase, interval);
+}
+
void BrowserCompositorOutputSurface::OnUpdateVSyncParametersFromGpu(
base::TimeTicks timebase,
base::TimeDelta interval) {
DCHECK(HasClient());
- CommitVSyncParameters(timebase, interval);
+ vsync_manager_->UpdateVSyncParameters(timebase, interval);
}
void BrowserCompositorOutputSurface::SetReflector(ReflectorImpl* reflector) {
« no previous file with comments | « content/browser/compositor/browser_compositor_output_surface.h ('k') | content/browser/compositor/delegated_frame_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698