Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_HARDWARE_RENDERER_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "android_webview/browser/gl_view_renderer_manager.h" | 10 #include "android_webview/browser/gl_view_renderer_manager.h" |
| 11 #include "android_webview/browser/shared_renderer_state.h" | 11 #include "android_webview/browser/shared_renderer_state.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "content/public/browser/android/synchronous_compositor.h" | 13 #include "content/public/browser/android/synchronous_compositor.h" |
| 14 | 14 |
| 15 struct AwDrawGLInfo; | 15 struct AwDrawGLInfo; |
| 16 | 16 |
| 17 namespace android_webview { | 17 namespace android_webview { |
| 18 | 18 |
| 19 class AwGLSurface; | 19 class AwGLSurface; |
| 20 class BrowserViewRendererClient; | 20 class BrowserViewRendererClient; |
| 21 | 21 |
| 22 namespace internal { | 22 namespace internal { |
| 23 class DeferredGpuCommandService; | 23 class DeferredGpuCommandService; |
| 24 } // namespace internal | 24 } // namespace internal |
| 25 | 25 |
| 26 class HardwareRenderer { | 26 class HardwareRenderer { |
| 27 public: | 27 public: |
| 28 explicit HardwareRenderer(SharedRendererState* state); | 28 explicit HardwareRenderer(SharedRendererState* state); |
| 29 ~HardwareRenderer(); | 29 virtual ~HardwareRenderer(); |
|
boliu
2014/04/28 22:22:15
why virtual?
hush (inactive)
2014/04/30 20:50:17
Thanks for pointing this out! I will remove it. It
| |
| 30 | 30 |
| 31 static void CalculateTileMemoryPolicy(); | 31 static void CalculateTileMemoryPolicy(); |
| 32 | 32 |
| 33 bool DrawGL(AwDrawGLInfo* draw_info, DrawGLResult* result); | 33 bool DrawGL(AwDrawGLInfo* draw_info, DrawGLResult* result); |
| 34 bool TrimMemory(int level, bool visible); | 34 bool TrimMemory(int level, bool visible); |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 friend class internal::DeferredGpuCommandService; | 37 friend class internal::DeferredGpuCommandService; |
| 38 | 38 |
| 39 void SetMemoryPolicy(content::SynchronousCompositorMemoryPolicy& new_policy); | 39 void SetMemoryPolicy(content::SynchronousCompositorMemoryPolicy& new_policy); |
| 40 | 40 |
| 41 SharedRendererState* shared_renderer_state_; | 41 SharedRendererState* shared_renderer_state_; |
| 42 | 42 |
| 43 typedef void* EGLContext; | 43 typedef void* EGLContext; |
| 44 EGLContext last_egl_context_; | 44 EGLContext last_egl_context_; |
| 45 | 45 |
| 46 scoped_refptr<AwGLSurface> gl_surface_; | 46 scoped_refptr<AwGLSurface> gl_surface_; |
| 47 content::SynchronousCompositorMemoryPolicy memory_policy_; | |
| 48 | 47 |
| 49 GLViewRendererManager::Key manager_key_; | 48 GLViewRendererManager::Key renderer_manager_key_; |
| 50 | 49 |
| 51 DISALLOW_COPY_AND_ASSIGN(HardwareRenderer); | 50 DISALLOW_COPY_AND_ASSIGN(HardwareRenderer); |
| 52 }; | 51 }; |
| 53 | 52 |
| 54 namespace internal { | 53 namespace internal { |
| 55 | 54 |
| 56 class ScopedAllowGL { | 55 class ScopedAllowGL { |
| 57 public: | 56 public: |
| 58 ScopedAllowGL(); | 57 ScopedAllowGL(); |
| 59 ~ScopedAllowGL(); | 58 ~ScopedAllowGL(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 | 95 |
| 97 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; | 96 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; |
| 98 DISALLOW_COPY_AND_ASSIGN(DeferredGpuCommandService); | 97 DISALLOW_COPY_AND_ASSIGN(DeferredGpuCommandService); |
| 99 }; | 98 }; |
| 100 | 99 |
| 101 } // namespace internal | 100 } // namespace internal |
| 102 | 101 |
| 103 } // namespace android_webview | 102 } // namespace android_webview |
| 104 | 103 |
| 105 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ | 104 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ |
| OLD | NEW |