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

Unified Diff: content/browser/android/in_process/synchronous_compositor_external_begin_frame_source.cc

Issue 817603002: cc: Make scheduling be driven by vsync for android webview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix misc bugs introduced in last two patches Created 5 years, 10 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/android/in_process/synchronous_compositor_external_begin_frame_source.cc
diff --git a/content/browser/android/in_process/synchronous_compositor_external_begin_frame_source.cc b/content/browser/android/in_process/synchronous_compositor_external_begin_frame_source.cc
index 0c272fd358af42ff8789ad2ba672d74ed55d49b4..bf871cf49e214490c8592b82b397ed647456cb43 100644
--- a/content/browser/android/in_process/synchronous_compositor_external_begin_frame_source.cc
+++ b/content/browser/android/in_process/synchronous_compositor_external_begin_frame_source.cc
@@ -30,11 +30,19 @@ SynchronousCompositorExternalBeginFrameSource::
DCHECK(!compositor_);
}
-void SynchronousCompositorExternalBeginFrameSource::BeginFrame() {
+void SynchronousCompositorExternalBeginFrameSource::SendBeginFrameOnDraw() {
DCHECK(CalledOnValidThread());
- CallOnBeginFrame(cc::BeginFrameArgs::Create(
- BEGINFRAME_FROM_HERE, gfx::FrameTime::Now(), base::TimeTicks(),
- cc::BeginFrameArgs::DefaultInterval(), cc::BeginFrameArgs::SYNCHRONOUS));
+ cc::BeginFrameArgs args = last_begin_frame_args_;
boliu 2015/02/11 02:28:14 What happens if last_begin_frame_args_ is never se
+ args.type = cc::BeginFrameArgs::SYNCHRONOUS_DRAW;
+ CallOnBeginFrame(args);
+}
+
+void SynchronousCompositorExternalBeginFrameSource::SendBeginFrameOnAnimate(
+ cc::BeginFrameArgs args) {
+ DCHECK(CalledOnValidThread());
+ last_begin_frame_args_ = args;
+ args.type = cc::BeginFrameArgs::SYNCHRONOUS_ANIMATE;
+ CallOnBeginFrame(args);
}
void SynchronousCompositorExternalBeginFrameSource::SetCompositor(
@@ -46,9 +54,8 @@ void SynchronousCompositorExternalBeginFrameSource::SetCompositor(
void SynchronousCompositorExternalBeginFrameSource::OnNeedsBeginFramesChange(
bool needs_begin_frames) {
DCHECK(CalledOnValidThread());
-
if (compositor_)
- compositor_->NeedsBeginFramesChanged();
+ compositor_->OnNeedsBeginFramesChange(needs_begin_frames);
}
void SynchronousCompositorExternalBeginFrameSource::SetClientReady() {

Powered by Google App Engine
This is Rietveld 408576698