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

Side by Side Diff: ui/events/blink/compositor_thread_event_queue.cc

Issue 2429953002: Implement compositor thread VSync aligned event queue (Closed)
Patch Set: dtapuska&enne's review: Call |Now()| once per loop; Chromium style; Remove parameterized test Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « ui/events/blink/compositor_thread_event_queue.h ('k') | ui/events/blink/event_with_callback.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/events/blink/compositor_thread_event_queue.h"
6
7 namespace ui {
8
9 CompositorThreadEventQueue::CompositorThreadEventQueue() {}
10
11 CompositorThreadEventQueue::~CompositorThreadEventQueue() {}
12
13 // TODO(chongz): Support coalescing events across interleaved boundaries.
14 // https://crbug.com/661601
15 void CompositorThreadEventQueue::Queue(std::unique_ptr<EventWithCallback> event,
16 base::TimeTicks timestamp_now) {
17 if (!queue_.empty() && queue_.back()->CanCoalesceWith(*event)) {
18 queue_.back()->CoalesceWith(event.get(), timestamp_now);
19 return;
20 }
21
22 queue_.emplace_back(std::move(event));
23 }
24
25 std::unique_ptr<EventWithCallback> CompositorThreadEventQueue::Pop() {
26 std::unique_ptr<EventWithCallback> result;
27 if (!queue_.empty()) {
28 result.reset(queue_.front().release());
29 queue_.pop_front();
30 }
31 return result;
32 }
33
34 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/blink/compositor_thread_event_queue.h ('k') | ui/events/blink/event_with_callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698