Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Side by Side Diff: core/cross/gl/texture_gl.cc

Issue 5591006: Add an API to allow JavaScript to determine the framerate of individual dynam... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « core/cross/cairo/texture_cairo.cc ('k') | core/cross/gles2/texture_gles2.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 } 444 }
445 } 445 }
446 } else { 446 } else {
447 glCompressedTexSubImage2D( 447 glCompressedTexSubImage2D(
448 GL_TEXTURE_2D, level, 0, 0, src_width, src_height, 448 GL_TEXTURE_2D, level, 0, 0, src_width, src_height,
449 gl_internal_format, 449 gl_internal_format,
450 image::ComputeMipChainSize(src_width, src_height, format(), 1), 450 image::ComputeMipChainSize(src_width, src_height, format(), 1),
451 src_data); 451 src_data);
452 } 452 }
453 } 453 }
454 if (level == 0) {
455 TextureUpdated();
456 }
454 } 457 }
455 458
456 // Locks the given mipmap level of this texture for loading from main memory, 459 // Locks the given mipmap level of this texture for loading from main memory,
457 // and returns a pointer to the buffer. 460 // and returns a pointer to the buffer.
458 bool Texture2DGL::PlatformSpecificLock( 461 bool Texture2DGL::PlatformSpecificLock(
459 int level, void** data, int* pitch, Texture::AccessMode mode) { 462 int level, void** data, int* pitch, Texture::AccessMode mode) {
460 DLOG(INFO) << "Texture2DGL Lock"; 463 DLOG(INFO) << "Texture2DGL Lock";
461 DCHECK(data); 464 DCHECK(data);
462 DCHECK(pitch); 465 DCHECK(pitch);
463 DCHECK_GE(level, 0); 466 DCHECK_GE(level, 0);
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 } 785 }
783 } 786 }
784 } else { 787 } else {
785 glCompressedTexSubImage2D( 788 glCompressedTexSubImage2D(
786 gl_face, level, 0, 0, src_width, src_height, 789 gl_face, level, 0, 0, src_width, src_height,
787 gl_internal_format, 790 gl_internal_format,
788 image::ComputeMipChainSize(src_width, src_height, format(), 1), 791 image::ComputeMipChainSize(src_width, src_height, format(), 1),
789 src_data); 792 src_data);
790 } 793 }
791 } 794 }
795 if (level == 0) {
796 TextureUpdated();
797 }
792 } 798 }
793 799
794 // Locks the given face and mipmap level of this texture for loading from 800 // Locks the given face and mipmap level of this texture for loading from
795 // main memory, and returns a pointer to the buffer. 801 // main memory, and returns a pointer to the buffer.
796 bool TextureCUBEGL::PlatformSpecificLock( 802 bool TextureCUBEGL::PlatformSpecificLock(
797 CubeFace face, int level, void** data, int* pitch, 803 CubeFace face, int level, void** data, int* pitch,
798 Texture::AccessMode mode) { 804 Texture::AccessMode mode) {
799 DLOG(INFO) << "TextureCUBEGL Lock"; 805 DLOG(INFO) << "TextureCUBEGL Lock";
800 DCHECK_GE(level, 0); 806 DCHECK_GE(level, 0);
801 DCHECK_LT(level, levels()); 807 DCHECK_LT(level, levels());
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 } 875 }
870 CHECK_GL_ERROR(); 876 CHECK_GL_ERROR();
871 return false; 877 return false;
872 } 878 }
873 879
874 const Texture::RGBASwizzleIndices& TextureCUBEGL::GetABGR32FSwizzleIndices() { 880 const Texture::RGBASwizzleIndices& TextureCUBEGL::GetABGR32FSwizzleIndices() {
875 return g_gl_abgr32f_swizzle_indices; 881 return g_gl_abgr32f_swizzle_indices;
876 } 882 }
877 883
878 } // namespace o3d 884 } // namespace o3d
OLDNEW
« no previous file with comments | « core/cross/cairo/texture_cairo.cc ('k') | core/cross/gles2/texture_gles2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698