summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
authorcrogers@google.com <crogers@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-12 19:04:32 +0000
committercrogers@google.com <crogers@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-12 19:04:32 +0000
commit9fc286c694089736ee8e7b740302dc4dd080a6aa (patch)
treeecc1b95fd7d9b396481d10813a4ae4dc016f8083 /o3d
parent3c4d9f7458b5cef04566015cd21007e38a3f6865 (diff)
downloadchromium_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.h6
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.