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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // the references to prevent deleteObjectImpl() from trying to do | 52 // the references to prevent deleteObjectImpl() from trying to do |
53 // same, as we cannot safely access other heap objects from this | 53 // same, as we cannot safely access other heap objects from this |
54 // destructor. | 54 // destructor. |
55 m_vertexShader = nullptr; | 55 m_vertexShader = nullptr; |
56 m_fragmentShader = nullptr; | 56 m_fragmentShader = nullptr; |
57 | 57 |
58 // See the comment in WebGLObject::detachAndDeleteObject(). | 58 // See the comment in WebGLObject::detachAndDeleteObject(). |
59 detachAndDeleteObject(); | 59 detachAndDeleteObject(); |
60 } | 60 } |
61 | 61 |
62 void WebGLProgram::deleteObjectImpl(WebGraphicsContext3D* context3d, gpu::gles2:
:GLES2Interface* gl) | 62 void WebGLProgram::deleteObjectImpl(gpu::gles2::GLES2Interface* gl) |
63 { | 63 { |
64 gl->DeleteProgram(m_object); | 64 gl->DeleteProgram(m_object); |
65 m_object = 0; | 65 m_object = 0; |
66 if (m_vertexShader) { | 66 if (m_vertexShader) { |
67 m_vertexShader->onDetached(context3d, gl); | 67 m_vertexShader->onDetached(gl); |
68 m_vertexShader = nullptr; | 68 m_vertexShader = nullptr; |
69 } | 69 } |
70 if (m_fragmentShader) { | 70 if (m_fragmentShader) { |
71 m_fragmentShader->onDetached(context3d, gl); | 71 m_fragmentShader->onDetached(gl); |
72 m_fragmentShader = nullptr; | 72 m_fragmentShader = nullptr; |
73 } | 73 } |
74 } | 74 } |
75 | 75 |
76 bool WebGLProgram::linkStatus(WebGLRenderingContextBase* context) | 76 bool WebGLProgram::linkStatus(WebGLRenderingContextBase* context) |
77 { | 77 { |
78 cacheInfoIfNeeded(context); | 78 cacheInfoIfNeeded(context); |
79 return m_linkStatus; | 79 return m_linkStatus; |
80 } | 80 } |
81 | 81 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 } | 160 } |
161 | 161 |
162 DEFINE_TRACE(WebGLProgram) | 162 DEFINE_TRACE(WebGLProgram) |
163 { | 163 { |
164 visitor->trace(m_vertexShader); | 164 visitor->trace(m_vertexShader); |
165 visitor->trace(m_fragmentShader); | 165 visitor->trace(m_fragmentShader); |
166 WebGLSharedPlatform3DObject::trace(visitor); | 166 WebGLSharedPlatform3DObject::trace(visitor); |
167 } | 167 } |
168 | 168 |
169 } // namespace blink | 169 } // namespace blink |
OLD | NEW |