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

Side by Side Diff: ui/base/android/window_android.h

Issue 611313003: Use estimated vsync period on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused constant Created 6 years, 2 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 #ifndef UI_BASE_ANDROID_WINDOW_ANDROID_H_ 5 #ifndef UI_BASE_ANDROID_WINDOW_ANDROID_H_
6 #define UI_BASE_ANDROID_WINDOW_ANDROID_H_ 6 #define UI_BASE_ANDROID_WINDOW_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <vector> 9 #include <vector>
10 #include "base/android/jni_weak_ref.h" 10 #include "base/android/jni_weak_ref.h"
11 #include "base/android/scoped_java_ref.h" 11 #include "base/android/scoped_java_ref.h"
12 #include "base/observer_list.h" 12 #include "base/observer_list.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "ui/base/ui_base_export.h" 14 #include "ui/base/ui_base_export.h"
15 #include "ui/gfx/vector2d_f.h" 15 #include "ui/gfx/vector2d_f.h"
16 16
17 namespace ui { 17 namespace ui {
18 18
19 class WindowAndroidCompositor; 19 class WindowAndroidCompositor;
20 class WindowAndroidObserver; 20 class WindowAndroidObserver;
21 21
22 // Android implementation of the activity window. 22 // Android implementation of the activity window.
23 class UI_BASE_EXPORT WindowAndroid { 23 class UI_BASE_EXPORT WindowAndroid {
24 public: 24 public:
25 WindowAndroid(JNIEnv* env, jobject obj, jlong vsync_period); 25 WindowAndroid(JNIEnv* env, jobject obj);
26 26
27 void Destroy(JNIEnv* env, jobject obj); 27 void Destroy(JNIEnv* env, jobject obj);
28 28
29 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); 29 base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
30 30
31 static bool RegisterWindowAndroid(JNIEnv* env); 31 static bool RegisterWindowAndroid(JNIEnv* env);
32 32
33 // The content offset is used to translate snapshots to the correct part of 33 // The content offset is used to translate snapshots to the correct part of
34 // the window. 34 // the window.
35 void set_content_offset(const gfx::Vector2dF& content_offset) { 35 void set_content_offset(const gfx::Vector2dF& content_offset) {
(...skipping 10 matching lines...) Expand all
46 void AttachCompositor(WindowAndroidCompositor* compositor); 46 void AttachCompositor(WindowAndroidCompositor* compositor);
47 void DetachCompositor(); 47 void DetachCompositor();
48 48
49 void AddObserver(WindowAndroidObserver* observer); 49 void AddObserver(WindowAndroidObserver* observer);
50 void RemoveObserver(WindowAndroidObserver* observer); 50 void RemoveObserver(WindowAndroidObserver* observer);
51 51
52 WindowAndroidCompositor* GetCompositor() { return compositor_; } 52 WindowAndroidCompositor* GetCompositor() { return compositor_; }
53 53
54 void RequestVSyncUpdate(); 54 void RequestVSyncUpdate();
55 void SetNeedsAnimate(); 55 void SetNeedsAnimate();
56 void OnVSync(JNIEnv* env, jobject obj, jlong time_micros); 56 void OnVSync(JNIEnv* env,
57 jobject obj,
58 jlong time_micros,
59 jlong period_micros);
57 void Animate(base::TimeTicks begin_frame_time); 60 void Animate(base::TimeTicks begin_frame_time);
58 61
59 private: 62 private:
60 ~WindowAndroid(); 63 ~WindowAndroid();
61 64
62 JavaObjectWeakGlobalRef weak_java_window_; 65 JavaObjectWeakGlobalRef weak_java_window_;
63 gfx::Vector2dF content_offset_; 66 gfx::Vector2dF content_offset_;
64 WindowAndroidCompositor* compositor_; 67 WindowAndroidCompositor* compositor_;
65 base::TimeDelta vsync_period_;
66 68
67 ObserverList<WindowAndroidObserver> observer_list_; 69 ObserverList<WindowAndroidObserver> observer_list_;
68 70
69 DISALLOW_COPY_AND_ASSIGN(WindowAndroid); 71 DISALLOW_COPY_AND_ASSIGN(WindowAndroid);
70 }; 72 };
71 73
72 } // namespace ui 74 } // namespace ui
73 75
74 #endif // UI_BASE_ANDROID_WINDOW_ANDROID_H_ 76 #endif // UI_BASE_ANDROID_WINDOW_ANDROID_H_
OLDNEW
« no previous file with comments | « ui/android/java/src/org/chromium/ui/base/WindowAndroid.java ('k') | ui/base/android/window_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698