From d734f220da466c52f94423acc91bb347ef8811dd Mon Sep 17 00:00:00 2001 From: "gman@google.com" Date: Wed, 12 Aug 2009 02:07:09 +0000 Subject: A few more cleanup items for bitmap and message_Commands git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23138 0039d316-1c4b-4281-b951-d872f2087c98 --- o3d/core/cross/bitmap.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'o3d/core/cross/bitmap.h') diff --git a/o3d/core/cross/bitmap.h b/o3d/core/cross/bitmap.h index a116ecb..2188fc9c 100644 --- a/o3d/core/cross/bitmap.h +++ b/o3d/core/cross/bitmap.h @@ -144,11 +144,6 @@ class Bitmap : public ParamObject { const void* src_data, int src_pitch); - // Gets the total size of the bitmap data, counting all faces and mip levels. - size_t GetTotalSize() const { - return GetMipChainSize(num_mipmaps_); - } - // Gets the image data for a given mip-map level. // Parameters: // level: mip level to get. @@ -296,7 +291,14 @@ class Bitmap : public ParamObject { unsigned int num_mipmaps, uint8 *data); + // Gets the total size of the bitmap data, counting all faces and mip levels. + size_t GetTotalSize() const { + return GetMipChainSize(image::ComputeMipMapCount(width_, height_)); + } + // pointer to the raw bitmap data + // NOTE: image_data_ is either NULL or it has space for the maximum number + // of mips for the current size bitmap, even if they are not used. scoped_array image_data_; // format of the texture this is meant to represent. Texture::Format format_; @@ -304,7 +306,7 @@ class Bitmap : public ParamObject { int width_; // height of the bitmap in pixels. int height_; - // number of mipmap levels in this texture. + // number of valid mipmap levels in this bitmap. unsigned int num_mipmaps_; // The purpose of the bitmap Semantic semantic_; -- cgit v1.1