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

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

Issue 938873002: Add a new API to create a surfaceless GLSurface for Ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix swapbuffers & overlay scheduling Created 5 years, 10 months 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
« ui/gl/gl_surface_ozone.cc ('K') | « ui/gl/gl_surface_ozone.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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/ozone/platform/dri/dri_vsync_provider.h" 5 #include "ui/ozone/platform/dri/dri_vsync_provider.h"
6 6
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #include "ui/ozone/platform/dri/dri_window_delegate.h" 8 #include "ui/ozone/platform/dri/dri_window_delegate.h"
9 #include "ui/ozone/platform/dri/hardware_display_controller.h" 9 #include "ui/ozone/platform/dri/hardware_display_controller.h"
10 10
11 namespace ui { 11 namespace ui {
12 12
13 DriVSyncProvider::DriVSyncProvider(DriWindowDelegate* window_delegate) 13 DriVSyncProvider::DriVSyncProvider(DriWindowDelegate* window_delegate)
14 : window_delegate_(window_delegate) { 14 : window_delegate_(window_delegate) {
15 } 15 }
16 16
17 DriVSyncProvider::~DriVSyncProvider() {} 17 DriVSyncProvider::~DriVSyncProvider() {}
18 18
19 void DriVSyncProvider::GetVSyncParameters(const UpdateVSyncCallback& callback) { 19 void DriVSyncProvider::GetVSyncParameters(const UpdateVSyncCallback& callback) {
20 HardwareDisplayController* controller = window_delegate_->GetController(); 20 HardwareDisplayController* controller = window_delegate_->GetController();
21 if (!controller) 21 if (!controller)
22 return; 22 return;
23 23
24 // The value is invalid, so we can't update the parameters. 24 // The value is invalid, so we can't update the parameters.
25 if (controller->GetTimeOfLastFlip() == 0 || 25 if (controller->GetTimeOfLastFlip() == 0 ||
26 controller->get_mode().vrefresh == 0) 26 controller->get_mode().vrefresh == 0) {
27 callback.Run(base::TimeTicks(),
dnicoara 2015/02/23 22:48:26 Why do you need this?
achaulk 2015/02/23 22:50:17 Dropping the callback causes a deadlock
dnicoara 2015/02/24 16:46:53 We should look into what's causing the deadlock. T
28 base::TimeDelta::FromSecondsD(1.0f / 60.0f));
27 return; 29 return;
30 }
28 31
29 // Stores the time of the last refresh. 32 // Stores the time of the last refresh.
30 base::TimeTicks timebase = 33 base::TimeTicks timebase =
31 base::TimeTicks::FromInternalValue(controller->GetTimeOfLastFlip()); 34 base::TimeTicks::FromInternalValue(controller->GetTimeOfLastFlip());
32 // Stores the refresh rate. 35 // Stores the refresh rate.
33 base::TimeDelta interval = 36 base::TimeDelta interval =
34 base::TimeDelta::FromSeconds(1) / controller->get_mode().vrefresh; 37 base::TimeDelta::FromSeconds(1) / controller->get_mode().vrefresh;
35 38
36 callback.Run(timebase, interval); 39 callback.Run(timebase, interval);
37 } 40 }
38 41
39 } // namespace ui 42 } // namespace ui
OLDNEW
« ui/gl/gl_surface_ozone.cc ('K') | « ui/gl/gl_surface_ozone.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698