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

Side by Side 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: Complete VectorTraits<> specialization for VertexAttribState 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 13 matching lines...) Expand all
24 */ 24 */
25 25
26 #include "config.h" 26 #include "config.h"
27 27
28 #include "core/html/canvas/WebGLProgram.h" 28 #include "core/html/canvas/WebGLProgram.h"
29 29
30 #include "core/html/canvas/WebGLRenderingContextBase.h" 30 #include "core/html/canvas/WebGLRenderingContextBase.h"
31 31
32 namespace WebCore { 32 namespace WebCore {
33 33
34 PassRefPtr<WebGLProgram> WebGLProgram::create(WebGLRenderingContextBase* ctx) 34 PassRefPtrWillBeRawPtr<WebGLProgram> WebGLProgram::create(WebGLRenderingContextB ase* ctx)
35 { 35 {
36 return adoptRef(new WebGLProgram(ctx)); 36 return adoptRefWillBeNoop(new WebGLProgram(ctx));
37 } 37 }
38 38
39 WebGLProgram::WebGLProgram(WebGLRenderingContextBase* ctx) 39 WebGLProgram::WebGLProgram(WebGLRenderingContextBase* ctx)
40 : WebGLSharedObject(ctx) 40 : WebGLSharedObject(ctx)
41 , m_linkStatus(false) 41 , m_linkStatus(false)
42 , m_linkCount(0) 42 , m_linkCount(0)
43 , m_infoValid(true) 43 , m_infoValid(true)
44 { 44 {
45 ScriptWrappable::init(this); 45 ScriptWrappable::init(this);
46 setObject(ctx->webContext()->createProgram()); 46 setObject(ctx->webContext()->createProgram());
47 } 47 }
48 48
49 WebGLProgram::~WebGLProgram() 49 WebGLProgram::~WebGLProgram()
50 { 50 {
51 deleteObject(0); 51 deleteObject(0);
haraken 2014/07/02 07:47:38 Ditto. I'm not sure if deleteObject() doesn't touc
sof 2014/07/02 11:43:52 It makes the assumption that the context group is
52 } 52 }
53 53
54 void WebGLProgram::deleteObjectImpl(blink::WebGraphicsContext3D* context3d, Plat form3DObject obj) 54 void WebGLProgram::deleteObjectImpl(blink::WebGraphicsContext3D* context3d, Plat form3DObject obj)
55 { 55 {
56 context3d->deleteProgram(obj); 56 context3d->deleteProgram(obj);
57 if (m_vertexShader) { 57 if (m_vertexShader) {
58 m_vertexShader->onDetached(context3d); 58 m_vertexShader->onDetached(context3d);
59 m_vertexShader = nullptr; 59 m_vertexShader = nullptr;
60 } 60 }
61 if (m_fragmentShader) { 61 if (m_fragmentShader) {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 if (!context) 178 if (!context)
179 return; 179 return;
180 GLint linkStatus = 0; 180 GLint linkStatus = 0;
181 context->getProgramiv(object(), GL_LINK_STATUS, &linkStatus); 181 context->getProgramiv(object(), GL_LINK_STATUS, &linkStatus);
182 m_linkStatus = linkStatus; 182 m_linkStatus = linkStatus;
183 if (m_linkStatus) 183 if (m_linkStatus)
184 cacheActiveAttribLocations(context); 184 cacheActiveAttribLocations(context);
185 m_infoValid = true; 185 m_infoValid = true;
186 } 186 }
187 187
188 void WebGLProgram::trace(Visitor* visitor)
189 {
190 visitor->trace(m_vertexShader);
191 visitor->trace(m_fragmentShader);
192 WebGLSharedObject::trace(visitor);
188 } 193 }
194
195 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698