| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 92                             const gfx::SizeF& scrollable_size_dip, | 92                             const gfx::SizeF& scrollable_size_dip, | 
| 93                             float page_scale_factor, | 93                             float page_scale_factor, | 
| 94                             float min_page_scale_factor, | 94                             float min_page_scale_factor, | 
| 95                             float max_page_scale_factor) override; | 95                             float max_page_scale_factor) override; | 
| 96   bool IsExternalFlingActive() const override; | 96   bool IsExternalFlingActive() const override; | 
| 97   void DidOverscroll(gfx::Vector2dF accumulated_overscroll, | 97   void DidOverscroll(gfx::Vector2dF accumulated_overscroll, | 
| 98                      gfx::Vector2dF latest_overscroll_delta, | 98                      gfx::Vector2dF latest_overscroll_delta, | 
| 99                      gfx::Vector2dF current_fling_velocity) override; | 99                      gfx::Vector2dF current_fling_velocity) override; | 
| 100 | 100 | 
| 101   void UpdateParentDrawConstraints(); | 101   void UpdateParentDrawConstraints(); | 
| 102   void DidSkipCommitFrame(); |  | 
| 103   void InvalidateOnFunctorDestroy(); | 102   void InvalidateOnFunctorDestroy(); | 
| 104 | 103 | 
| 105  private: | 104  private: | 
| 106   void SetTotalRootLayerScrollOffset(gfx::Vector2dF new_value_dip); | 105   void SetTotalRootLayerScrollOffset(gfx::Vector2dF new_value_dip); | 
| 107   bool CanOnDraw(); | 106   bool CanOnDraw(); | 
| 108   // Posts an invalidate with fallback tick. All invalidates posted while an | 107   // Posts an invalidate with fallback tick. All invalidates posted while an | 
| 109   // invalidate is pending will be posted as a single invalidate after the | 108   // invalidate is pending will be posted as a single invalidate after the | 
| 110   // pending invalidate is done. If |skip_reschedule_tick| is true a fallback | 109   // pending invalidate is done. | 
| 111   // tick won't be scheduled if there's one already pending. | 110   void PostInvalidateWithFallback(); | 
| 112   void PostInvalidateWithFallback(bool skip_reschedule_tick); |  | 
| 113   void UpdateCompositorIsActive(); | 111   void UpdateCompositorIsActive(); | 
| 114   bool CompositeSW(SkCanvas* canvas); | 112   bool CompositeSW(SkCanvas* canvas); | 
| 115   void DidComposite(); | 113   void DidComposite(); | 
| 116   void DidSkipCompositeInDraw(); |  | 
| 117   scoped_refptr<base::trace_event::ConvertableToTraceFormat> | 114   scoped_refptr<base::trace_event::ConvertableToTraceFormat> | 
| 118   RootLayerStateAsValue(const gfx::Vector2dF& total_scroll_offset_dip, | 115   RootLayerStateAsValue(const gfx::Vector2dF& total_scroll_offset_dip, | 
| 119                         const gfx::SizeF& scrollable_size_dip); | 116                         const gfx::SizeF& scrollable_size_dip); | 
| 120 | 117 | 
| 121   scoped_ptr<cc::CompositorFrame> CompositeHw(); | 118   bool CompositeHw(); | 
| 122   void ForceCompositeHw(); |  | 
| 123   void ReturnUnusedResource(scoped_ptr<cc::CompositorFrame> frame); | 119   void ReturnUnusedResource(scoped_ptr<cc::CompositorFrame> frame); | 
| 124   void ReturnResourceFromParent(); | 120   void ReturnResourceFromParent(); | 
| 125 | 121 | 
| 126   // If we call up view invalidate and OnDraw is not called before a deadline, | 122   // If we call up view invalidate and OnDraw is not called before a deadline, | 
| 127   // then we keep ticking the SynchronousCompositor so it can make progress. | 123   // then we keep ticking the SynchronousCompositor so it can make progress. | 
| 128   // Do this in a two stage tick due to native MessageLoop favors delayed task, | 124   // Do this in a two stage tick due to native MessageLoop favors delayed task, | 
| 129   // so ensure delayed task is inserted only after the draw task returns. | 125   // so ensure delayed task is inserted only after the draw task returns. | 
| 130   void PostFallbackTick(); | 126   void PostFallbackTick(); | 
| 131   void FallbackTickFired(); | 127   void FallbackTickFired(); | 
| 132 | 128 | 
| (...skipping 26 matching lines...) Expand all  Loading... | 
| 159   bool on_new_picture_enable_; | 155   bool on_new_picture_enable_; | 
| 160   bool clear_view_; | 156   bool clear_view_; | 
| 161 | 157 | 
| 162   gfx::Vector2d last_on_draw_scroll_offset_; | 158   gfx::Vector2d last_on_draw_scroll_offset_; | 
| 163   gfx::Rect last_on_draw_global_visible_rect_; | 159   gfx::Rect last_on_draw_global_visible_rect_; | 
| 164 | 160 | 
| 165   // The draw constraints from the parent compositor. These are only used for | 161   // The draw constraints from the parent compositor. These are only used for | 
| 166   // tiling priority. | 162   // tiling priority. | 
| 167   ParentCompositorDrawConstraints parent_draw_constraints_; | 163   ParentCompositorDrawConstraints parent_draw_constraints_; | 
| 168 | 164 | 
| 169   // Used to run invalidate after the pending invalidate is done. |  | 
| 170   bool invalidate_after_composite_; |  | 
| 171 |  | 
| 172   // Used to block additional invalidates while one is pending. | 165   // Used to block additional invalidates while one is pending. | 
| 173   bool block_invalidates_; | 166   bool block_invalidates_; | 
| 174 | 167 | 
| 175   base::CancelableClosure post_fallback_tick_; | 168   base::CancelableClosure post_fallback_tick_; | 
| 176   base::CancelableClosure fallback_tick_fired_; | 169   base::CancelableClosure fallback_tick_fired_; | 
| 177   bool fallback_tick_pending_; | 170   bool fallback_tick_pending_; | 
| 178 | 171 | 
| 179   gfx::Size size_; | 172   gfx::Size size_; | 
| 180 | 173 | 
| 181   // Current scroll offset in CSS pixels. | 174   // Current scroll offset in CSS pixels. | 
| 182   gfx::Vector2dF scroll_offset_dip_; | 175   gfx::Vector2dF scroll_offset_dip_; | 
| 183 | 176 | 
| 184   // Max scroll offset in CSS pixels. | 177   // Max scroll offset in CSS pixels. | 
| 185   gfx::Vector2dF max_scroll_offset_dip_; | 178   gfx::Vector2dF max_scroll_offset_dip_; | 
| 186 | 179 | 
| 187   // Used to prevent rounding errors from accumulating enough to generate | 180   // Used to prevent rounding errors from accumulating enough to generate | 
| 188   // visible skew (especially noticeable when scrolling up and down in the same | 181   // visible skew (especially noticeable when scrolling up and down in the same | 
| 189   // spot over a period of time). | 182   // spot over a period of time). | 
| 190   gfx::Vector2dF overscroll_rounding_error_; | 183   gfx::Vector2dF overscroll_rounding_error_; | 
| 191 | 184 | 
| 192   DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); | 185   DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); | 
| 193 }; | 186 }; | 
| 194 | 187 | 
| 195 }  // namespace android_webview | 188 }  // namespace android_webview | 
| 196 | 189 | 
| 197 #endif  // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ | 190 #endif  // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ | 
| OLD | NEW | 
|---|