| 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 22 matching lines...) Expand all Loading... |
| 33 WebGLShader* WebGLShader::create(WebGLRenderingContextBase* ctx, GLenum type) { | 33 WebGLShader* WebGLShader::create(WebGLRenderingContextBase* ctx, GLenum type) { |
| 34 return new WebGLShader(ctx, type); | 34 return new WebGLShader(ctx, type); |
| 35 } | 35 } |
| 36 | 36 |
| 37 WebGLShader::WebGLShader(WebGLRenderingContextBase* ctx, GLenum type) | 37 WebGLShader::WebGLShader(WebGLRenderingContextBase* ctx, GLenum type) |
| 38 : WebGLSharedPlatform3DObject(ctx), m_type(type), m_source("") { | 38 : WebGLSharedPlatform3DObject(ctx), m_type(type), m_source("") { |
| 39 setObject(ctx->contextGL()->CreateShader(type)); | 39 setObject(ctx->contextGL()->CreateShader(type)); |
| 40 } | 40 } |
| 41 | 41 |
| 42 WebGLShader::~WebGLShader() { | 42 WebGLShader::~WebGLShader() { |
| 43 // See the comment in WebGLObject::detachAndDeleteObject(). | 43 runDestructor(); |
| 44 detachAndDeleteObject(); | |
| 45 } | 44 } |
| 46 | 45 |
| 47 void WebGLShader::deleteObjectImpl(gpu::gles2::GLES2Interface* gl) { | 46 void WebGLShader::deleteObjectImpl(gpu::gles2::GLES2Interface* gl) { |
| 48 gl->DeleteShader(m_object); | 47 gl->DeleteShader(m_object); |
| 49 m_object = 0; | 48 m_object = 0; |
| 50 } | 49 } |
| 51 | 50 |
| 52 } // namespace blink | 51 } // namespace blink |
| OLD | NEW |