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 "android_webview/browser/global_tile_manager.h" | 8 #include "android_webview/browser/global_tile_manager.h" |
9 #include "android_webview/browser/global_tile_manager_client.h" | 9 #include "android_webview/browser/global_tile_manager_client.h" |
10 #include "android_webview/browser/parent_compositor_draw_constraints.h" | 10 #include "android_webview/browser/parent_compositor_draw_constraints.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 | 54 |
55 // Interface for all the WebView-specific content rendering operations. | 55 // Interface for all the WebView-specific content rendering operations. |
56 // Provides software and hardware rendering and the Capture Picture API. | 56 // Provides software and hardware rendering and the Capture Picture API. |
57 class BrowserViewRenderer : public content::SynchronousCompositorClient, | 57 class BrowserViewRenderer : public content::SynchronousCompositorClient, |
58 public GlobalTileManagerClient { | 58 public GlobalTileManagerClient { |
59 public: | 59 public: |
60 static void CalculateTileMemoryPolicy(); | 60 static void CalculateTileMemoryPolicy(); |
61 | 61 |
62 BrowserViewRenderer( | 62 BrowserViewRenderer( |
63 BrowserViewRendererClient* client, | 63 BrowserViewRendererClient* client, |
64 SharedRendererState* shared_renderer_state, | |
65 content::WebContents* web_contents, | 64 content::WebContents* web_contents, |
66 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner); | 65 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner); |
67 | 66 |
68 virtual ~BrowserViewRenderer(); | 67 virtual ~BrowserViewRenderer(); |
69 | 68 |
69 SharedRendererState* GetSharedRendererState(); | |
70 bool RequestDrawGL(jobject canvas, bool wait_for_completion); | |
71 | |
70 // Main handler for view drawing: performs a SW draw immediately, or sets up | 72 // Main handler for view drawing: performs a SW draw immediately, or sets up |
71 // a subsequent GL Draw (via BrowserViewRendererClient::RequestDrawGL) and | 73 // a subsequent GL Draw (via BrowserViewRendererClient::RequestDrawGL) and |
72 // returns true. A false return value indicates nothing was or will be drawn. | 74 // returns true. A false return value indicates nothing was or will be drawn. |
73 // |java_canvas| is the target of the draw. |is_hardware_canvas| indicates | 75 // |java_canvas| is the target of the draw. |is_hardware_canvas| indicates |
74 // a GL Draw maybe possible on this canvas. |scroll| if the view's current | 76 // a GL Draw maybe possible on this canvas. |scroll| if the view's current |
75 // scroll offset. |clip| is the canvas's clip bounds. |global_visible_rect| | 77 // scroll offset. |clip| is the canvas's clip bounds. |global_visible_rect| |
76 // is the intersection of the view size and the window in window coordinates. | 78 // is the intersection of the view size and the window in window coordinates. |
77 bool OnDraw(jobject java_canvas, | 79 bool OnDraw(jobject java_canvas, |
78 bool is_hardware_canvas, | 80 bool is_hardware_canvas, |
79 const gfx::Vector2d& scroll, | 81 const gfx::Vector2d& scroll, |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
181 content::SynchronousCompositorMemoryPolicy policy); | 183 content::SynchronousCompositorMemoryPolicy policy); |
182 | 184 |
183 gfx::Vector2d max_scroll_offset() const; | 185 gfx::Vector2d max_scroll_offset() const; |
184 | 186 |
185 content::SynchronousCompositorMemoryPolicy CalculateDesiredMemoryPolicy(); | 187 content::SynchronousCompositorMemoryPolicy CalculateDesiredMemoryPolicy(); |
186 // For debug tracing or logging. Return the string representation of this | 188 // For debug tracing or logging. Return the string representation of this |
187 // view renderer's state. | 189 // view renderer's state. |
188 std::string ToString() const; | 190 std::string ToString() const; |
189 | 191 |
190 BrowserViewRendererClient* client_; | 192 BrowserViewRendererClient* client_; |
191 SharedRendererState* shared_renderer_state_; | 193 // BrowserViewRenderer owns SharedRendererState. |
boliu
2014/10/24 22:12:01
Don't need this, that's obvious.
hush (inactive)
2014/10/24 22:30:15
Done.
| |
194 SharedRendererState shared_renderer_state_; | |
192 content::WebContents* web_contents_; | 195 content::WebContents* web_contents_; |
193 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 196 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
194 | 197 |
195 content::SynchronousCompositor* compositor_; | 198 content::SynchronousCompositor* compositor_; |
196 | 199 |
197 bool is_paused_; | 200 bool is_paused_; |
198 bool view_visible_; | 201 bool view_visible_; |
199 bool window_visible_; // Only applicable if |attached_to_window_| is true. | 202 bool window_visible_; // Only applicable if |attached_to_window_| is true. |
200 bool attached_to_window_; | 203 bool attached_to_window_; |
201 bool hardware_enabled_; | 204 bool hardware_enabled_; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
242 | 245 |
243 GlobalTileManager::Key tile_manager_key_; | 246 GlobalTileManager::Key tile_manager_key_; |
244 content::SynchronousCompositorMemoryPolicy memory_policy_; | 247 content::SynchronousCompositorMemoryPolicy memory_policy_; |
245 | 248 |
246 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); | 249 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); |
247 }; | 250 }; |
248 | 251 |
249 } // namespace android_webview | 252 } // namespace android_webview |
250 | 253 |
251 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ | 254 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ |
OLD | NEW |