Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: android_webview/browser/hardware_renderer.h

Issue 226363004: Global GPU memory manager for android webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Type casts and private methods in BVR. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/lazy_instance.h" 12 #include "base/lazy_instance.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/threading/thread_local.h" 14 #include "base/threading/thread_local.h"
15 #include "content/public/browser/android/synchronous_compositor.h"
16 15
17 struct AwDrawGLInfo; 16 struct AwDrawGLInfo;
18 17
19 namespace android_webview { 18 namespace android_webview {
20 19
21 class AwGLSurface; 20 class AwGLSurface;
22 class BrowserViewRendererClient; 21 class BrowserViewRendererClient;
23 22
24 namespace internal { 23 namespace internal {
25 class DeferredGpuCommandService; 24 class DeferredGpuCommandService;
26 } // namespace internal 25 } // namespace internal
27 26
28 class HardwareRenderer { 27 class HardwareRenderer {
29 public: 28 public:
30 explicit HardwareRenderer(SharedRendererState* state); 29 explicit HardwareRenderer(SharedRendererState* state);
31 ~HardwareRenderer(); 30 ~HardwareRenderer();
32 31
33 static void CalculateTileMemoryPolicy();
34
35 bool DrawGL(AwDrawGLInfo* draw_info, DrawGLResult* result); 32 bool DrawGL(AwDrawGLInfo* draw_info, DrawGLResult* result);
36 bool TrimMemory(int level, bool visible);
37 33
38 private: 34 private:
39 friend class internal::DeferredGpuCommandService; 35 friend class internal::DeferredGpuCommandService;
40 36
41 void SetMemoryPolicy(content::SynchronousCompositorMemoryPolicy& new_policy); 37 void SetCompositorMemoryPolicy();
42 38
43 SharedRendererState* shared_renderer_state_; 39 SharedRendererState* shared_renderer_state_;
44 40
45 typedef void* EGLContext; 41 typedef void* EGLContext;
46 EGLContext last_egl_context_; 42 EGLContext last_egl_context_;
47 43
48 scoped_refptr<AwGLSurface> gl_surface_; 44 scoped_refptr<AwGLSurface> gl_surface_;
49 content::SynchronousCompositorMemoryPolicy memory_policy_;
50 45
51 GLViewRendererManager::Key manager_key_; 46 GLViewRendererManager::Key renderer_manager_key_;
52 47
53 DISALLOW_COPY_AND_ASSIGN(HardwareRenderer); 48 DISALLOW_COPY_AND_ASSIGN(HardwareRenderer);
54 }; 49 };
55 50
56 namespace internal { 51 namespace internal {
57 52
58 class ScopedAllowGL { 53 class ScopedAllowGL {
59 public: 54 public:
60 ScopedAllowGL(); 55 ScopedAllowGL();
61 ~ScopedAllowGL(); 56 ~ScopedAllowGL();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 93
99 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; 94 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_;
100 DISALLOW_COPY_AND_ASSIGN(DeferredGpuCommandService); 95 DISALLOW_COPY_AND_ASSIGN(DeferredGpuCommandService);
101 }; 96 };
102 97
103 } // namespace internal 98 } // namespace internal
104 99
105 } // namespace android_webview 100 } // namespace android_webview
106 101
107 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ 102 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_
OLDNEW
« no previous file with comments | « android_webview/browser/global_tile_manager_unittest.cc ('k') | android_webview/browser/hardware_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698