| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 return false; | 266 return false; |
| 267 if (m_needToUseBlackTexture) | 267 if (m_needToUseBlackTexture) |
| 268 return true; | 268 return true; |
| 269 if ((m_isFloatType && !(flag & TextureFloatLinearExtensionEnabled)) || (m_is
HalfFloatType && !(flag && TextureHalfFloatLinearExtensionEnabled))) { | 269 if ((m_isFloatType && !(flag & TextureFloatLinearExtensionEnabled)) || (m_is
HalfFloatType && !(flag && TextureHalfFloatLinearExtensionEnabled))) { |
| 270 if (m_magFilter != GL_NEAREST || (m_minFilter != GL_NEAREST && m_minFilt
er != GL_NEAREST_MIPMAP_NEAREST)) | 270 if (m_magFilter != GL_NEAREST || (m_minFilter != GL_NEAREST && m_minFilt
er != GL_NEAREST_MIPMAP_NEAREST)) |
| 271 return true; | 271 return true; |
| 272 } | 272 } |
| 273 return false; | 273 return false; |
| 274 } | 274 } |
| 275 | 275 |
| 276 void WebGLTexture::deleteObjectImpl(blink::WebGraphicsContext3D* context3d) | 276 void WebGLTexture::deleteObjectImpl(WebGraphicsContext3D* context3d) |
| 277 { | 277 { |
| 278 context3d->deleteTexture(m_object); | 278 context3d->deleteTexture(m_object); |
| 279 m_object = 0; | 279 m_object = 0; |
| 280 } | 280 } |
| 281 | 281 |
| 282 int WebGLTexture::mapTargetToIndex(GLenum target) const | 282 int WebGLTexture::mapTargetToIndex(GLenum target) const |
| 283 { | 283 { |
| 284 if (m_target == GL_TEXTURE_2D) { | 284 if (m_target == GL_TEXTURE_2D) { |
| 285 if (target == GL_TEXTURE_2D) | 285 if (target == GL_TEXTURE_2D) |
| 286 return 0; | 286 return 0; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 if (!object() || !m_target) | 411 if (!object() || !m_target) |
| 412 return nullptr; | 412 return nullptr; |
| 413 int targetIndex = mapTargetToIndex(target); | 413 int targetIndex = mapTargetToIndex(target); |
| 414 if (targetIndex < 0 || targetIndex >= static_cast<int>(m_info.size())) | 414 if (targetIndex < 0 || targetIndex >= static_cast<int>(m_info.size())) |
| 415 return nullptr; | 415 return nullptr; |
| 416 if (level < 0 || level >= static_cast<GLint>(m_info[targetIndex].size())) | 416 if (level < 0 || level >= static_cast<GLint>(m_info[targetIndex].size())) |
| 417 return nullptr; | 417 return nullptr; |
| 418 return &(m_info[targetIndex][level]); | 418 return &(m_info[targetIndex][level]); |
| 419 } | 419 } |
| 420 | 420 |
| 421 } | 421 } // namespace blink |
| OLD | NEW |