summaryrefslogtreecommitdiffstats
path: root/cc/test/fake_content_layer.cc
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/test/fake_content_layer.cc
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/test/fake_content_layer.cc')
-rw-r--r--cc/test/fake_content_layer.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/cc/test/fake_content_layer.cc b/cc/test/fake_content_layer.cc
index 5dcc512..077831fd 100644
--- a/cc/test/fake_content_layer.cc
+++ b/cc/test/fake_content_layer.cc
@@ -12,7 +12,8 @@ namespace cc {
FakeContentLayer::FakeContentLayer(ContentLayerClient* client)
: ContentLayer(client),
update_count_(0),
- push_properties_count_(0) {
+ push_properties_count_(0),
+ always_update_resources_(false) {
SetAnchorPoint(gfx::PointF(0.f, 0.f));
SetBounds(gfx::Size(1, 1));
SetIsDrawable(true);
@@ -29,7 +30,7 @@ bool FakeContentLayer::Update(ResourceUpdateQueue* queue,
const OcclusionTracker* occlusion) {
bool updated = ContentLayer::Update(queue, occlusion);
update_count_++;
- return updated;
+ return updated || always_update_resources_;
}
void FakeContentLayer::PushPropertiesTo(LayerImpl* layer) {