| 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 virtual void PostInvalidate() = 0; | 28 virtual void PostInvalidate() = 0; |
| 29 | 29 |
| 30 // Call postInvalidateOnAnimation for invalidations. This is only used to |
| 31 // synchronize draw functor destruction. |
| 32 virtual void InvalidateOnFunctorDestroy() = 0; |
| 33 |
| 30 // Called to update the parent draw constraints in browser view renderer. | 34 // Called to update the parent draw constraints in browser view renderer. |
| 31 virtual void UpdateParentDrawConstraints() = 0; | 35 virtual void UpdateParentDrawConstraints() = 0; |
| 32 | 36 |
| 33 // Called if commit is skipped due to pipeline stall. | 37 // Called if commit is skipped due to pipeline stall. |
| 34 virtual void DidSkipCommitFrame() = 0; | 38 virtual void DidSkipCommitFrame() = 0; |
| 35 | 39 |
| 36 // Called to get view's absolute location on the screen. | 40 // Called to get view's absolute location on the screen. |
| 37 virtual gfx::Point GetLocationOnScreen() = 0; | 41 virtual gfx::Point GetLocationOnScreen() = 0; |
| 38 | 42 |
| 39 // Try to set the view's scroll offset to |new_value|. | 43 // Try to set the view's scroll offset to |new_value|. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 56 // Handle overscroll. | 60 // Handle overscroll. |
| 57 virtual void DidOverscroll(gfx::Vector2d overscroll_delta) = 0; | 61 virtual void DidOverscroll(gfx::Vector2d overscroll_delta) = 0; |
| 58 | 62 |
| 59 protected: | 63 protected: |
| 60 virtual ~BrowserViewRendererClient() {} | 64 virtual ~BrowserViewRendererClient() {} |
| 61 }; | 65 }; |
| 62 | 66 |
| 63 } // namespace android_webview | 67 } // namespace android_webview |
| 64 | 68 |
| 65 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_CLIENT_H_ | 69 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_CLIENT_H_ |
| OLD | NEW |