diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-03 03:12:20 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-03 03:12:20 +0000 |
commit | 468fec96cd171682405d30b266f71f1766396a07 (patch) | |
tree | e3dc28717fa79c7149303d1c9ec6bb8437edfbcc /chrome/browser/browser_theme_provider.cc | |
parent | db1faced81ea15604ca67135c5597d35269ff84a (diff) | |
download | chromium_src-468fec96cd171682405d30b266f71f1766396a07.zip chromium_src-468fec96cd171682405d30b266f71f1766396a07.tar.gz chromium_src-468fec96cd171682405d30b266f71f1766396a07.tar.bz2 |
Move the JPEG and PNG codecs from base/gfx to app/gfx/codec. Move the classes
into the gfx namespace.
Combine the PNGEncoder and PNGDecoder. There were separate when we had
different executables for the browser and renderer, and linked the encoder only
in one of them (which saved us some space used by libpng). This hasn't been the
case for years, so combining them (again) makes sense.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/243076
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27930 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_theme_provider.cc')
-rw-r--r-- | chrome/browser/browser_theme_provider.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/chrome/browser/browser_theme_provider.cc b/chrome/browser/browser_theme_provider.cc index 96f1d29..4be04498 100644 --- a/chrome/browser/browser_theme_provider.cc +++ b/chrome/browser/browser_theme_provider.cc @@ -4,10 +4,9 @@ #include "chrome/browser/browser_theme_provider.h" +#include "app/gfx/codec/png_codec.h" #include "app/gfx/skbitmap_operations.h" #include "base/file_util.h" -#include "base/gfx/png_decoder.h" -#include "base/gfx/png_encoder.h" #include "base/string_util.h" #include "base/thread.h" #include "base/values.h" @@ -225,7 +224,7 @@ class WriteImagesToDiskTask : public Task { if (found != themed_image_cache_.end()) { SkBitmap* bitmap = found->second; std::vector<unsigned char> image_data; - if (!PNGEncoder::EncodeBGRASkBitmap(*bitmap, false, &image_data)) { + if (!gfx::PNGCodec::EncodeBGRASkBitmap(*bitmap, false, &image_data)) { NOTREACHED() << "Image file could not be encoded."; return; } @@ -650,16 +649,16 @@ SkBitmap* BrowserThemeProvider::LoadThemeBitmap(int id) { int image_width = 0; int image_height = 0; - if (!PNGDecoder::Decode(&raw_data.front(), raw_data.size(), - PNGDecoder::FORMAT_BGRA, &png_data, + if (!gfx::PNGCodec::Decode(&raw_data.front(), raw_data.size(), + gfx::PNGCodec::FORMAT_BGRA, &png_data, &image_width, &image_height)) { NOTREACHED() << "Unable to decode theme image resource " << id; return NULL; } - return PNGDecoder::CreateSkBitmapFromBGRAFormat(png_data, - image_width, - image_height); + return gfx::PNGCodec::CreateSkBitmapFromBGRAFormat(png_data, + image_width, + image_height); } else { // TODO(glen): File no-longer exists, we're out of date. We should // clear the theme (or maybe just the pref that points to this |