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

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

Issue 381113003: Revert 177827 "WebGL: Free temporary GPU resources held by inact..." (Closed) Base URL: svn://svn.chromium.org/blink/
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: trunk/Source/core/html/HTMLCanvasElement.cpp
===================================================================
--- trunk/Source/core/html/HTMLCanvasElement.cpp (revision 177853)
+++ trunk/Source/core/html/HTMLCanvasElement.cpp (working copy)
@@ -650,15 +650,17 @@
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