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

Unified Diff: third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp

Issue 1482363004: Fixing laggy chrome on a multitude of accelerated canvases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moving variables to ImageBuffer and Adding Unit Test 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/Canvas2DLayerBridge.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
index b9ce0de3eb97660edfe0a1fa28f7173b660339cf..7979ec855bc2b6467bbc36af2a56c0c3a00d87d3 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -187,6 +187,7 @@ SkSurface* Canvas2DLayerBridge::getOrCreateSurface(AccelerationHint hint)
bool surfaceIsAccelerated;
m_surface = createSkSurface(wantAccelerated ? m_contextProvider->grContext() : nullptr, m_size, m_msaaSampleCount, m_opacityMode, &surfaceIsAccelerated);
+ m_imageBuffer->updateGPUMemoryUsage();
Justin Novosad 2015/12/08 22:15:27 Should call this after creating m_layer, otherwise
if (m_surface && surfaceIsAccelerated && !m_layer) {
m_layer = adoptPtr(Platform::current()->compositorSupport()->createExternalTextureLayer(this));
@@ -403,6 +404,7 @@ bool Canvas2DLayerBridge::restoreSurface()
// Therefore, we can only accept the restored surface if it is accelerated.
if (surface.get() && surfaceIsAccelerated) {
m_surface = surface.release();
+ m_imageBuffer->updateGPUMemoryUsage();
// FIXME: draw sad canvas picture into new buffer crbug.com/243842
}
}

Powered by Google App Engine
This is Rietveld 408576698