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

Unified Diff: Source/core/html/canvas/WebGLProgram.cpp

Issue 365653002: Oilpan: move 2D Canvas and WebGL objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make WebGLObjects keep a blink::WebGraphicsContext3D for finalization. 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/canvas/WebGLProgram.cpp
diff --git a/Source/core/html/canvas/WebGLProgram.cpp b/Source/core/html/canvas/WebGLProgram.cpp
index e1e49594139fa2240e470bc50a743be707379c4e..cdd3565ef37abff52a813be0e0651a4ae7dd08da 100644
--- a/Source/core/html/canvas/WebGLProgram.cpp
+++ b/Source/core/html/canvas/WebGLProgram.cpp
@@ -27,13 +27,14 @@
#include "core/html/canvas/WebGLProgram.h"
+#include "core/html/canvas/WebGLContextGroup.h"
#include "core/html/canvas/WebGLRenderingContextBase.h"
namespace WebCore {
-PassRefPtr<WebGLProgram> WebGLProgram::create(WebGLRenderingContextBase* ctx)
+PassRefPtrWillBeRawPtr<WebGLProgram> WebGLProgram::create(WebGLRenderingContextBase* ctx)
{
- return adoptRef(new WebGLProgram(ctx));
+ return adoptRefWillBeNoop(new WebGLProgram(ctx));
}
WebGLProgram::WebGLProgram(WebGLRenderingContextBase* ctx)
@@ -48,6 +49,11 @@ WebGLProgram::WebGLProgram(WebGLRenderingContextBase* ctx)
WebGLProgram::~WebGLProgram()
{
+#if ENABLE(OILPAN)
Mads Ager (chromium) 2014/07/11 09:15:01 Instead of clearing the pointers here could we #if
+ m_vertexShader = nullptr;
+ m_fragmentShader = nullptr;
+#endif
+ detach();
deleteObject(0);
}
@@ -174,7 +180,9 @@ void WebGLProgram::cacheInfoIfNeeded()
if (!object())
return;
- blink::WebGraphicsContext3D* context = getAWebGraphicsContext3D();
+ if (!contextGroup())
+ return;
+ blink::WebGraphicsContext3D* context = contextGroup()->getAWebGraphicsContext3D();
if (!context)
return;
GLint linkStatus = 0;
@@ -185,4 +193,11 @@ void WebGLProgram::cacheInfoIfNeeded()
m_infoValid = true;
}
+void WebGLProgram::trace(Visitor* visitor)
+{
+ visitor->trace(m_vertexShader);
+ visitor->trace(m_fragmentShader);
+ WebGLSharedObject::trace(visitor);
+}
+
}

Powered by Google App Engine
This is Rietveld 408576698