| 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 struct ParentCompositorDrawConstraints; | 14 struct ParentCompositorDrawConstraints; |
| 15 | 15 |
| 16 class BrowserViewRendererClient { | 16 class BrowserViewRendererClient { |
| 17 public: | 17 public: |
| 18 // Request DrawGL to be in called AwDrawGLInfo::kModeProcess type. | 18 // Request DrawGL to be in called AwDrawGLInfo::kModeProcess type. |
| 19 // |wait_for_completion| will cause the call to block until DrawGL has | 19 // |wait_for_completion| will cause the call to block until DrawGL has |
| 20 // happened. The callback may never be made, and the mode may be promoted to | 20 // happened. The callback may never be made, and the mode may be promoted to |
| 21 // kModeDraw. | 21 // kModeDraw. |
| 22 virtual bool RequestDrawGL(bool wait_for_completion) = 0; | 22 virtual bool RequestDrawGL(bool wait_for_completion) = 0; |
| 23 | 23 |
| 24 // Called when a new Picture is available. Needs to be enabled | 24 // Called when a new Picture is available. Needs to be enabled |
| 25 // via the EnableOnNewPicture method. | 25 // via the EnableOnNewPicture method. |
| 26 virtual void OnNewPicture() = 0; | 26 virtual void OnNewPicture() = 0; |
| 27 | 27 |
| 28 // Called to trigger view invalidations. | 28 // Called to trigger view invalidations. |
| 29 // This calls postInvalidateOnAnimation if outside of a vsync, otherwise it |
| 30 // calls invalidate. |
| 29 virtual void PostInvalidate() = 0; | 31 virtual void PostInvalidate() = 0; |
| 30 | 32 |
| 31 // Call postInvalidateOnAnimation for invalidations. This is only used to | 33 // Call postInvalidateOnAnimation for invalidations. This is only used to |
| 32 // synchronize draw functor destruction. | 34 // synchronize draw functor destruction. |
| 33 virtual void DetachFunctorFromView() = 0; | 35 virtual void DetachFunctorFromView() = 0; |
| 34 | 36 |
| 35 // Called to get view's absolute location on the screen. | 37 // Called to get view's absolute location on the screen. |
| 36 virtual gfx::Point GetLocationOnScreen() = 0; | 38 virtual gfx::Point GetLocationOnScreen() = 0; |
| 37 | 39 |
| 38 // Try to set the view's scroll offset to |new_value|. | 40 // Try to set the view's scroll offset to |new_value|. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 61 virtual void ParentDrawConstraintsUpdated( | 63 virtual void ParentDrawConstraintsUpdated( |
| 62 const ParentCompositorDrawConstraints& draw_constraints) = 0; | 64 const ParentCompositorDrawConstraints& draw_constraints) = 0; |
| 63 | 65 |
| 64 protected: | 66 protected: |
| 65 virtual ~BrowserViewRendererClient() {} | 67 virtual ~BrowserViewRendererClient() {} |
| 66 }; | 68 }; |
| 67 | 69 |
| 68 } // namespace android_webview | 70 } // namespace android_webview |
| 69 | 71 |
| 70 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_CLIENT_H_ | 72 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_CLIENT_H_ |
| OLD | NEW |