diff options
author | crogers@google.com <crogers@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-12 19:04:32 +0000 |
---|---|---|
committer | crogers@google.com <crogers@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-12 19:04:32 +0000 |
commit | 9fc286c694089736ee8e7b740302dc4dd080a6aa (patch) | |
tree | ecc1b95fd7d9b396481d10813a4ae4dc016f8083 /o3d | |
parent | 3c4d9f7458b5cef04566015cd21007e38a3f6865 (diff) | |
download | chromium_src-9fc286c694089736ee8e7b740302dc4dd080a6aa.zip chromium_src-9fc286c694089736ee8e7b740302dc4dd080a6aa.tar.gz chromium_src-9fc286c694089736ee8e7b740302dc4dd080a6aa.tar.bz2 |
Fix the bitmap class to zero out memory when it's allocated to avoid garbage on the screen
Review URL: http://codereview.chromium.org/126018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18300 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r-- | o3d/core/cross/bitmap.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/o3d/core/cross/bitmap.h b/o3d/core/cross/bitmap.h index dde6e5e..1d16d4f7 100644 --- a/o3d/core/cross/bitmap.h +++ b/o3d/core/cross/bitmap.h @@ -40,6 +40,8 @@ #ifndef O3D_CORE_CROSS_BITMAP_H_ #define O3D_CORE_CROSS_BITMAP_H_ +#include <stdlib.h> + #include "base/cross/bits.h" #include "core/cross/types.h" #include "core/cross/texture.h" @@ -118,9 +120,11 @@ class Bitmap { unsigned int num_mipmaps, bool cube_map); - // Allocates a bitmap with initialized paramters. + // Allocates a bitmap with initialized parameters. + // data is zero-initialized void AllocateData() { image_data_.reset(new unsigned char[GetTotalSize()]); + memset(image_data_.get(), 0, GetTotalSize()); } // Frees the data owned by the bitmap. |