OLD | NEW |
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 #ifndef ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_CLIENT_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_CLIENT_H_ |
6 #define ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_CLIENT_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_CLIENT_H_ |
7 | 7 |
8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
9 #include "ui/gfx/geometry/point.h" | 9 #include "ui/gfx/geometry/point.h" |
10 #include "ui/gfx/geometry/size_f.h" | 10 #include "ui/gfx/geometry/size_f.h" |
11 #include "ui/gfx/geometry/vector2d_f.h" | 11 #include "ui/gfx/geometry/vector2d_f.h" |
12 | 12 |
13 namespace android_webview { | 13 namespace android_webview { |
14 | 14 |
15 class BrowserViewRendererClient { | 15 class BrowserViewRendererClient { |
16 public: | 16 public: |
17 // Request DrawGL to be in called AwDrawGLInfo::kModeProcess type. | 17 // Request DrawGL to be in called AwDrawGLInfo::kModeProcess type. |
18 // |wait_for_completion| will cause the call to block until DrawGL has | 18 // |wait_for_completion| will cause the call to block until DrawGL has |
19 // happened. The callback may never be made, and the mode may be promoted to | 19 // happened. The callback may never be made, and the mode may be promoted to |
20 // kModeDraw. | 20 // kModeDraw. |
21 virtual bool RequestDrawGL(bool wait_for_completion) = 0; | 21 virtual bool RequestDrawGL(bool wait_for_completion) = 0; |
22 | 22 |
23 // Called when a new Picture is available. Needs to be enabled | 23 // Called when a new Picture is available. Needs to be enabled |
24 // via the EnableOnNewPicture method. | 24 // via the EnableOnNewPicture method. |
25 virtual void OnNewPicture() = 0; | 25 virtual void OnNewPicture() = 0; |
26 | 26 |
27 // Called to trigger view invalidations. | 27 // Called to trigger view invalidations. |
| 28 // This calls postInvalidateOnAnimation if outside of a vsync, otherwise it |
| 29 // calls invalidate. |
28 virtual void PostInvalidate() = 0; | 30 virtual void PostInvalidate() = 0; |
29 | 31 |
30 // Call postInvalidateOnAnimation for invalidations. This is only used to | 32 // Call postInvalidateOnAnimation for invalidations. This is only used to |
31 // synchronize draw functor destruction. | 33 // synchronize draw functor destruction. |
32 virtual void InvalidateOnFunctorDestroy() = 0; | 34 virtual void InvalidateOnFunctorDestroy() = 0; |
33 | 35 |
34 // Called to get view's absolute location on the screen. | 36 // Called to get view's absolute location on the screen. |
35 virtual gfx::Point GetLocationOnScreen() = 0; | 37 virtual gfx::Point GetLocationOnScreen() = 0; |
36 | 38 |
37 // Try to set the view's scroll offset to |new_value|. | 39 // Try to set the view's scroll offset to |new_value|. |
(...skipping 16 matching lines...) Expand all Loading... |
54 // Handle overscroll. | 56 // Handle overscroll. |
55 virtual void DidOverscroll(gfx::Vector2d overscroll_delta) = 0; | 57 virtual void DidOverscroll(gfx::Vector2d overscroll_delta) = 0; |
56 | 58 |
57 protected: | 59 protected: |
58 virtual ~BrowserViewRendererClient() {} | 60 virtual ~BrowserViewRendererClient() {} |
59 }; | 61 }; |
60 | 62 |
61 } // namespace android_webview | 63 } // namespace android_webview |
62 | 64 |
63 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_CLIENT_H_ | 65 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_CLIENT_H_ |
OLD | NEW |