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

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: rebase to ToT Created 6 years, 8 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 54f25ea62e6ae151385ddb556821a6cb4390dd09..593a31720ad031e89ab7116769244524035dd6ce 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -638,16 +638,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();
}
}
}
« no previous file with comments | « no previous file | Source/core/html/canvas/CanvasRenderingContext.h » ('j') | Source/core/html/canvas/WebGLRenderingContextBase.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698