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

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

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

Powered by Google App Engine
This is Rietveld 408576698