| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 void OnAttachedToWindow(int width, int height); | 77 void OnAttachedToWindow(int width, int height); |
| 78 void OnDetachedFromWindow(); | 78 void OnDetachedFromWindow(); |
| 79 void OnComputeScroll(base::TimeTicks animation_time); | 79 void OnComputeScroll(base::TimeTicks animation_time); |
| 80 | 80 |
| 81 // Sets the scale for logical<->physical pixel conversions. | 81 // Sets the scale for logical<->physical pixel conversions. |
| 82 void SetDipScale(float dip_scale); | 82 void SetDipScale(float dip_scale); |
| 83 float dip_scale() const { return dip_scale_; } | 83 float dip_scale() const { return dip_scale_; } |
| 84 float page_scale_factor() const { return page_scale_factor_; } | 84 float page_scale_factor() const { return page_scale_factor_; } |
| 85 | 85 |
| 86 // Set the root layer scroll offset to |new_value|. | 86 // Set the root layer scroll offset to |new_value|. |
| 87 void ScrollTo(gfx::Vector2d new_value); | 87 void ScrollTo(const gfx::Vector2d& new_value); |
| 88 | 88 |
| 89 // Android views hierarchy gluing. | 89 // Android views hierarchy gluing. |
| 90 bool IsVisible() const; | 90 bool IsVisible() const; |
| 91 gfx::Rect GetScreenRect() const; | 91 gfx::Rect GetScreenRect() const; |
| 92 bool attached_to_window() const { return attached_to_window_; } | 92 bool attached_to_window() const { return attached_to_window_; } |
| 93 bool hardware_enabled() const { return hardware_enabled_; } | 93 bool hardware_enabled() const { return hardware_enabled_; } |
| 94 gfx::Size size() const { return size_; } | 94 gfx::Size size() const { return size_; } |
| 95 void ReleaseHardware(); | 95 void ReleaseHardware(); |
| 96 | 96 |
| 97 bool IsClientVisible() const; | 97 bool IsClientVisible() const; |
| 98 void TrimMemory(const int level, const bool visible); | 98 void TrimMemory(const int level, const bool visible); |
| 99 | 99 |
| 100 // SynchronousCompositorClient overrides. | 100 // SynchronousCompositorClient overrides. |
| 101 void DidInitializeCompositor( | 101 void DidInitializeCompositor( |
| 102 content::SynchronousCompositor* compositor) override; | 102 content::SynchronousCompositor* compositor) override; |
| 103 void DidDestroyCompositor( | 103 void DidDestroyCompositor( |
| 104 content::SynchronousCompositor* compositor) override; | 104 content::SynchronousCompositor* compositor) override; |
| 105 void PostInvalidate() override; | 105 void PostInvalidate() override; |
| 106 void DidUpdateContent() override; | 106 void DidUpdateContent() override; |
| 107 void UpdateRootLayerState(const gfx::Vector2dF& total_scroll_offset_dip, | 107 void UpdateRootLayerState(const gfx::Vector2dF& total_scroll_offset_dip, |
| 108 const gfx::Vector2dF& max_scroll_offset_dip, | 108 const gfx::Vector2dF& max_scroll_offset_dip, |
| 109 const gfx::SizeF& scrollable_size_dip, | 109 const gfx::SizeF& scrollable_size_dip, |
| 110 float page_scale_factor, | 110 float page_scale_factor, |
| 111 float min_page_scale_factor, | 111 float min_page_scale_factor, |
| 112 float max_page_scale_factor) override; | 112 float max_page_scale_factor) override; |
| 113 void DidOverscroll(gfx::Vector2dF accumulated_overscroll, | 113 void DidOverscroll(const gfx::Vector2dF& accumulated_overscroll, |
| 114 gfx::Vector2dF latest_overscroll_delta, | 114 const gfx::Vector2dF& latest_overscroll_delta, |
| 115 gfx::Vector2dF current_fling_velocity) override; | 115 const gfx::Vector2dF& current_fling_velocity) override; |
| 116 | 116 |
| 117 void UpdateParentDrawConstraints(); | 117 void UpdateParentDrawConstraints(); |
| 118 void DetachFunctorFromView(); | 118 void DetachFunctorFromView(); |
| 119 | 119 |
| 120 private: | 120 private: |
| 121 void SetTotalRootLayerScrollOffset(gfx::Vector2dF new_value_dip); | 121 void SetTotalRootLayerScrollOffset(const gfx::Vector2dF& new_value_dip); |
| 122 bool CanOnDraw(); | 122 bool CanOnDraw(); |
| 123 // Posts an invalidate with fallback tick. All invalidates posted while an | 123 // Posts an invalidate with fallback tick. All invalidates posted while an |
| 124 // invalidate is pending will be posted as a single invalidate after the | 124 // invalidate is pending will be posted as a single invalidate after the |
| 125 // pending invalidate is done. | 125 // pending invalidate is done. |
| 126 void PostInvalidateWithFallback(); | 126 void PostInvalidateWithFallback(); |
| 127 void CancelFallbackTick(); | 127 void CancelFallbackTick(); |
| 128 void UpdateCompositorIsActive(); | 128 void UpdateCompositorIsActive(); |
| 129 bool CompositeSW(SkCanvas* canvas); | 129 bool CompositeSW(SkCanvas* canvas); |
| 130 scoped_refptr<base::trace_event::ConvertableToTraceFormat> | 130 scoped_refptr<base::trace_event::ConvertableToTraceFormat> |
| 131 RootLayerStateAsValue(const gfx::Vector2dF& total_scroll_offset_dip, | 131 RootLayerStateAsValue(const gfx::Vector2dF& total_scroll_offset_dip, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // spot over a period of time). | 200 // spot over a period of time). |
| 201 // TODO(miletus): Make overscroll_rounding_error_ a gfx::ScrollOffset. | 201 // TODO(miletus): Make overscroll_rounding_error_ a gfx::ScrollOffset. |
| 202 gfx::Vector2dF overscroll_rounding_error_; | 202 gfx::Vector2dF overscroll_rounding_error_; |
| 203 | 203 |
| 204 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); | 204 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); |
| 205 }; | 205 }; |
| 206 | 206 |
| 207 } // namespace android_webview | 207 } // namespace android_webview |
| 208 | 208 |
| 209 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ | 209 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ |
| OLD | NEW |