summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-24 17:37:06 +0000
committerkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-24 17:37:06 +0000
commitc9c4cc8c91f50175f5434c97142a9539bf3624f6 (patch)
tree644af5850827369a45cb71b91f8604673f82935f /chrome/common
parent0651f87ac4a29ffd209729da04d4ae1ac215ddf5 (diff)
downloadchromium_src-c9c4cc8c91f50175f5434c97142a9539bf3624f6.zip
chromium_src-c9c4cc8c91f50175f5434c97142a9539bf3624f6.tar.gz
chromium_src-c9c4cc8c91f50175f5434c97142a9539bf3624f6.tar.bz2
Make resource bundle return red square box again instead of empty bitmap
as it looks like some users get NULL when they ask for bitmap resource. BUG=1432071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3922 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/resource_bundle.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/common/resource_bundle.cc b/chrome/common/resource_bundle.cc
index f6a47b8..2676bd6 100644
--- a/chrome/common/resource_bundle.cc
+++ b/chrome/common/resource_bundle.cc
@@ -171,8 +171,13 @@ SkBitmap* ResourceBundle::GetBitmapNamed(int resource_id) {
// Handle the case where loading the bitmap failed.
if (!bitmap) {
LOG(WARNING) << "Unable to load bitmap with id " << resource_id;
+ NOTREACHED(); // Want to assert in debug mode.
if (!empty_bitmap) {
- empty_bitmap = new SkBitmap();
+ // The placeholder bitmap is bright red so people notice the problem.
+ empty_bitmap = new SkBitmap();
+ empty_bitmap->setConfig(SkBitmap::kARGB_8888_Config, 32, 32);
+ empty_bitmap->allocPixels();
+ empty_bitmap->eraseARGB(255, 255, 0, 0);
}
return empty_bitmap;
}