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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 = cc::BeginFrameArgs::Create( | 241 cc::BeginFrameArgs args = cc::BeginFrameArgs::Create( |
242 gfx::FrameTime::Now(), base::TimeTicks(), | 242 BEGINFRAME_FROM_HERE, gfx::FrameTime::Now(), base::TimeTicks(), |
243 cc::BeginFrameArgs::DefaultInterval(), cc::BeginFrameArgs::SYNCHRONOUS); | 243 cc::BeginFrameArgs::DefaultInterval(), cc::BeginFrameArgs::SYNCHRONOUS); |
244 BeginMainFrame(args); | 244 BeginMainFrame(args); |
245 host_->Composite(args.frame_time); | 245 host_->Composite(args.frame_time); |
246 } | 246 } |
247 if (swap_state_ == SWAP_NONE) | 247 if (swap_state_ == SWAP_NONE) |
248 NotifyEnd(); | 248 NotifyEnd(); |
249 } | 249 } |
250 | 250 |
251 void Compositor::ScheduleFullRedraw() { | 251 void Compositor::ScheduleFullRedraw() { |
252 host_->SetNeedsRedraw(); | 252 host_->SetNeedsRedraw(); |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 // Call ScheduleDraw() instead of Draw() in order to allow other | 460 // Call ScheduleDraw() instead of Draw() in order to allow other |
461 // CompositorObservers to be notified before starting another | 461 // CompositorObservers to be notified before starting another |
462 // draw cycle. | 462 // draw cycle. |
463 ScheduleDraw(); | 463 ScheduleDraw(); |
464 } | 464 } |
465 FOR_EACH_OBSERVER( | 465 FOR_EACH_OBSERVER( |
466 CompositorObserver, observer_list_, OnCompositingEnded(this)); | 466 CompositorObserver, observer_list_, OnCompositingEnded(this)); |
467 } | 467 } |
468 | 468 |
469 } // namespace ui | 469 } // namespace ui |
OLD | NEW |