OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ |
6 #define ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ |
7 | 7 |
8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "skia/ext/refptr.h" |
9 #include "ui/gfx/point.h" | 10 #include "ui/gfx/point.h" |
10 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
11 #include "ui/gfx/vector2d_f.h" | 12 #include "ui/gfx/vector2d_f.h" |
12 | 13 |
| 14 class SkPicture; |
13 struct AwDrawGLInfo; | 15 struct AwDrawGLInfo; |
14 struct AwDrawSWFunctionTable; | 16 struct AwDrawSWFunctionTable; |
15 | 17 |
16 namespace content { | 18 namespace content { |
17 class ContentViewCore; | 19 class ContentViewCore; |
18 } | 20 } |
19 | 21 |
20 namespace android_webview { | 22 namespace android_webview { |
21 | 23 |
22 // Interface for all the WebView-specific content rendering operations. | 24 // Interface for all the WebView-specific content rendering operations. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 const gfx::Rect& clip) = 0; | 103 const gfx::Rect& clip) = 0; |
102 | 104 |
103 // Called in response to a prior Client::RequestDrawGL() call. See | 105 // Called in response to a prior Client::RequestDrawGL() call. See |
104 // AwDrawGLInfo documentation for more details of the contract. | 106 // AwDrawGLInfo documentation for more details of the contract. |
105 virtual void DrawGL(AwDrawGLInfo* draw_info) = 0; | 107 virtual void DrawGL(AwDrawGLInfo* draw_info) = 0; |
106 | 108 |
107 // The global visible rect changed and this is the new value. | 109 // The global visible rect changed and this is the new value. |
108 virtual void SetGlobalVisibleRect(const gfx::Rect& visible_rect) = 0; | 110 virtual void SetGlobalVisibleRect(const gfx::Rect& visible_rect) = 0; |
109 | 111 |
110 // CapturePicture API methods. | 112 // CapturePicture API methods. |
111 virtual base::android::ScopedJavaLocalRef<jobject> CapturePicture( | 113 virtual skia::RefPtr<SkPicture> CapturePicture(int width, int height) = 0; |
112 int width, | |
113 int height) = 0; | |
114 virtual void EnableOnNewPicture(bool enabled) = 0; | 114 virtual void EnableOnNewPicture(bool enabled) = 0; |
115 | 115 |
116 // View update notifications. | 116 // View update notifications. |
117 virtual void OnVisibilityChanged(bool visible) = 0; | 117 virtual void OnVisibilityChanged(bool visible) = 0; |
118 virtual void OnSizeChanged(int width, int height) = 0; | 118 virtual void OnSizeChanged(int width, int height) = 0; |
119 virtual void OnAttachedToWindow(int width, int height) = 0; | 119 virtual void OnAttachedToWindow(int width, int height) = 0; |
120 virtual void OnDetachedFromWindow() = 0; | 120 virtual void OnDetachedFromWindow() = 0; |
121 | 121 |
122 // Sets the scale for logical<->physical pixel conversions. | 122 // Sets the scale for logical<->physical pixel conversions. |
123 virtual void SetDipScale(float dip_scale) = 0; | 123 virtual void SetDipScale(float dip_scale) = 0; |
124 virtual void SetPageScaleFactor(float page_scale_factor) = 0; | 124 virtual void SetPageScaleFactor(float page_scale_factor) = 0; |
125 | 125 |
126 // Set the root layer scroll offset to |new_value|. | 126 // Set the root layer scroll offset to |new_value|. |
127 virtual void ScrollTo(gfx::Vector2d new_value) = 0; | 127 virtual void ScrollTo(gfx::Vector2d new_value) = 0; |
128 | 128 |
129 // Android views hierarchy gluing. | 129 // Android views hierarchy gluing. |
130 virtual bool IsAttachedToWindow() = 0; | 130 virtual bool IsAttachedToWindow() = 0; |
131 virtual bool IsViewVisible() = 0; | 131 virtual bool IsViewVisible() = 0; |
132 virtual gfx::Rect GetScreenRect() = 0; | 132 virtual gfx::Rect GetScreenRect() = 0; |
133 | 133 |
134 virtual ~BrowserViewRenderer() {} | 134 virtual ~BrowserViewRenderer() {} |
135 }; | 135 }; |
136 | 136 |
137 } // namespace android_webview | 137 } // namespace android_webview |
138 | 138 |
139 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ | 139 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ |
OLD | NEW |