Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Side by Side Diff: android_webview/browser/browser_view_renderer.h

Issue 655813004: Part 1: Refactor Android WebView graphics code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor
Patch Set: comments Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | android_webview/browser/browser_view_renderer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 SharedRendererState shared_renderer_state_;
192 content::WebContents* web_contents_; 194 content::WebContents* web_contents_;
193 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; 195 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
194 196
195 content::SynchronousCompositor* compositor_; 197 content::SynchronousCompositor* compositor_;
196 198
197 bool is_paused_; 199 bool is_paused_;
198 bool view_visible_; 200 bool view_visible_;
199 bool window_visible_; // Only applicable if |attached_to_window_| is true. 201 bool window_visible_; // Only applicable if |attached_to_window_| is true.
200 bool attached_to_window_; 202 bool attached_to_window_;
201 bool hardware_enabled_; 203 bool hardware_enabled_;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 244
243 GlobalTileManager::Key tile_manager_key_; 245 GlobalTileManager::Key tile_manager_key_;
244 content::SynchronousCompositorMemoryPolicy memory_policy_; 246 content::SynchronousCompositorMemoryPolicy memory_policy_;
245 247
246 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); 248 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer);
247 }; 249 };
248 250
249 } // namespace android_webview 251 } // namespace android_webview
250 252
251 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ 253 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/browser_view_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698