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

Unified 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: Remove "HardwareRenderer::GetMemoryPolicy" declaration Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: android_webview/browser/hardware_renderer.h
diff --git a/android_webview/browser/hardware_renderer.h b/android_webview/browser/hardware_renderer.h
index 4f226d2890896b9e0ed32c477935a3efa89b2c6e..24260c6dc13c2aca9c2cd48a0a8e42a72043bac3 100644
--- a/android_webview/browser/hardware_renderer.h
+++ b/android_webview/browser/hardware_renderer.h
@@ -8,6 +8,7 @@
#include <queue>
#include "android_webview/browser/gl_view_renderer_manager.h"
+#include "android_webview/browser/global_tile_manager.h"
#include "android_webview/browser/shared_renderer_state.h"
#include "base/memory/ref_counted.h"
#include "content/public/browser/android/synchronous_compositor.h"
@@ -33,11 +34,16 @@ class HardwareRenderer {
bool DrawGL(AwDrawGLInfo* draw_info, DrawGLResult* result);
bool TrimMemory(int level, bool visible);
+ size_t ForceDropTiles();
+
+ // If the hardware renderer gets hungry for more than kStarvedTimes in a row,
+ // it becomes starved.
+ bool IsStarved();
+
private:
friend class internal::DeferredGpuCommandService;
void SetMemoryPolicy(content::SynchronousCompositorMemoryPolicy& new_policy);
-
SharedRendererState* shared_renderer_state_;
typedef void* EGLContext;
@@ -46,7 +52,12 @@ class HardwareRenderer {
scoped_refptr<AwGLSurface> gl_surface_;
content::SynchronousCompositorMemoryPolicy memory_policy_;
- GLViewRendererManager::Key manager_key_;
+ GLViewRendererManager::Key renderer_manager_key_;
+ GlobalTileManager::Key tile_manager_key_;
+
+ // Number of times the hardware renderer gets the tile allocation less than
+ // kGrallocHungryLimit
+ size_t num_hungry_;
DISALLOW_COPY_AND_ASSIGN(HardwareRenderer);
};

Powered by Google App Engine
This is Rietveld 408576698