| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 } | 486 } |
| 487 } | 487 } |
| 488 } else { | 488 } else { |
| 489 glCompressedTexSubImage2D( | 489 glCompressedTexSubImage2D( |
| 490 GL_TEXTURE_2D, level, 0, 0, src_width, src_height, | 490 GL_TEXTURE_2D, level, 0, 0, src_width, src_height, |
| 491 gl_internal_format, | 491 gl_internal_format, |
| 492 image::ComputeMipChainSize(src_width, src_height, format(), 1), | 492 image::ComputeMipChainSize(src_width, src_height, format(), 1), |
| 493 src_data); | 493 src_data); |
| 494 } | 494 } |
| 495 } | 495 } |
| 496 if (level == 0) { |
| 497 TextureUpdated(); |
| 498 } |
| 496 } | 499 } |
| 497 | 500 |
| 498 // Locks the given mipmap level of this texture for loading from main memory, | 501 // Locks the given mipmap level of this texture for loading from main memory, |
| 499 // and returns a pointer to the buffer. | 502 // and returns a pointer to the buffer. |
| 500 bool Texture2DGLES2::PlatformSpecificLock( | 503 bool Texture2DGLES2::PlatformSpecificLock( |
| 501 int level, void** data, int* pitch, Texture::AccessMode mode) { | 504 int level, void** data, int* pitch, Texture::AccessMode mode) { |
| 502 DLOG(INFO) << "Texture2DGLES2 Lock"; | 505 DLOG(INFO) << "Texture2DGLES2 Lock"; |
| 503 DCHECK(data); | 506 DCHECK(data); |
| 504 DCHECK(pitch); | 507 DCHECK(pitch); |
| 505 DCHECK_GE(level, 0); | 508 DCHECK_GE(level, 0); |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 } | 839 } |
| 837 } | 840 } |
| 838 } else { | 841 } else { |
| 839 glCompressedTexSubImage2D( | 842 glCompressedTexSubImage2D( |
| 840 gl_face, level, 0, 0, src_width, src_height, | 843 gl_face, level, 0, 0, src_width, src_height, |
| 841 gl_internal_format, | 844 gl_internal_format, |
| 842 image::ComputeMipChainSize(src_width, src_height, format(), 1), | 845 image::ComputeMipChainSize(src_width, src_height, format(), 1), |
| 843 src_data); | 846 src_data); |
| 844 } | 847 } |
| 845 } | 848 } |
| 849 if (level == 0) { |
| 850 TextureUpdated(); |
| 851 } |
| 846 } | 852 } |
| 847 | 853 |
| 848 // Locks the given face and mipmap level of this texture for loading from | 854 // Locks the given face and mipmap level of this texture for loading from |
| 849 // main memory, and returns a pointer to the buffer. | 855 // main memory, and returns a pointer to the buffer. |
| 850 bool TextureCUBEGLES2::PlatformSpecificLock( | 856 bool TextureCUBEGLES2::PlatformSpecificLock( |
| 851 CubeFace face, int level, void** data, int* pitch, | 857 CubeFace face, int level, void** data, int* pitch, |
| 852 Texture::AccessMode mode) { | 858 Texture::AccessMode mode) { |
| 853 DLOG(INFO) << "TextureCUBEGLES2 Lock"; | 859 DLOG(INFO) << "TextureCUBEGLES2 Lock"; |
| 854 DCHECK_GE(level, 0); | 860 DCHECK_GE(level, 0); |
| 855 DCHECK_LT(level, levels()); | 861 DCHECK_LT(level, levels()); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 CHECK_GL_ERROR(); | 934 CHECK_GL_ERROR(); |
| 929 return false; | 935 return false; |
| 930 } | 936 } |
| 931 | 937 |
| 932 const Texture::RGBASwizzleIndices& | 938 const Texture::RGBASwizzleIndices& |
| 933 TextureCUBEGLES2::GetABGR32FSwizzleIndices() { | 939 TextureCUBEGLES2::GetABGR32FSwizzleIndices() { |
| 934 return g_gl_abgr32f_swizzle_indices; | 940 return g_gl_abgr32f_swizzle_indices; |
| 935 } | 941 } |
| 936 | 942 |
| 937 } // namespace o3d | 943 } // namespace o3d |
| OLD | NEW |