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

Unified Diff: aura/desktop.cc

Issue 7770002: gfx::Compositor: SchedulePaint. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix aura, win compile Created 9 years, 3 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: aura/desktop.cc
diff --git a/aura/desktop.cc b/aura/desktop.cc
index b0ffbad17452686af4bd277892b8b750238e9e6b..8473287add758d55798a3efb9cbf3660ba85d60b 100644
--- a/aura/desktop.cc
+++ b/aura/desktop.cc
@@ -17,8 +17,10 @@ namespace aura {
Desktop* Desktop::instance_ = NULL;
Desktop::Desktop()
- : host_(aura::DesktopHost::Create(gfx::Rect(200, 200, 1024, 768))) {
- compositor_ = ui::Compositor::Create(host_->GetAcceleratedWidget(),
+ : host_(aura::DesktopHost::Create(gfx::Rect(200, 200, 1024, 768))),
+ ALLOW_THIS_IN_INITIALIZER_LIST(schedule_paint_(this)),
+ main_loop_(new MessageLoop(MessageLoop::TYPE_UI)) {
+ compositor_ = ui::Compositor::Create(this, host_->GetAcceleratedWidget(),
host_->GetSize());
host_->SetDesktop(this);
DCHECK(compositor_.get());
@@ -38,7 +40,6 @@ void Desktop::SetSize(const gfx::Size& size) {
void Desktop::Run() {
Show();
- MessageLoop main_message_loop(MessageLoop::TYPE_UI);
sky 2011/09/06 20:10:07 I actually just had problems with this too and was
sadrul 2011/09/06 21:50:11 I have made the change so callers create and own t
MessageLoopForUI::current()->Run(host_);
}
@@ -56,6 +57,13 @@ bool Desktop::OnKeyEvent(const KeyEvent& event) {
return window_->HandleKeyEvent(event);
}
+void Desktop::ScheduleCompositorPaint() {
+ if (schedule_paint_.empty()) {
+ MessageLoop::current()->PostTask(FROM_HERE,
+ schedule_paint_.NewRunnableMethod(&Desktop::Draw));
+ }
+}
+
// static
Desktop* Desktop::GetInstance() {
if (!instance_) {

Powered by Google App Engine
This is Rietveld 408576698