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

Unified Diff: ui/compositor/compositor.cc

Issue 10537028: aura: Drop unnecessary composites (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "" Created 8 years, 6 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
« no previous file with comments | « ui/compositor/compositor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/compositor.cc
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index 6d5e1f1c5b43062db046dc736af49697ff2b4467..5dc991e6a937c58dfd4f9d00c80a5d5107d7b017 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -131,7 +131,10 @@ Compositor::Compositor(CompositorDelegate* delegate,
widget_(widget),
root_web_layer_(WebKit::WebLayer::create()),
swap_posted_(false),
- device_scale_factor_(0.0f) {
+ device_scale_factor_(0.0f),
+ last_started_frame_(0),
+ last_ended_frame_(0),
+ disable_schedule_composite_(false) {
WebKit::WebLayerTreeView::Settings settings;
CommandLine* command_line = CommandLine::ForCurrentProcess();
settings.showFPSCounter =
@@ -204,6 +207,8 @@ void Compositor::Draw(bool force_clear) {
if (!root_layer_)
return;
+ last_started_frame_++;
+
// TODO(nduca): Temporary while compositor calls
// compositeImmediately() directly.
layout();
@@ -290,8 +295,12 @@ void Compositor::updateAnimations(double frameBeginTime) {
}
void Compositor::layout() {
+ // We're sending damage that will be addressed during this composite
+ // cycle, so we don't need to schedule another composite to address it.
+ disable_schedule_composite_ = true;
if (root_layer_)
root_layer_->SendDamagedRects();
+ disable_schedule_composite_ = false;
}
void Compositor::applyScrollAndScale(const WebKit::WebSize& scrollDelta,
@@ -323,7 +332,8 @@ void Compositor::didCompleteSwapBuffers() {
}
void Compositor::scheduleComposite() {
- ScheduleDraw();
+ if (!disable_schedule_composite_)
+ ScheduleDraw();
}
void Compositor::SwizzleRGBAToBGRAAndFlip(unsigned char* pixels,
@@ -350,6 +360,7 @@ void Compositor::SwizzleRGBAToBGRAAndFlip(unsigned char* pixels,
}
void Compositor::NotifyEnd() {
+ last_ended_frame_++;
FOR_EACH_OBSERVER(CompositorObserver,
observer_list_,
OnCompositingEnded(this));
« no previous file with comments | « ui/compositor/compositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698