summaryrefslogtreecommitdiffstats
path: root/cc/trees/thread_proxy.h
diff options
context:
space:
mode:
authorenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-24 04:44:50 +0000
committerenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-24 04:44:50 +0000
commitb535f65a24fbb16f0d1a93a1f2ac6ca8b1837d50 (patch)
tree118820d27365034891ffd4dd107dce00d393212f /cc/trees/thread_proxy.h
parent4204b9ffa857f6b95ccb05401995b0b4b9ef7690 (diff)
downloadchromium_src-b535f65a24fbb16f0d1a93a1f2ac6ca8b1837d50.zip
chromium_src-b535f65a24fbb16f0d1a93a1f2ac6ca8b1837d50.tar.gz
chromium_src-b535f65a24fbb16f0d1a93a1f2ac6ca8b1837d50.tar.bz2
cc: Allow the main thread to cancel commits
Add a new SetNeedsUpdateLayers that triggers the commit flow, but is abortable if update layers doesn't actually make any changes. This allows the main thread to abort a begin frame. This happens in the case of scroll updates from the compositor thread or invalidations. There was previously an abort begin frame call for when a visibility message and a begin frame message were posted simultaneously, but it incorrectly applied the scrolls and scales without informing the compositor thread that these had already been consumed. To fix this, the abort message passes back a boolean about whether or not the commit was aborted (and needed to be sent again) or was handled (and the scrolls and scales processed). To avoid a deluge of begin frames (in the commit sense) from the scheduler, the scheduler has been adjusted to wait until the next begin frame (in the vsync signal sense) so that these calls can be throttled. Otherwise, the scheduler will just keep trying to begin frame. R=brianderson@chromium.org, danakj@chromium.org BUG=256381 Review URL: https://chromiumcodereview.appspot.com/19106007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213338 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/trees/thread_proxy.h')
-rw-r--r--cc/trees/thread_proxy.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/cc/trees/thread_proxy.h b/cc/trees/thread_proxy.h
index eb2ef7e..c9d5b47 100644
--- a/cc/trees/thread_proxy.h
+++ b/cc/trees/thread_proxy.h
@@ -49,6 +49,7 @@ class ThreadProxy : public Proxy,
virtual void CreateAndInitializeOutputSurface() OVERRIDE;
virtual const RendererCapabilities& GetRendererCapabilities() const OVERRIDE;
virtual void SetNeedsAnimate() OVERRIDE;
+ virtual void SetNeedsUpdateLayers() OVERRIDE;
virtual void SetNeedsCommit() OVERRIDE;
virtual void SetNeedsRedraw(gfx::Rect damage_rect) OVERRIDE;
virtual void SetDeferCommits(bool defer_commits) OVERRIDE;
@@ -135,6 +136,7 @@ class ThreadProxy : public Proxy,
void OnOutputSurfaceInitializeAttempted(
bool success,
const RendererCapabilities& capabilities);
+ void SendCommitRequestToImplThreadIfNeeded();
// Called on impl thread.
struct ReadbackRequest;
@@ -146,7 +148,7 @@ class ThreadProxy : public Proxy,
CompletionEvent* completion,
ResourceUpdateQueue* queue,
scoped_refptr<cc::ContextProvider> offscreen_context_provider);
- void BeginFrameAbortedByMainThreadOnImplThread();
+ void BeginFrameAbortedByMainThreadOnImplThread(bool did_handle);
void RequestReadbackOnImplThread(ReadbackRequest* request);
void FinishAllRenderingOnImplThread(CompletionEvent* completion);
void InitializeImplOnImplThread(CompletionEvent* completion);
@@ -241,6 +243,8 @@ class ThreadProxy : public Proxy,
bool inside_draw_;
+ bool can_cancel_commit_;
+
bool defer_commits_;
scoped_ptr<BeginFrameAndCommitState> pending_deferred_commit_;