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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
123 const gfx::Vector2dF& max_scroll_offset_dip, | 123 const gfx::Vector2dF& max_scroll_offset_dip, |
124 const gfx::SizeF& scrollable_size_dip, | 124 const gfx::SizeF& scrollable_size_dip, |
125 float page_scale_factor, | 125 float page_scale_factor, |
126 float min_page_scale_factor, | 126 float min_page_scale_factor, |
127 float max_page_scale_factor) override; | 127 float max_page_scale_factor) override; |
128 void DidOverscroll(content::SynchronousCompositor* compositor, | 128 void DidOverscroll(content::SynchronousCompositor* compositor, |
129 const gfx::Vector2dF& accumulated_overscroll, | 129 const gfx::Vector2dF& accumulated_overscroll, |
130 const gfx::Vector2dF& latest_overscroll_delta, | 130 const gfx::Vector2dF& latest_overscroll_delta, |
131 const gfx::Vector2dF& current_fling_velocity) override; | 131 const gfx::Vector2dF& current_fling_velocity) override; |
132 ui::TouchHandleDrawable* CreateDrawable() override; | 132 ui::TouchHandleDrawable* CreateDrawable() override; |
133 void OnDrawHardwareProcessFrameFuture( | |
134 const scoped_refptr<content::SynchronousCompositor::FrameFuture>& | |
135 frame_future) override; | |
136 | 133 |
137 // CompositorFrameProducer overrides | 134 // CompositorFrameProducer overrides |
138 void OnParentDrawConstraintsUpdated( | 135 void OnParentDrawConstraintsUpdated( |
139 CompositorFrameConsumer* compositor_frame_consumer) override; | 136 CompositorFrameConsumer* compositor_frame_consumer) override; |
140 void RemoveCompositorFrameConsumer( | 137 void RemoveCompositorFrameConsumer( |
141 CompositorFrameConsumer* compositor_frame_consumer) override; | 138 CompositorFrameConsumer* compositor_frame_consumer) override; |
142 | 139 |
143 void SetActiveCompositorID(const CompositorID& compositor_id); | 140 void SetActiveCompositorID(const CompositorID& compositor_id); |
144 | 141 |
145 // Visible for testing. | 142 // Visible for testing. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 bool hardware_enabled_; | 194 bool hardware_enabled_; |
198 float dip_scale_; | 195 float dip_scale_; |
199 float page_scale_factor_; | 196 float page_scale_factor_; |
200 float min_page_scale_factor_; | 197 float min_page_scale_factor_; |
201 float max_page_scale_factor_; | 198 float max_page_scale_factor_; |
202 bool on_new_picture_enable_; | 199 bool on_new_picture_enable_; |
203 bool clear_view_; | 200 bool clear_view_; |
204 | 201 |
205 bool offscreen_pre_raster_; | 202 bool offscreen_pre_raster_; |
206 | 203 |
204 // Must do a synchronous draw first to ensure GL bindings are intialized. | |
dcheng
2016/10/21 22:20:12
Nit: initialized, though that will push this line
boliu
2016/10/24 15:57:23
Nah, this line is only 75 chars :p
Done.
| |
205 // TODO(boliu): Wait on render thread and remove this. | |
206 bool allow_async_draw_; | |
207 | |
207 gfx::Vector2d last_on_draw_scroll_offset_; | 208 gfx::Vector2d last_on_draw_scroll_offset_; |
208 gfx::Rect last_on_draw_global_visible_rect_; | 209 gfx::Rect last_on_draw_global_visible_rect_; |
209 | 210 |
210 gfx::Size size_; | 211 gfx::Size size_; |
211 | 212 |
212 gfx::SizeF scrollable_size_dip_; | 213 gfx::SizeF scrollable_size_dip_; |
213 | 214 |
214 // Current scroll offset in CSS pixels. | 215 // Current scroll offset in CSS pixels. |
215 // TODO(miletus): Make scroll_offset_dip_ a gfx::ScrollOffset. | 216 // TODO(miletus): Make scroll_offset_dip_ a gfx::ScrollOffset. |
216 gfx::Vector2dF scroll_offset_dip_; | 217 gfx::Vector2dF scroll_offset_dip_; |
217 | 218 |
218 // Max scroll offset in CSS pixels. | 219 // Max scroll offset in CSS pixels. |
219 // TODO(miletus): Make max_scroll_offset_dip_ a gfx::ScrollOffset. | 220 // TODO(miletus): Make max_scroll_offset_dip_ a gfx::ScrollOffset. |
220 gfx::Vector2dF max_scroll_offset_dip_; | 221 gfx::Vector2dF max_scroll_offset_dip_; |
221 | 222 |
222 // Used to prevent rounding errors from accumulating enough to generate | 223 // Used to prevent rounding errors from accumulating enough to generate |
223 // visible skew (especially noticeable when scrolling up and down in the same | 224 // visible skew (especially noticeable when scrolling up and down in the same |
224 // spot over a period of time). | 225 // spot over a period of time). |
225 // TODO(miletus): Make overscroll_rounding_error_ a gfx::ScrollOffset. | 226 // TODO(miletus): Make overscroll_rounding_error_ a gfx::ScrollOffset. |
226 gfx::Vector2dF overscroll_rounding_error_; | 227 gfx::Vector2dF overscroll_rounding_error_; |
227 | 228 |
228 ParentCompositorDrawConstraints external_draw_constraints_; | 229 ParentCompositorDrawConstraints external_draw_constraints_; |
229 | 230 |
230 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); | 231 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); |
231 }; | 232 }; |
232 | 233 |
233 } // namespace android_webview | 234 } // namespace android_webview |
234 | 235 |
235 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ | 236 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ |
OLD | NEW |