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

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

Issue 287993004: [Android WebView] Implement Ubercomp for Render Thread support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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/shared_renderer_state.h" 10 #include "android_webview/browser/shared_renderer_state.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // 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.
75 // |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
76 // 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
77 // 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|
78 // 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.
79 bool OnDraw(jobject java_canvas, 79 bool OnDraw(jobject java_canvas,
80 bool is_hardware_canvas, 80 bool is_hardware_canvas,
81 const gfx::Vector2d& scroll, 81 const gfx::Vector2d& scroll,
82 const gfx::Rect& global_visible_rect, 82 const gfx::Rect& global_visible_rect,
83 const gfx::Rect& clip); 83 const gfx::Rect& clip);
84 void DidDrawGL(const DrawGLResult& result); 84 void DidDrawGL(scoped_ptr<DrawGLResult> result);
85 void DidDrawDelegated(scoped_ptr<DrawGLResult> result);
85 86
86 // CapturePicture API methods. 87 // CapturePicture API methods.
87 skia::RefPtr<SkPicture> CapturePicture(int width, int height); 88 skia::RefPtr<SkPicture> CapturePicture(int width, int height);
88 void EnableOnNewPicture(bool enabled); 89 void EnableOnNewPicture(bool enabled);
89 90
90 void ClearView(); 91 void ClearView();
91 92
92 // View update notifications. 93 // View update notifications.
93 void SetIsPaused(bool paused); 94 void SetIsPaused(bool paused);
94 void SetViewVisibility(bool visible); 95 void SetViewVisibility(bool visible);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 // invalidates appropriately. If |force_invalidate| is true, then send a view 147 // invalidates appropriately. If |force_invalidate| is true, then send a view
147 // invalidate regardless of compositor expectation. 148 // invalidate regardless of compositor expectation.
148 void EnsureContinuousInvalidation(bool force_invalidate); 149 void EnsureContinuousInvalidation(bool force_invalidate);
149 bool DrawSWInternal(jobject java_canvas, const gfx::Rect& clip_bounds); 150 bool DrawSWInternal(jobject java_canvas, const gfx::Rect& clip_bounds);
150 bool CompositeSW(SkCanvas* canvas); 151 bool CompositeSW(SkCanvas* canvas);
151 void DidComposite(bool force_invalidate); 152 void DidComposite(bool force_invalidate);
152 scoped_ptr<base::Value> RootLayerStateAsValue( 153 scoped_ptr<base::Value> RootLayerStateAsValue(
153 const gfx::Vector2dF& total_scroll_offset_dip, 154 const gfx::Vector2dF& total_scroll_offset_dip,
154 const gfx::SizeF& scrollable_size_dip); 155 const gfx::SizeF& scrollable_size_dip);
155 156
157 bool OnDrawHardwareLegacy(jobject java_canvas);
158 bool OnDrawHardware(jobject java_canvas);
159 void ReturnResources();
160
156 // If we call up view invalidate and OnDraw is not called before a deadline, 161 // If we call up view invalidate and OnDraw is not called before a deadline,
157 // then we keep ticking the SynchronousCompositor so it can make progress. 162 // then we keep ticking the SynchronousCompositor so it can make progress.
158 void FallbackTickFired(); 163 void FallbackTickFired();
159 164
160 // Force invoke the compositor to run produce a 1x1 software frame that is 165 // Force invoke the compositor to run produce a 1x1 software frame that is
161 // immediately discarded. This is a hack to force invoke parts of the 166 // immediately discarded. This is a hack to force invoke parts of the
162 // compositor that are not directly exposed here. 167 // compositor that are not directly exposed here.
163 void ForceFakeCompositeSW(); 168 void ForceFakeCompositeSW();
164 169
165 void EnforceMemoryPolicyImmediately( 170 void EnforceMemoryPolicyImmediately(
(...skipping 16 matching lines...) Expand all
182 base::WeakPtrFactory<BrowserViewRenderer> weak_factory_on_ui_thread_; 187 base::WeakPtrFactory<BrowserViewRenderer> weak_factory_on_ui_thread_;
183 base::WeakPtr<BrowserViewRenderer> ui_thread_weak_ptr_; 188 base::WeakPtr<BrowserViewRenderer> ui_thread_weak_ptr_;
184 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; 189 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
185 190
186 bool has_compositor_; 191 bool has_compositor_;
187 192
188 bool is_paused_; 193 bool is_paused_;
189 bool view_visible_; 194 bool view_visible_;
190 bool window_visible_; // Only applicable if |attached_to_window_| is true. 195 bool window_visible_; // Only applicable if |attached_to_window_| is true.
191 bool attached_to_window_; 196 bool attached_to_window_;
197 bool hardware_enabled_;
192 float dip_scale_; 198 float dip_scale_;
193 float page_scale_factor_; 199 float page_scale_factor_;
194 bool on_new_picture_enable_; 200 bool on_new_picture_enable_;
195 bool clear_view_; 201 bool clear_view_;
202 gfx::Vector2d scroll_offset_;
mkosiba (inactive) 2014/05/19 20:01:16 I'd prefer we call this something like last_on_dra
boliu 2014/05/19 23:13:01 Done, changed global_visible_rect_ too
203 gfx::Rect global_visible_rect_;
196 204
197 // When true, we should continuously invalidate and keep drawing, for example 205 // When true, we should continuously invalidate and keep drawing, for example
198 // to drive animation. This value is set by the compositor and should always 206 // to drive animation. This value is set by the compositor and should always
199 // reflect the expectation of the compositor and not be reused for other 207 // reflect the expectation of the compositor and not be reused for other
200 // states. 208 // states.
201 bool compositor_needs_continuous_invalidate_; 209 bool compositor_needs_continuous_invalidate_;
202 210
203 // Used to block additional invalidates while one is already pending. 211 // Used to block additional invalidates while one is already pending.
204 bool block_invalidates_; 212 bool block_invalidates_;
205 213
206 // Holds a callback to FallbackTickFired while it is pending. 214 // Holds a callback to FallbackTickFired while it is pending.
207 base::CancelableClosure fallback_tick_; 215 base::CancelableClosure fallback_tick_;
208 216
209 int width_; 217 int width_;
210 int height_; 218 int height_;
211 219
212 DrawGLInput draw_gl_input_;
213
214 // Current scroll offset in CSS pixels. 220 // Current scroll offset in CSS pixels.
215 gfx::Vector2dF scroll_offset_dip_; 221 gfx::Vector2dF scroll_offset_dip_;
216 222
217 // Max scroll offset in CSS pixels. 223 // Max scroll offset in CSS pixels.
218 gfx::Vector2dF max_scroll_offset_dip_; 224 gfx::Vector2dF max_scroll_offset_dip_;
219 225
220 // Used to prevent rounding errors from accumulating enough to generate 226 // Used to prevent rounding errors from accumulating enough to generate
221 // visible skew (especially noticeable when scrolling up and down in the same 227 // visible skew (especially noticeable when scrolling up and down in the same
222 // spot over a period of time). 228 // spot over a period of time).
223 gfx::Vector2dF overscroll_rounding_error_; 229 gfx::Vector2dF overscroll_rounding_error_;
(...skipping 10 matching lines...) Expand all
234 // used on data that must be modified immediately instead of being posted 240 // used on data that must be modified immediately instead of being posted
235 // back to UI. 241 // back to UI.
236 base::Lock render_thread_lock_; 242 base::Lock render_thread_lock_;
237 243
238 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); 244 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer);
239 }; 245 };
240 246
241 } // namespace android_webview 247 } // namespace android_webview
242 248
243 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ 249 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698