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

Unified Diff: third_party/WebKit/Source/platform/graphics/ImageBuffer.h

Issue 1482363004: Fixing laggy chrome on a multitude of accelerated canvases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: m_imageBuffer nullibility check to ensure other unrelated unit tests on layerbridge not fail Created 5 years 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: third_party/WebKit/Source/platform/graphics/ImageBuffer.h
diff --git a/third_party/WebKit/Source/platform/graphics/ImageBuffer.h b/third_party/WebKit/Source/platform/graphics/ImageBuffer.h
index 41a0a957b338dc2c0528d86adb398ca5b28ae807..b4101bb5ae011320470207c0fd5ad07777d89612 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageBuffer.h
+++ b/third_party/WebKit/Source/platform/graphics/ImageBuffer.h
@@ -131,6 +131,10 @@ public:
void draw(GraphicsContext*, const FloatRect&, const FloatRect*, SkXfermode::Mode);
+ void updateGPUMemoryUsage() const;
+ static intptr_t getGlobalGPUMemoryUsage() { return s_globalGPUMemoryUsage; }
+ intptr_t getGPUMemoryUsage() { return m_gpuMemoryUsage; }
+
private:
ImageBuffer(PassOwnPtr<ImageBufferSurface>);
@@ -142,6 +146,9 @@ private:
mutable SnapshotState m_snapshotState;
OwnPtr<ImageBufferSurface> m_surface;
ImageBufferClient* m_client;
+
+ mutable intptr_t m_gpuMemoryUsage;
+ static intptr_t s_globalGPUMemoryUsage;
};
struct ImageDataBuffer {

Powered by Google App Engine
This is Rietveld 408576698