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

Side by Side Diff: ui/compositor/compositor.cc

Issue 290563005: Do SetNeedsCommit() instead of Composite() in threaded mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: composite: . Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/compositor/compositor.h" 5 #include "ui/compositor/compositor.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 173
174 // Stop all outstanding draws before telling the ContextFactory to tear 174 // Stop all outstanding draws before telling the ContextFactory to tear
175 // down any contexts that the |host_| may rely upon. 175 // down any contexts that the |host_| may rely upon.
176 host_.reset(); 176 host_.reset();
177 177
178 ContextFactory::GetInstance()->RemoveCompositor(this); 178 ContextFactory::GetInstance()->RemoveCompositor(this);
179 } 179 }
180 180
181 void Compositor::ScheduleDraw() { 181 void Compositor::ScheduleDraw() {
182 if (compositor_thread_loop_) { 182 if (compositor_thread_loop_) {
183 host_->Composite(gfx::FrameTime::Now()); 183 host_->SetNeedsCommit();
184 } else if (!defer_draw_scheduling_) { 184 } else if (!defer_draw_scheduling_) {
185 defer_draw_scheduling_ = true; 185 defer_draw_scheduling_ = true;
186 base::MessageLoop::current()->PostTask( 186 base::MessageLoop::current()->PostTask(
187 FROM_HERE, 187 FROM_HERE,
188 base::Bind(&Compositor::Draw, schedule_draw_factory_.GetWeakPtr())); 188 base::Bind(&Compositor::Draw, schedule_draw_factory_.GetWeakPtr()));
189 } 189 }
190 } 190 }
191 191
192 void Compositor::SetRootLayer(Layer* root_layer) { 192 void Compositor::SetRootLayer(Layer* root_layer) {
193 if (root_layer_ == root_layer) 193 if (root_layer_ == root_layer)
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 // CompositorObservers to be notified before starting another 402 // CompositorObservers to be notified before starting another
403 // draw cycle. 403 // draw cycle.
404 ScheduleDraw(); 404 ScheduleDraw();
405 } 405 }
406 FOR_EACH_OBSERVER(CompositorObserver, 406 FOR_EACH_OBSERVER(CompositorObserver,
407 observer_list_, 407 observer_list_,
408 OnCompositingEnded(this)); 408 OnCompositingEnded(this));
409 } 409 }
410 410
411 } // namespace ui 411 } // namespace ui
OLDNEW
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698