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

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

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: improved test Created 6 years, 11 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.h
diff --git a/Source/core/html/HTMLCanvasElement.h b/Source/core/html/HTMLCanvasElement.h
index 7244986e7c1536d6e8e8298932dbe871078b4a54..44fe971c17ceec571208407b4a7a4549e761261d 100644
--- a/Source/core/html/HTMLCanvasElement.h
+++ b/Source/core/html/HTMLCanvasElement.h
@@ -31,6 +31,7 @@
#include "core/html/HTMLElement.h"
#include "platform/geometry/FloatRect.h"
#include "platform/geometry/IntSize.h"
+#include "platform/graphics/Canvas2DLayerBridge.h"
Stephen White 2014/01/24 18:52:35 Is this still necessary? I see DocumentVisibilityO
#include "wtf/Forward.h"
#define DefaultInterpolationQuality InterpolationMedium
@@ -58,7 +59,7 @@ public:
virtual void canvasDestroyed(HTMLCanvasElement*) = 0;
};
-class HTMLCanvasElement FINAL : public HTMLElement {
+class HTMLCanvasElement FINAL : public HTMLElement, public DocumentVisibilityObserver {
public:
static PassRefPtr<HTMLCanvasElement> create(Document&);
virtual ~HTMLCanvasElement();
@@ -127,6 +128,12 @@ public:
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
+ // DocumentVisibilityObserver implementation
+ virtual void didChangeVisibilityState(PageVisibilityState) OVERRIDE;
+
+protected:
+ virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE;
+
private:
explicit HTMLCanvasElement(Document&);

Powered by Google App Engine
This is Rietveld 408576698