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

Unified Diff: ui/base/resource/resource_bundle.cc

Issue 8983005: Made wallpaper smaller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed back resource_bundle.cc Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/resources/aura/wallpaper.jpg » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/resource/resource_bundle.cc
diff --git a/ui/base/resource/resource_bundle.cc b/ui/base/resource/resource_bundle.cc
index 66b3cf51000169b01271ece565941218b8a47bdf..1b3e293687b57c06dcbfb9c9a007d2cbd3977892 100644
--- a/ui/base/resource/resource_bundle.cc
+++ b/ui/base/resource/resource_bundle.cc
@@ -19,7 +19,6 @@
#include "ui/base/resource/data_pack.h"
#include "ui/base/ui_base_paths.h"
#include "ui/base/ui_base_switches.h"
-#include "ui/gfx/codec/jpeg_codec.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/font.h"
#include "ui/gfx/image/image.h"
@@ -370,17 +369,12 @@ SkBitmap* ResourceBundle::LoadBitmap(DataHandle data_handle, int resource_id) {
return NULL;
SkBitmap bitmap;
- if (gfx::PNGCodec::Decode(memory->front(), memory->size(), &bitmap))
- return new SkBitmap(bitmap);
-
- // 99% of our assets are PNGs, however fallback to JPEG.
- SkBitmap* allocated_bitmap =
- gfx::JPEGCodec::Decode(memory->front(), memory->size());
- if (allocated_bitmap)
- return allocated_bitmap;
+ if (!gfx::PNGCodec::Decode(memory->front(), memory->size(), &bitmap)) {
+ NOTREACHED() << "Unable to decode theme image resource " << resource_id;
+ return NULL;
+ }
- NOTREACHED() << "Unable to decode theme image resource " << resource_id;
- return NULL;
+ return new SkBitmap(bitmap);
}
gfx::Image* ResourceBundle::GetEmptyImage() {
« no previous file with comments | « no previous file | ui/resources/aura/wallpaper.jpg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698