Chromium Code Reviews| 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/parent_compositor_draw_constraints.h" | 8 #include "android_webview/browser/parent_compositor_draw_constraints.h" |
| 9 #include "android_webview/browser/shared_renderer_state.h" | 9 #include "android_webview/browser/shared_renderer_state.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 | 67 |
| 68 void SetOffscreenPreRaster(bool enabled); | 68 void SetOffscreenPreRaster(bool enabled); |
| 69 | 69 |
| 70 // View update notifications. | 70 // View update notifications. |
| 71 void SetIsPaused(bool paused); | 71 void SetIsPaused(bool paused); |
| 72 void SetViewVisibility(bool visible); | 72 void SetViewVisibility(bool visible); |
| 73 void SetWindowVisibility(bool visible); | 73 void SetWindowVisibility(bool visible); |
| 74 void OnSizeChanged(int width, int height); | 74 void OnSizeChanged(int width, int height); |
| 75 void OnAttachedToWindow(int width, int height); | 75 void OnAttachedToWindow(int width, int height); |
| 76 void OnDetachedFromWindow(); | 76 void OnDetachedFromWindow(); |
| 77 void OnComputeScroll(base::TimeTicks animation_time); | |
| 77 | 78 |
| 78 // Sets the scale for logical<->physical pixel conversions. | 79 // Sets the scale for logical<->physical pixel conversions. |
| 79 void SetDipScale(float dip_scale); | 80 void SetDipScale(float dip_scale); |
| 80 float dip_scale() const { return dip_scale_; } | 81 float dip_scale() const { return dip_scale_; } |
| 81 | 82 |
| 82 // Set the root layer scroll offset to |new_value|. | 83 // Set the root layer scroll offset to |new_value|. |
| 83 void ScrollTo(gfx::Vector2d new_value); | 84 void ScrollTo(gfx::Vector2d new_value); |
| 84 | 85 |
| 85 // Android views hierarchy gluing. | 86 // Android views hierarchy gluing. |
| 86 bool IsVisible() const; | 87 bool IsVisible() const; |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 99 content::SynchronousCompositor* compositor) override; | 100 content::SynchronousCompositor* compositor) override; |
| 100 void PostInvalidate() override; | 101 void PostInvalidate() override; |
| 101 void DidUpdateContent() override; | 102 void DidUpdateContent() override; |
| 102 gfx::Vector2dF GetTotalRootLayerScrollOffset() override; | 103 gfx::Vector2dF GetTotalRootLayerScrollOffset() override; |
| 103 void UpdateRootLayerState(const gfx::Vector2dF& total_scroll_offset_dip, | 104 void UpdateRootLayerState(const gfx::Vector2dF& total_scroll_offset_dip, |
| 104 const gfx::Vector2dF& max_scroll_offset_dip, | 105 const gfx::Vector2dF& max_scroll_offset_dip, |
| 105 const gfx::SizeF& scrollable_size_dip, | 106 const gfx::SizeF& scrollable_size_dip, |
| 106 float page_scale_factor, | 107 float page_scale_factor, |
| 107 float min_page_scale_factor, | 108 float min_page_scale_factor, |
| 108 float max_page_scale_factor) override; | 109 float max_page_scale_factor) override; |
| 109 bool IsExternalFlingActive() const override; | 110 bool IsExternalScrollActive() const override; |
| 111 void SetNeedsAnimateScroll( | |
| 112 const AnimationCallback& scroll_animation) override; | |
| 110 void DidOverscroll(gfx::Vector2dF accumulated_overscroll, | 113 void DidOverscroll(gfx::Vector2dF accumulated_overscroll, |
| 111 gfx::Vector2dF latest_overscroll_delta, | 114 gfx::Vector2dF latest_overscroll_delta, |
| 112 gfx::Vector2dF current_fling_velocity) override; | 115 gfx::Vector2dF current_fling_velocity) override; |
| 113 | 116 |
| 114 void UpdateParentDrawConstraints(); | 117 void UpdateParentDrawConstraints(); |
| 115 void DetachFunctorFromView(); | 118 void DetachFunctorFromView(); |
| 116 | 119 |
| 117 private: | 120 private: |
| 118 void SetTotalRootLayerScrollOffset(gfx::Vector2dF new_value_dip); | 121 void SetTotalRootLayerScrollOffset(gfx::Vector2dF new_value_dip); |
| 119 bool CanOnDraw(); | 122 bool CanOnDraw(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 | 175 |
| 173 gfx::Vector2d last_on_draw_scroll_offset_; | 176 gfx::Vector2d last_on_draw_scroll_offset_; |
| 174 gfx::Rect last_on_draw_global_visible_rect_; | 177 gfx::Rect last_on_draw_global_visible_rect_; |
| 175 | 178 |
| 176 base::CancelableClosure post_fallback_tick_; | 179 base::CancelableClosure post_fallback_tick_; |
| 177 base::CancelableClosure fallback_tick_fired_; | 180 base::CancelableClosure fallback_tick_fired_; |
| 178 bool fallback_tick_pending_; | 181 bool fallback_tick_pending_; |
| 179 | 182 |
| 180 gfx::Size size_; | 183 gfx::Size size_; |
| 181 | 184 |
| 185 // Used to drive a fling animation as requested by the compositor. This acts | |
| 186 // as a single-shot animation; the compositor will continually post an | |
|
boliu
2015/06/08 16:54:52
carried over from before, there's an extra space b
hush (inactive)
2015/06/09 19:11:34
Done.
| |
| 187 // animation callback as long as they're required. | |
| 188 AnimationCallback pending_fling_animation_; | |
| 189 | |
| 182 // Current scroll offset in CSS pixels. | 190 // Current scroll offset in CSS pixels. |
| 183 gfx::Vector2dF scroll_offset_dip_; | 191 gfx::Vector2dF scroll_offset_dip_; |
| 184 | 192 |
| 185 // Max scroll offset in CSS pixels. | 193 // Max scroll offset in CSS pixels. |
| 186 gfx::Vector2dF max_scroll_offset_dip_; | 194 gfx::Vector2dF max_scroll_offset_dip_; |
| 187 | 195 |
| 188 // Used to prevent rounding errors from accumulating enough to generate | 196 // Used to prevent rounding errors from accumulating enough to generate |
| 189 // visible skew (especially noticeable when scrolling up and down in the same | 197 // visible skew (especially noticeable when scrolling up and down in the same |
| 190 // spot over a period of time). | 198 // spot over a period of time). |
| 191 gfx::Vector2dF overscroll_rounding_error_; | 199 gfx::Vector2dF overscroll_rounding_error_; |
| 192 | 200 |
| 193 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); | 201 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); |
| 194 }; | 202 }; |
| 195 | 203 |
| 196 } // namespace android_webview | 204 } // namespace android_webview |
| 197 | 205 |
| 198 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ | 206 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ |
| OLD | NEW |