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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 if (m_info.size() > 1 && !m_isCubeComplete) | 371 if (m_info.size() > 1 && !m_isCubeComplete) |
372 m_needToUseBlackTexture = true; | 372 m_needToUseBlackTexture = true; |
373 // Completeness | 373 // Completeness |
374 if (!m_isComplete && m_minFilter != GL_NEAREST && m_minFilter != GL_LINEAR) | 374 if (!m_isComplete && m_minFilter != GL_NEAREST && m_minFilter != GL_LINEAR) |
375 m_needToUseBlackTexture = true; | 375 m_needToUseBlackTexture = true; |
376 } | 376 } |
377 | 377 |
378 const WebGLTexture::LevelInfo* WebGLTexture::getLevelInfo(GLenum target, GLint l
evel) const | 378 const WebGLTexture::LevelInfo* WebGLTexture::getLevelInfo(GLenum target, GLint l
evel) const |
379 { | 379 { |
380 if (!object() || !m_target) | 380 if (!object() || !m_target) |
381 return 0; | 381 return nullptr; |
382 int targetIndex = mapTargetToIndex(target); | 382 int targetIndex = mapTargetToIndex(target); |
383 if (targetIndex < 0 || targetIndex >= static_cast<int>(m_info.size())) | 383 if (targetIndex < 0 || targetIndex >= static_cast<int>(m_info.size())) |
384 return 0; | 384 return nullptr; |
385 if (level < 0 || level >= static_cast<GLint>(m_info[targetIndex].size())) | 385 if (level < 0 || level >= static_cast<GLint>(m_info[targetIndex].size())) |
386 return 0; | 386 return nullptr; |
387 return &(m_info[targetIndex][level]); | 387 return &(m_info[targetIndex][level]); |
388 } | 388 } |
389 | 389 |
390 } | 390 } |
OLD | NEW |