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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 247 |
248 DCHECK_NE(swap_state_, SWAP_POSTED); | 248 DCHECK_NE(swap_state_, SWAP_POSTED); |
249 swap_state_ = SWAP_NONE; | 249 swap_state_ = SWAP_NONE; |
250 | 250 |
251 waiting_on_compositing_end_ = true; | 251 waiting_on_compositing_end_ = true; |
252 last_started_frame_++; | 252 last_started_frame_++; |
253 if (!IsLocked()) { | 253 if (!IsLocked()) { |
254 // TODO(nduca): Temporary while compositor calls | 254 // TODO(nduca): Temporary while compositor calls |
255 // compositeImmediately() directly. | 255 // compositeImmediately() directly. |
256 cc::BeginFrameArgs args = cc::BeginFrameArgs::Create( | 256 cc::BeginFrameArgs args = cc::BeginFrameArgs::Create( |
257 gfx::FrameTime::Now(), base::TimeTicks(), | 257 BEGINFRAME_FROM_HERE, gfx::FrameTime::Now(), base::TimeTicks(), |
258 cc::BeginFrameArgs::DefaultInterval(), cc::BeginFrameArgs::SYNCHRONOUS); | 258 cc::BeginFrameArgs::DefaultInterval(), cc::BeginFrameArgs::SYNCHRONOUS); |
259 BeginMainFrame(args); | 259 BeginMainFrame(args); |
260 host_->Composite(args.frame_time); | 260 host_->Composite(args.frame_time); |
261 } | 261 } |
262 if (swap_state_ == SWAP_NONE) | 262 if (swap_state_ == SWAP_NONE) |
263 NotifyEnd(); | 263 NotifyEnd(); |
264 } | 264 } |
265 | 265 |
266 void Compositor::ScheduleFullRedraw() { | 266 void Compositor::ScheduleFullRedraw() { |
267 host_->SetNeedsRedraw(); | 267 host_->SetNeedsRedraw(); |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 // Call ScheduleDraw() instead of Draw() in order to allow other | 480 // Call ScheduleDraw() instead of Draw() in order to allow other |
481 // CompositorObservers to be notified before starting another | 481 // CompositorObservers to be notified before starting another |
482 // draw cycle. | 482 // draw cycle. |
483 ScheduleDraw(); | 483 ScheduleDraw(); |
484 } | 484 } |
485 FOR_EACH_OBSERVER( | 485 FOR_EACH_OBSERVER( |
486 CompositorObserver, observer_list_, OnCompositingEnded(this)); | 486 CompositorObserver, observer_list_, OnCompositingEnded(this)); |
487 } | 487 } |
488 | 488 |
489 } // namespace ui | 489 } // namespace ui |
OLD | NEW |