| 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 24 matching lines...) Expand all Loading... |
| 35 } | 35 } |
| 36 | 36 |
| 37 WebGLTexture::WebGLTexture(WebGLRenderingContextBase* ctx) | 37 WebGLTexture::WebGLTexture(WebGLRenderingContextBase* ctx) |
| 38 : WebGLSharedPlatform3DObject(ctx), m_target(0) { | 38 : WebGLSharedPlatform3DObject(ctx), m_target(0) { |
| 39 GLuint texture; | 39 GLuint texture; |
| 40 ctx->contextGL()->GenTextures(1, &texture); | 40 ctx->contextGL()->GenTextures(1, &texture); |
| 41 setObject(texture); | 41 setObject(texture); |
| 42 } | 42 } |
| 43 | 43 |
| 44 WebGLTexture::~WebGLTexture() { | 44 WebGLTexture::~WebGLTexture() { |
| 45 // See the comment in WebGLObject::detachAndDeleteObject(). | 45 runDestructor(); |
| 46 detachAndDeleteObject(); | |
| 47 } | 46 } |
| 48 | 47 |
| 49 void WebGLTexture::setTarget(GLenum target) { | 48 void WebGLTexture::setTarget(GLenum target) { |
| 50 if (!object()) | 49 if (!object()) |
| 51 return; | 50 return; |
| 52 // Target is finalized the first time bindTexture() is called. | 51 // Target is finalized the first time bindTexture() is called. |
| 53 if (m_target) | 52 if (m_target) |
| 54 return; | 53 return; |
| 55 m_target = target; | 54 m_target = target; |
| 56 } | 55 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 if (x) { | 103 if (x) { |
| 105 value = x; | 104 value = x; |
| 106 log += shift; | 105 log += shift; |
| 107 } | 106 } |
| 108 } | 107 } |
| 109 ASSERT(value == 1); | 108 ASSERT(value == 1); |
| 110 return log + 1; | 109 return log + 1; |
| 111 } | 110 } |
| 112 | 111 |
| 113 } // namespace blink | 112 } // namespace blink |
| OLD | NEW |