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 "content/public/browser/android/synchronous_compositor.h" | 13 #include "content/public/browser/android/synchronous_compositor.h" |
14 #include "content/public/browser/android/synchronous_compositor_client.h" | 14 #include "content/public/browser/android/synchronous_compositor_client.h" |
15 #include "gpu/command_buffer/service/in_process_command_buffer.h" | |
15 #include "ui/gfx/vector2d_f.h" | 16 #include "ui/gfx/vector2d_f.h" |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 class SynchronousCompositor; | 19 class SynchronousCompositor; |
19 class WebContents; | 20 class WebContents; |
20 } | 21 } |
21 | 22 |
22 typedef void* EGLContext; | 23 typedef void* EGLContext; |
23 class SkCanvas; | 24 class SkCanvas; |
24 | 25 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 virtual void SetRootLayerPageScaleFactor(float page_scale_factor) OVERRIDE; | 91 virtual void SetRootLayerPageScaleFactor(float page_scale_factor) OVERRIDE; |
91 virtual void SetRootLayerScrollableSize(gfx::SizeF scrollable_size) OVERRIDE; | 92 virtual void SetRootLayerScrollableSize(gfx::SizeF scrollable_size) OVERRIDE; |
92 virtual void DidOverscroll(gfx::Vector2dF accumulated_overscroll, | 93 virtual void DidOverscroll(gfx::Vector2dF accumulated_overscroll, |
93 gfx::Vector2dF latest_overscroll_delta, | 94 gfx::Vector2dF latest_overscroll_delta, |
94 gfx::Vector2dF current_fling_velocity) OVERRIDE; | 95 gfx::Vector2dF current_fling_velocity) OVERRIDE; |
95 | 96 |
96 void WebContentsGone(); | 97 void WebContentsGone(); |
97 bool RequestProcessGL(); | 98 bool RequestProcessGL(); |
98 | 99 |
99 private: | 100 private: |
101 class DeferredGpuCommandService : public gpu::InProcessCommandBuffer::Service { | |
102 public: | |
103 DeferredGpuCommandService(); | |
104 virtual ~DeferredGpuCommandService(); | |
boliu
2014/02/08 18:55:54
Destructor needs to be protected. Also missing a f
no sievers
2014/02/12 03:09:15
Thanks! Done.
| |
105 | |
106 virtual void ScheduleTask(const base::Closure& task) OVERRIDE; | |
107 virtual void ScheduleIdleWork(const base::Closure& task) OVERRIDE; | |
108 | |
109 void RunTasks(); | |
110 | |
111 private: | |
112 DISALLOW_COPY_AND_ASSIGN(DeferredGpuCommandService); | |
113 }; | |
114 | |
100 // Checks the continuous invalidate and block invalidate state, and schedule | 115 // Checks the continuous invalidate and block invalidate state, and schedule |
101 // invalidates appropriately. If |invalidate_ignore_compositor| is true, | 116 // invalidates appropriately. If |invalidate_ignore_compositor| is true, |
102 // then send a view invalidate regardless of compositor expectation. | 117 // then send a view invalidate regardless of compositor expectation. |
103 void EnsureContinuousInvalidation( | 118 void EnsureContinuousInvalidation( |
104 AwDrawGLInfo* draw_info, | 119 AwDrawGLInfo* draw_info, |
105 bool invalidate_ignore_compositor); | 120 bool invalidate_ignore_compositor); |
106 bool DrawSWInternal(jobject java_canvas, | 121 bool DrawSWInternal(jobject java_canvas, |
107 const gfx::Rect& clip_bounds); | 122 const gfx::Rect& clip_bounds); |
108 bool CompositeSW(SkCanvas* canvas); | 123 bool CompositeSW(SkCanvas* canvas); |
109 | 124 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
179 | 194 |
180 // Used to prevent rounding errors from accumulating enough to generate | 195 // Used to prevent rounding errors from accumulating enough to generate |
181 // visible skew (especially noticeable when scrolling up and down in the same | 196 // visible skew (especially noticeable when scrolling up and down in the same |
182 // spot over a period of time). | 197 // spot over a period of time). |
183 gfx::Vector2dF overscroll_rounding_error_; | 198 gfx::Vector2dF overscroll_rounding_error_; |
184 | 199 |
185 GLViewRendererManager::Key manager_key_; | 200 GLViewRendererManager::Key manager_key_; |
186 | 201 |
187 content::SynchronousCompositorMemoryPolicy memory_policy_; | 202 content::SynchronousCompositorMemoryPolicy memory_policy_; |
188 | 203 |
204 scoped_refptr<DeferredGpuCommandService> gl_queue_; | |
205 | |
189 DISALLOW_COPY_AND_ASSIGN(InProcessViewRenderer); | 206 DISALLOW_COPY_AND_ASSIGN(InProcessViewRenderer); |
190 }; | 207 }; |
191 | 208 |
192 } // namespace android_webview | 209 } // namespace android_webview |
193 | 210 |
194 #endif // ANDROID_WEBVIEW_BROWSER_IN_PROCESS_VIEW_RENDERER_H_ | 211 #endif // ANDROID_WEBVIEW_BROWSER_IN_PROCESS_VIEW_RENDERER_H_ |
OLD | NEW |