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

Unified Diff: ui/ozone/platform/dri/dri_vsync_provider.cc

Issue 469343003: [Ozone-GBM] Pumb DriWindowDelegate throughout the platform (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unittest && rebase Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/dri/dri_vsync_provider.h ('k') | ui/ozone/platform/dri/dri_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/dri_vsync_provider.cc
diff --git a/ui/ozone/platform/dri/dri_vsync_provider.cc b/ui/ozone/platform/dri/dri_vsync_provider.cc
index 6679d38937c5e3cda28ddf05b5b5a4e648263baf..3888d40eb27883b5314d1b163d134c8cd340761d 100644
--- a/ui/ozone/platform/dri/dri_vsync_provider.cc
+++ b/ui/ozone/platform/dri/dri_vsync_provider.cc
@@ -5,32 +5,33 @@
#include "ui/ozone/platform/dri/dri_vsync_provider.h"
#include "base/time/time.h"
+#include "ui/ozone/platform/dri/dri_window_delegate.h"
#include "ui/ozone/platform/dri/hardware_display_controller.h"
namespace ui {
-DriVSyncProvider::DriVSyncProvider(
- const base::WeakPtr<HardwareDisplayController>& controller)
- : controller_(controller) {
+DriVSyncProvider::DriVSyncProvider(DriWindowDelegate* window_delegate)
+ : window_delegate_(window_delegate) {
}
DriVSyncProvider::~DriVSyncProvider() {}
void DriVSyncProvider::GetVSyncParameters(const UpdateVSyncCallback& callback) {
- if (!controller_)
+ HardwareDisplayController* controller = window_delegate_->GetController();
+ if (!controller)
return;
// The value is invalid, so we can't update the parameters.
- if (controller_->get_time_of_last_flip() == 0 ||
- controller_->get_mode().vrefresh == 0)
+ if (controller->get_time_of_last_flip() == 0 ||
+ controller->get_mode().vrefresh == 0)
return;
// Stores the time of the last refresh.
base::TimeTicks timebase =
- base::TimeTicks::FromInternalValue(controller_->get_time_of_last_flip());
+ base::TimeTicks::FromInternalValue(controller->get_time_of_last_flip());
// Stores the refresh rate.
base::TimeDelta interval =
- base::TimeDelta::FromSeconds(1) / controller_->get_mode().vrefresh;
+ base::TimeDelta::FromSeconds(1) / controller->get_mode().vrefresh;
callback.Run(timebase, interval);
}
« no previous file with comments | « ui/ozone/platform/dri/dri_vsync_provider.h ('k') | ui/ozone/platform/dri/dri_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698