| OLD | NEW |
| 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" |
| 11 #include "android_webview/browser/gl_view_renderer_manager.h" | 11 #include "android_webview/browser/gl_view_renderer_manager.h" |
| 12 #include "base/cancelable_callback.h" | 12 #include "base/cancelable_callback.h" |
| 13 #include "base/memory/memory_pressure_listener.h" |
| 13 #include "content/public/browser/android/synchronous_compositor_client.h" | 14 #include "content/public/browser/android/synchronous_compositor_client.h" |
| 14 #include "ui/gfx/vector2d_f.h" | 15 #include "ui/gfx/vector2d_f.h" |
| 15 | 16 |
| 16 namespace content { | 17 namespace content { |
| 17 class SynchronousCompositor; | 18 class SynchronousCompositor; |
| 18 class WebContents; | 19 class WebContents; |
| 19 } | 20 } |
| 20 | 21 |
| 21 typedef void* EGLContext; | 22 typedef void* EGLContext; |
| 22 class SkCanvas; | 23 class SkCanvas; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 bool CompositeSW(SkCanvas* canvas); | 105 bool CompositeSW(SkCanvas* canvas); |
| 105 | 106 |
| 106 void UpdateCachedGlobalVisibleRect(); | 107 void UpdateCachedGlobalVisibleRect(); |
| 107 | 108 |
| 108 // If we call up view invalidate and OnDraw is not called before a deadline, | 109 // If we call up view invalidate and OnDraw is not called before a deadline, |
| 109 // then we keep ticking the SynchronousCompositor so it can make progress. | 110 // then we keep ticking the SynchronousCompositor so it can make progress. |
| 110 void FallbackTickFired(); | 111 void FallbackTickFired(); |
| 111 | 112 |
| 112 void NoLongerExpectsDrawGL(); | 113 void NoLongerExpectsDrawGL(); |
| 113 | 114 |
| 115 void OnMemoryPressure( |
| 116 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); |
| 117 |
| 114 bool InitializeHwDraw(); | 118 bool InitializeHwDraw(); |
| 115 | 119 |
| 116 gfx::Vector2d max_scroll_offset() const; | 120 gfx::Vector2d max_scroll_offset() const; |
| 117 | 121 |
| 118 // For debug tracing or logging. Return the string representation of this | 122 // For debug tracing or logging. Return the string representation of this |
| 119 // view renderer's state and the |draw_info| if provided. | 123 // view renderer's state and the |draw_info| if provided. |
| 120 std::string ToString(AwDrawGLInfo* draw_info) const; | 124 std::string ToString(AwDrawGLInfo* draw_info) const; |
| 121 | 125 |
| 122 BrowserViewRenderer::Client* client_; | 126 BrowserViewRenderer::Client* client_; |
| 123 BrowserViewRenderer::JavaHelper* java_helper_; | 127 BrowserViewRenderer::JavaHelper* java_helper_; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // Max scroll offset in CSS pixels. | 173 // Max scroll offset in CSS pixels. |
| 170 gfx::Vector2dF max_scroll_offset_dip_; | 174 gfx::Vector2dF max_scroll_offset_dip_; |
| 171 | 175 |
| 172 // Used to prevent rounding errors from accumulating enough to generate | 176 // Used to prevent rounding errors from accumulating enough to generate |
| 173 // visible skew (especially noticeable when scrolling up and down in the same | 177 // visible skew (especially noticeable when scrolling up and down in the same |
| 174 // spot over a period of time). | 178 // spot over a period of time). |
| 175 gfx::Vector2dF overscroll_rounding_error_; | 179 gfx::Vector2dF overscroll_rounding_error_; |
| 176 | 180 |
| 177 GLViewRendererManager::Key manager_key_; | 181 GLViewRendererManager::Key manager_key_; |
| 178 | 182 |
| 183 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; |
| 184 |
| 179 DISALLOW_COPY_AND_ASSIGN(InProcessViewRenderer); | 185 DISALLOW_COPY_AND_ASSIGN(InProcessViewRenderer); |
| 180 }; | 186 }; |
| 181 | 187 |
| 182 } // namespace android_webview | 188 } // namespace android_webview |
| 183 | 189 |
| 184 #endif // ANDROID_WEBVIEW_BROWSER_IN_PROCESS_VIEW_RENDERER_H_ | 190 #endif // ANDROID_WEBVIEW_BROWSER_IN_PROCESS_VIEW_RENDERER_H_ |
| OLD | NEW |