| 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 <queue> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "android_webview/browser/browser_view_renderer.h" | 11 #include "android_webview/browser/browser_view_renderer.h" |
| 11 #include "android_webview/browser/gl_view_renderer_manager.h" | 12 #include "android_webview/browser/gl_view_renderer_manager.h" |
| 12 #include "base/cancelable_callback.h" | 13 #include "base/cancelable_callback.h" |
| 13 #include "content/public/browser/android/synchronous_compositor.h" | 14 #include "content/public/browser/android/synchronous_compositor.h" |
| 14 #include "content/public/browser/android/synchronous_compositor_client.h" | 15 #include "content/public/browser/android/synchronous_compositor_client.h" |
| 16 #include "gpu/command_buffer/service/in_process_command_buffer.h" |
| 15 #include "ui/gfx/vector2d_f.h" | 17 #include "ui/gfx/vector2d_f.h" |
| 16 | 18 |
| 17 namespace content { | 19 namespace content { |
| 18 class SynchronousCompositor; | 20 class SynchronousCompositor; |
| 19 class WebContents; | 21 class WebContents; |
| 20 } | 22 } |
| 21 | 23 |
| 22 typedef void* EGLContext; | 24 typedef void* EGLContext; |
| 23 class SkCanvas; | 25 class SkCanvas; |
| 24 | 26 |
| 25 namespace android_webview { | 27 namespace android_webview { |
| 26 | 28 |
| 27 class AwGLSurface; | 29 class AwGLSurface; |
| 28 | 30 |
| 31 class DeferredGpuCommandService : public gpu::InProcessCommandBuffer::Service { |
| 32 public: |
| 33 DeferredGpuCommandService(); |
| 34 |
| 35 virtual void ScheduleTask(const base::Closure& task) OVERRIDE; |
| 36 virtual void ScheduleIdleWork(const base::Closure& task) OVERRIDE; |
| 37 virtual bool UseVirtualizedGLContexts() OVERRIDE { return true; } |
| 38 |
| 39 void RunTasks(); |
| 40 |
| 41 protected: |
| 42 virtual ~DeferredGpuCommandService(); |
| 43 |
| 44 private: |
| 45 base::Lock tasks_lock_; |
| 46 std::queue<base::Closure> tasks_; |
| 47 DISALLOW_COPY_AND_ASSIGN(DeferredGpuCommandService); |
| 48 }; |
| 49 |
| 29 // Provides RenderViewHost wrapper functionality for sending WebView-specific | 50 // Provides RenderViewHost wrapper functionality for sending WebView-specific |
| 30 // IPC messages to the renderer and from there to WebKit. | 51 // IPC messages to the renderer and from there to WebKit. |
| 31 class InProcessViewRenderer : public BrowserViewRenderer, | 52 class InProcessViewRenderer : public BrowserViewRenderer, |
| 32 public content::SynchronousCompositorClient { | 53 public content::SynchronousCompositorClient { |
| 33 public: | 54 public: |
| 34 static void CalculateTileMemoryPolicy(); | 55 static void CalculateTileMemoryPolicy(); |
| 35 | 56 |
| 36 InProcessViewRenderer(BrowserViewRenderer::Client* client, | 57 InProcessViewRenderer(BrowserViewRenderer::Client* client, |
| 37 JavaHelper* java_helper, | 58 JavaHelper* java_helper, |
| 38 content::WebContents* web_contents); | 59 content::WebContents* web_contents); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 200 |
| 180 // Used to prevent rounding errors from accumulating enough to generate | 201 // Used to prevent rounding errors from accumulating enough to generate |
| 181 // visible skew (especially noticeable when scrolling up and down in the same | 202 // visible skew (especially noticeable when scrolling up and down in the same |
| 182 // spot over a period of time). | 203 // spot over a period of time). |
| 183 gfx::Vector2dF overscroll_rounding_error_; | 204 gfx::Vector2dF overscroll_rounding_error_; |
| 184 | 205 |
| 185 GLViewRendererManager::Key manager_key_; | 206 GLViewRendererManager::Key manager_key_; |
| 186 | 207 |
| 187 content::SynchronousCompositorMemoryPolicy memory_policy_; | 208 content::SynchronousCompositorMemoryPolicy memory_policy_; |
| 188 | 209 |
| 210 scoped_refptr<DeferredGpuCommandService> gl_queue_; |
| 211 |
| 189 DISALLOW_COPY_AND_ASSIGN(InProcessViewRenderer); | 212 DISALLOW_COPY_AND_ASSIGN(InProcessViewRenderer); |
| 190 }; | 213 }; |
| 191 | 214 |
| 192 } // namespace android_webview | 215 } // namespace android_webview |
| 193 | 216 |
| 194 #endif // ANDROID_WEBVIEW_BROWSER_IN_PROCESS_VIEW_RENDERER_H_ | 217 #endif // ANDROID_WEBVIEW_BROWSER_IN_PROCESS_VIEW_RENDERER_H_ |
| OLD | NEW |