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

Unified Diff: Source/core/page/Page.cpp

Issue 117703004: Free temporary GPU and memory resources held by inactive or hidden 2D canvases (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed upstream git branch Created 7 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: Source/core/page/Page.cpp
diff --git a/Source/core/page/Page.cpp b/Source/core/page/Page.cpp
index 4f2de052953eee2048ea43e404e5b7be50fe4496..276093aae55c9766e93e0bcf21762363bad09f06 100644
--- a/Source/core/page/Page.cpp
+++ b/Source/core/page/Page.cpp
@@ -56,6 +56,7 @@
#include "core/rendering/TextAutosizer.h"
#include "core/storage/StorageNamespace.h"
#include "core/workers/SharedWorkerRepositoryClient.h"
+#include "platform/graphics/Canvas2DLayerManager.h"
#include "platform/plugins/PluginData.h"
#include "wtf/HashMap.h"
#include "wtf/RefCountedLeakCounter.h"
@@ -466,6 +467,9 @@ void Page::setVisibilityState(PageVisibilityState visibilityState, bool isInitia
if (!isInitialState && m_mainFrame)
m_mainFrame->dispatchVisibilityStateChangeEvent();
+
+ if (visibilityState == WebCore::PageVisibilityStateHidden)
+ Canvas2DLayerManager::get().didHidePage();
}
PageVisibilityState Page::visibilityState() const

Powered by Google App Engine
This is Rietveld 408576698