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

Side by Side Diff: ui/ozone/platform/dri/page_flip_event_handler.cc

Issue 781683005: Ozone: Avoid blocking in Swapbuffer Call. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compiler warning. Created 6 years 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
OLDNEW
(Empty)
1 // Copyright 2014 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/ozone/platform/dri/page_flip_event_handler.h"
6
7 #include "base/bind.h"
8 #include "ui/ozone/platform/dri/hardware_display_controller.h"
9
10 namespace ui {
11
12 PageFlipEventHandler::PageFlipEventHandler()
13 : base::Thread("PageFlipEventHandler"),
14 child_message_loop_proxy_(base::MessageLoopProxy::current()) {
15 base::Thread::Options options;
16 options.message_loop_type = base::MessageLoop::TYPE_IO;
17 StartWithOptions(options);
18 SetPriority(base::kThreadPriority_Background);
19 }
20
21 PageFlipEventHandler::~PageFlipEventHandler() {
22 }
23
24 void PageFlipEventHandler::GetPageFlipCompleted(
25 HardwareDisplayController* controller,
26 const ui::SurfaceOzoneEGL::PageFlipCompletionCallback& callback) {
27 message_loop_proxy()->PostTask(
28 FROM_HERE, base::Bind(&PageFlipEventHandler::CheckPageFlipEvent, this,
29 controller, callback));
30 }
31
32 void PageFlipEventHandler::CleanUp() {
33 SetThreadWasQuitProperly(true);
34 }
35
36 void PageFlipEventHandler::RunFlipEventCallBack(
37 const ui::SurfaceOzoneEGL::PageFlipCompletionCallback& callback) {
38 callback.Run();
39 }
40
41 void PageFlipEventHandler::CheckPageFlipEvent(
42 PageFlipEventHandler* data,
43 HardwareDisplayController* controller,
44 const ui::SurfaceOzoneEGL::PageFlipCompletionCallback& callback) {
45 controller->WaitForPageFlipEvent();
alexst (slow to review) 2014/12/17 19:12:24 Hi Kalyan, thank you for your help, this is very u
46 data->child_message_loop_proxy_->PostTask(
47 FROM_HERE,
48 base::Bind(&PageFlipEventHandler::RunFlipEventCallBack, callback));
49 }
50
51 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/page_flip_event_handler.h ('k') | ui/ozone/platform/egltest/ozone_platform_egltest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698