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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 BrowserViewRenderer( | 45 BrowserViewRenderer( |
46 BrowserViewRendererClient* client, | 46 BrowserViewRendererClient* client, |
47 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner, | 47 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner, |
48 bool disable_page_visibility); | 48 bool disable_page_visibility); |
49 | 49 |
50 ~BrowserViewRenderer() override; | 50 ~BrowserViewRenderer() override; |
51 | 51 |
52 void RegisterWithWebContents(content::WebContents* web_contents); | 52 void RegisterWithWebContents(content::WebContents* web_contents); |
53 | 53 |
| 54 void SetSharedRendererState(SharedRendererState* shared_renderer_state); |
54 SharedRendererState* GetAwDrawGLViewContext(); | 55 SharedRendererState* GetAwDrawGLViewContext(); |
55 bool RequestDrawGL(bool wait_for_completion); | 56 bool RequestDrawGL(bool wait_for_completion); |
56 | 57 |
57 // Called before either OnDrawHardware or OnDrawSoftware to set the view | 58 // Called before either OnDrawHardware or OnDrawSoftware to set the view |
58 // state of this frame. |scroll| is the view's current scroll offset. | 59 // state of this frame. |scroll| is the view's current scroll offset. |
59 // |global_visible_rect| is the intersection of the view size and the window | 60 // |global_visible_rect| is the intersection of the view size and the window |
60 // in window coordinates. | 61 // in window coordinates. |
61 void PrepareToDraw(const gfx::Vector2d& scroll, | 62 void PrepareToDraw(const gfx::Vector2d& scroll, |
62 const gfx::Rect& global_visible_rect); | 63 const gfx::Rect& global_visible_rect); |
63 | 64 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 gfx::Vector2d max_scroll_offset() const; | 139 gfx::Vector2d max_scroll_offset() const; |
139 | 140 |
140 void UpdateMemoryPolicy(); | 141 void UpdateMemoryPolicy(); |
141 | 142 |
142 uint32_t GetCompositorID(content::SynchronousCompositor* compositor); | 143 uint32_t GetCompositorID(content::SynchronousCompositor* compositor); |
143 // For debug tracing or logging. Return the string representation of this | 144 // For debug tracing or logging. Return the string representation of this |
144 // view renderer's state. | 145 // view renderer's state. |
145 std::string ToString() const; | 146 std::string ToString() const; |
146 | 147 |
147 BrowserViewRendererClient* client_; | 148 BrowserViewRendererClient* client_; |
148 SharedRendererState shared_renderer_state_; | 149 SharedRendererState* shared_renderer_state_; |
149 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 150 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
150 bool disable_page_visibility_; | 151 bool disable_page_visibility_; |
151 | 152 |
152 // The current compositor that's owned by the current RVH. | 153 // The current compositor that's owned by the current RVH. |
153 content::SynchronousCompositor* compositor_; | 154 content::SynchronousCompositor* compositor_; |
154 // A map from compositor's per-WebView unique ID to the compositor's raw | 155 // A map from compositor's per-WebView unique ID to the compositor's raw |
155 // pointer. A raw pointer here is fine because the entry will be erased when | 156 // pointer. A raw pointer here is fine because the entry will be erased when |
156 // a compositor is destroyed. | 157 // a compositor is destroyed. |
157 std::map<size_t, content::SynchronousCompositor*> compositor_map_; | 158 std::map<size_t, content::SynchronousCompositor*> compositor_map_; |
158 | 159 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 gfx::Vector2dF overscroll_rounding_error_; | 193 gfx::Vector2dF overscroll_rounding_error_; |
193 | 194 |
194 uint32_t next_compositor_id_; | 195 uint32_t next_compositor_id_; |
195 | 196 |
196 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); | 197 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); |
197 }; | 198 }; |
198 | 199 |
199 } // namespace android_webview | 200 } // namespace android_webview |
200 | 201 |
201 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ | 202 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ |
OLD | NEW |