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

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

Issue 23533051: [android_webview] Use a fraction to calculate scroll offset. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: get rid of NaNs Created 7 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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_IN_PROCESS_VIEW_RENDERER_H_ 5 #ifndef ANDROID_WEBVIEW_BROWSER_IN_PROCESS_VIEW_RENDERER_H_
6 #define ANDROID_WEBVIEW_BROWSER_IN_PROCESS_VIEW_RENDERER_H_ 6 #define ANDROID_WEBVIEW_BROWSER_IN_PROCESS_VIEW_RENDERER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "android_webview/browser/browser_view_renderer.h" 10 #include "android_webview/browser/browser_view_renderer.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 virtual bool IsAttachedToWindow() OVERRIDE; 72 virtual bool IsAttachedToWindow() OVERRIDE;
73 virtual bool IsVisible() OVERRIDE; 73 virtual bool IsVisible() OVERRIDE;
74 virtual gfx::Rect GetScreenRect() OVERRIDE; 74 virtual gfx::Rect GetScreenRect() OVERRIDE;
75 75
76 // SynchronousCompositorClient overrides 76 // SynchronousCompositorClient overrides
77 virtual void DidInitializeCompositor( 77 virtual void DidInitializeCompositor(
78 content::SynchronousCompositor* compositor) OVERRIDE; 78 content::SynchronousCompositor* compositor) OVERRIDE;
79 virtual void DidDestroyCompositor( 79 virtual void DidDestroyCompositor(
80 content::SynchronousCompositor* compositor) OVERRIDE; 80 content::SynchronousCompositor* compositor) OVERRIDE;
81 virtual void SetContinuousInvalidate(bool invalidate) OVERRIDE; 81 virtual void SetContinuousInvalidate(bool invalidate) OVERRIDE;
82 virtual void SetMaxRootLayerScrollOffset(gfx::Vector2dF new_value) OVERRIDE;
82 virtual void SetTotalRootLayerScrollOffset( 83 virtual void SetTotalRootLayerScrollOffset(
83 gfx::Vector2dF new_value_css) OVERRIDE; 84 gfx::Vector2dF new_value_css) OVERRIDE;
84 virtual void DidUpdateContent() OVERRIDE; 85 virtual void DidUpdateContent() OVERRIDE;
85 virtual gfx::Vector2dF GetTotalRootLayerScrollOffset() OVERRIDE; 86 virtual gfx::Vector2dF GetTotalRootLayerScrollOffset() OVERRIDE;
86 virtual void DidOverscroll(gfx::Vector2dF accumulated_overscroll, 87 virtual void DidOverscroll(gfx::Vector2dF accumulated_overscroll,
87 gfx::Vector2dF latest_overscroll_delta, 88 gfx::Vector2dF latest_overscroll_delta,
88 gfx::Vector2dF current_fling_velocity) OVERRIDE; 89 gfx::Vector2dF current_fling_velocity) OVERRIDE;
89 90
90 void WebContentsGone(); 91 void WebContentsGone();
91 bool RequestProcessGL(); 92 bool RequestProcessGL();
(...skipping 12 matching lines...) Expand all
104 void UpdateCachedGlobalVisibleRect(); 105 void UpdateCachedGlobalVisibleRect();
105 106
106 // If we call up view invalidate and OnDraw is not called before a deadline, 107 // If we call up view invalidate and OnDraw is not called before a deadline,
107 // then we keep ticking the SynchronousCompositor so it can make progress. 108 // then we keep ticking the SynchronousCompositor so it can make progress.
108 void FallbackTickFired(); 109 void FallbackTickFired();
109 110
110 void NoLongerExpectsDrawGL(); 111 void NoLongerExpectsDrawGL();
111 112
112 bool InitializeHwDraw(); 113 bool InitializeHwDraw();
113 114
115 gfx::Vector2d max_scroll_offset() const;
116
114 // For debug tracing or logging. Return the string representation of this 117 // For debug tracing or logging. Return the string representation of this
115 // view renderer's state and the |draw_info| if provided. 118 // view renderer's state and the |draw_info| if provided.
116 std::string ToString(AwDrawGLInfo* draw_info) const; 119 std::string ToString(AwDrawGLInfo* draw_info) const;
117 120
118 BrowserViewRenderer::Client* client_; 121 BrowserViewRenderer::Client* client_;
119 BrowserViewRenderer::JavaHelper* java_helper_; 122 BrowserViewRenderer::JavaHelper* java_helper_;
120 content::WebContents* web_contents_; 123 content::WebContents* web_contents_;
121 content::SynchronousCompositor* compositor_; 124 content::SynchronousCompositor* compositor_;
122 125
123 bool is_paused_; 126 bool is_paused_;
(...skipping 29 matching lines...) Expand all
153 // Not to be used between draw calls. 156 // Not to be used between draw calls.
154 EGLContext last_egl_context_; 157 EGLContext last_egl_context_;
155 158
156 // Should always call UpdateCachedGlobalVisibleRect before using this. 159 // Should always call UpdateCachedGlobalVisibleRect before using this.
157 gfx::Rect cached_global_visible_rect_; 160 gfx::Rect cached_global_visible_rect_;
158 161
159 // Last View scroll when View.onDraw() was called. 162 // Last View scroll when View.onDraw() was called.
160 gfx::Vector2d scroll_at_start_of_frame_; 163 gfx::Vector2d scroll_at_start_of_frame_;
161 164
162 // Current scroll offset in CSS pixels. 165 // Current scroll offset in CSS pixels.
163 gfx::Vector2dF scroll_offset_css_; 166 gfx::Vector2dF scroll_offset_dip_;
167
168 // Max scroll offset in CSS pixels.
169 gfx::Vector2dF max_scroll_offset_dip_;
164 170
165 // Used to prevent rounding errors from accumulating enough to generate 171 // Used to prevent rounding errors from accumulating enough to generate
166 // visible skew (especially noticeable when scrolling up and down in the same 172 // visible skew (especially noticeable when scrolling up and down in the same
167 // spot over a period of time). 173 // spot over a period of time).
168 gfx::Vector2dF overscroll_rounding_error_; 174 gfx::Vector2dF overscroll_rounding_error_;
169 175
170 GLViewRendererManager::Key manager_key_; 176 GLViewRendererManager::Key manager_key_;
171 177
172 DISALLOW_COPY_AND_ASSIGN(InProcessViewRenderer); 178 DISALLOW_COPY_AND_ASSIGN(InProcessViewRenderer);
173 }; 179 };
174 180
175 } // namespace android_webview 181 } // namespace android_webview
176 182
177 #endif // ANDROID_WEBVIEW_BROWSER_IN_PROCESS_VIEW_RENDERER_H_ 183 #endif // ANDROID_WEBVIEW_BROWSER_IN_PROCESS_VIEW_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698