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

Unified Diff: Source/core/html/HTMLCanvasElement.cpp

Issue 385663002: Revert of WebGL: Free temporary GPU resources held by inactive or hidden WebGL. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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: Source/core/html/HTMLCanvasElement.cpp
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp
index 80bfc3112a75235d2a1458a52fd19114b2c75bc9..bff1d0678e104fb06abbebdc0c4de0344297ea9e 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -650,14 +650,16 @@
void HTMLCanvasElement::didChangeVisibilityState(PageVisibilityState visibility)
{
- if (!m_context)
- return;
- bool hidden = visibility != PageVisibilityStateVisible;
- m_context->setIsHidden(hidden);
- if (hidden) {
- clearCopiedImage();
- if (is3D()) {
- discardImageBuffer();
+ if (hasImageBuffer()) {
+ bool hidden = visibility != PageVisibilityStateVisible;
+ if (hidden) {
+ clearCopiedImage();
+ if (is3D()) {
+ discardImageBuffer();
+ }
+ }
+ if (hasImageBuffer()) {
+ m_imageBuffer->setIsHidden(hidden);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698