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

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: Have Nullable<T>::trace() use TraceIfNeeded<>. 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..db97f09ea845d0e6f4285e779260568903478def 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,7 +49,11 @@ WebGLProgram::WebGLProgram(WebGLRenderingContextBase* ctx)
WebGLProgram::~WebGLProgram()
{
- deleteObject(0);
+#if ENABLE(OILPAN)
+ m_vertexShader = nullptr;
+ m_fragmentShader = nullptr;
+#endif
+ detachAndDeleteObject();
Ken Russell (switch to Gerrit) 2014/07/19 00:27:15 Please add a comment about the need to manually ca
sof 2014/07/19 19:55:57 Added; also explained why the above clearing is do
}
void WebGLProgram::deleteObjectImpl(blink::WebGraphicsContext3D* context3d, Platform3DObject obj)
@@ -174,7 +179,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 +192,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