Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 } | |
| OLD | NEW |