1 // Copyright 2013 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 #ifndef UI_GFX_VSYNC_PROVIDER_H_ 6 #define UI_GFX_VSYNC_PROVIDER_H_ 7 8 #include "base/callback.h" 9 #include "base/time/time.h" 10 #include "ui/gfx/gfx_export.h" 11 12 namespace gfx { 13 14 class GFX_EXPORT VSyncProvider { 15 public: 16 virtual ~VSyncProvider() {} 17 18 typedef base::Callback< 19 void(const base::TimeTicks timebase, const base::TimeDelta interval)> 20 UpdateVSyncCallback; 21 22 // Get the time of the most recent screen refresh, along with the time 23 // between consecutive refreshes. The callback is called as soon as 24 // the data is available: it could be immediately from this method, 25 // later via a PostTask to the current MessageLoop, or never (if we have 26 // no data source). We provide the strong guarantee that the callback will 27 // not be called once the instance of this class is destroyed. 28 virtual void GetVSyncParameters(const UpdateVSyncCallback& callback) = 0; 29 }; 30 31 } // namespace gfx 32 33 #endif // UI_GFX_VSYNC_PROVIDER_H_ 34