OLD | NEW |
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 #if defined(USE_X11) | 5 #if defined(USE_X11) |
6 #include <X11/Xlib.h> | 6 #include <X11/Xlib.h> |
7 #endif | 7 #endif |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 } else { | 109 } else { |
110 ++frames_; | 110 ++frames_; |
111 if (frames_ % kFrames == 0) { | 111 if (frames_ % kFrames == 0) { |
112 TimeTicks now = TimeTicks::Now(); | 112 TimeTicks now = TimeTicks::Now(); |
113 double ms = (now - start_time_).InMillisecondsF() / kFrames; | 113 double ms = (now - start_time_).InMillisecondsF() / kFrames; |
114 LOG(INFO) << "FPS: " << 1000.f / ms << " (" << ms << " ms)"; | 114 LOG(INFO) << "FPS: " << 1000.f / ms << " (" << ms << " ms)"; |
115 start_time_ = now; | 115 start_time_ = now; |
116 } | 116 } |
117 } | 117 } |
118 if (max_frames_ && frames_ == max_frames_) { | 118 if (max_frames_ && frames_ == max_frames_) { |
119 base::MessageLoop::current()->Quit(); | 119 base::MessageLoop::current()->QuitWhenIdle(); |
120 } else { | 120 } else { |
121 Draw(); | 121 Draw(); |
122 } | 122 } |
123 } | 123 } |
124 | 124 |
125 void OnCompositingAborted(Compositor* compositor) override {} | 125 void OnCompositingAborted(Compositor* compositor) override {} |
126 | 126 |
127 void OnCompositingLockStateChanged(Compositor* compositor) override {} | 127 void OnCompositingLockStateChanged(Compositor* compositor) override {} |
128 | 128 |
129 void OnCompositingShuttingDown(ui::Compositor* compositor) override {} | 129 void OnCompositingShuttingDown(ui::Compositor* compositor) override {} |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 ui::PrintLayerHierarchy(host->window()->layer(), gfx::Point(100, 100)); | 365 ui::PrintLayerHierarchy(host->window()->layer(), gfx::Point(100, 100)); |
366 #endif | 366 #endif |
367 | 367 |
368 host->Show(); | 368 host->Show(); |
369 base::MessageLoopForUI::current()->Run(); | 369 base::MessageLoopForUI::current()->Run(); |
370 focus_client.reset(); | 370 focus_client.reset(); |
371 host.reset(); | 371 host.reset(); |
372 | 372 |
373 return 0; | 373 return 0; |
374 } | 374 } |
OLD | NEW |