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 #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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 TRACE_EVENT_ASYNC_BEGIN0("ui", "Compositor::Draw", last_started_frame_ + 1); | 231 TRACE_EVENT_ASYNC_BEGIN0("ui", "Compositor::Draw", last_started_frame_ + 1); |
232 | 232 |
233 DCHECK_NE(swap_state_, SWAP_POSTED); | 233 DCHECK_NE(swap_state_, SWAP_POSTED); |
234 swap_state_ = SWAP_NONE; | 234 swap_state_ = SWAP_NONE; |
235 | 235 |
236 waiting_on_compositing_end_ = true; | 236 waiting_on_compositing_end_ = true; |
237 last_started_frame_++; | 237 last_started_frame_++; |
238 if (!IsLocked()) { | 238 if (!IsLocked()) { |
239 // TODO(nduca): Temporary while compositor calls | 239 // TODO(nduca): Temporary while compositor calls |
240 // compositeImmediately() directly. | 240 // compositeImmediately() directly. |
241 cc::BeginFrameArgs args = | 241 cc::BeginFrameArgs args = cc::BeginFrameArgs::Create( |
242 cc::BeginFrameArgs::Create(gfx::FrameTime::Now(), | 242 gfx::FrameTime::Now(), base::TimeTicks(), |
243 base::TimeTicks(), | 243 cc::BeginFrameArgs::DefaultInterval(), cc::BeginFrameArgs::SYNCHRONOUS); |
244 cc::BeginFrameArgs::DefaultInterval()); | |
245 BeginMainFrame(args); | 244 BeginMainFrame(args); |
246 host_->Composite(args.frame_time); | 245 host_->Composite(args.frame_time); |
247 } | 246 } |
248 if (swap_state_ == SWAP_NONE) | 247 if (swap_state_ == SWAP_NONE) |
249 NotifyEnd(); | 248 NotifyEnd(); |
250 } | 249 } |
251 | 250 |
252 void Compositor::ScheduleFullRedraw() { | 251 void Compositor::ScheduleFullRedraw() { |
253 host_->SetNeedsRedraw(); | 252 host_->SetNeedsRedraw(); |
254 } | 253 } |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 // Call ScheduleDraw() instead of Draw() in order to allow other | 460 // Call ScheduleDraw() instead of Draw() in order to allow other |
462 // CompositorObservers to be notified before starting another | 461 // CompositorObservers to be notified before starting another |
463 // draw cycle. | 462 // draw cycle. |
464 ScheduleDraw(); | 463 ScheduleDraw(); |
465 } | 464 } |
466 FOR_EACH_OBSERVER( | 465 FOR_EACH_OBSERVER( |
467 CompositorObserver, observer_list_, OnCompositingEnded(this)); | 466 CompositorObserver, observer_list_, OnCompositingEnded(this)); |
468 } | 467 } |
469 | 468 |
470 } // namespace ui | 469 } // namespace ui |
OLD | NEW |