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/history | |
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/history')
-rw-r--r-- | chrome/browser/history/expire_history_backend_unittest.cc | 6 | ||||
-rw-r--r-- | chrome/browser/history/history_backend_unittest.cc | 10 | ||||
-rw-r--r-- | chrome/browser/history/history_unittest.cc | 6 | ||||
-rw-r--r-- | chrome/browser/history/thumbnail_database.cc | 6 | ||||
-rw-r--r-- | chrome/browser/history/thumbnail_database_unittest.cc | 6 | ||||
-rw-r--r-- | chrome/browser/history/top_sites.cc | 6 |
6 files changed, 20 insertions, 20 deletions
diff --git a/chrome/browser/history/expire_history_backend_unittest.cc b/chrome/browser/history/expire_history_backend_unittest.cc index 08cdf38..31eab71 100644 --- a/chrome/browser/history/expire_history_backend_unittest.cc +++ b/chrome/browser/history/expire_history_backend_unittest.cc @@ -1,12 +1,12 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "app/gfx/codec/jpeg_codec.h" #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/file_path.h" #include "base/file_util.h" -#include "base/gfx/jpeg_codec.h" #include "base/path_service.h" #include "base/scoped_ptr.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -205,7 +205,7 @@ void ExpireHistoryTest::AddExampleData(URLID url_ids[3], Time visit_times[4]) { // Thumbnails for each URL. scoped_ptr<SkBitmap> thumbnail( - JPEGCodec::Decode(kGoogleThumbnail, sizeof(kGoogleThumbnail))); + gfx::JPEGCodec::Decode(kGoogleThumbnail, sizeof(kGoogleThumbnail))); ThumbnailScore score(0.25, true, true, Time::Now()); Time time; diff --git a/chrome/browser/history/history_backend_unittest.cc b/chrome/browser/history/history_backend_unittest.cc index 9f14f1d..bb92d19 100644 --- a/chrome/browser/history/history_backend_unittest.cc +++ b/chrome/browser/history/history_backend_unittest.cc @@ -1,10 +1,10 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "app/gfx/codec/jpeg_codec.h" #include "base/file_path.h" #include "base/file_util.h" -#include "base/gfx/jpeg_codec.h" #include "base/path_service.h" #include "base/scoped_ptr.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -231,14 +231,14 @@ TEST_F(HistoryBackendTest, DeleteAll) { // Add thumbnails for each page. ThumbnailScore score(0.25, true, true); scoped_ptr<SkBitmap> google_bitmap( - JPEGCodec::Decode(kGoogleThumbnail, sizeof(kGoogleThumbnail))); + gfx::JPEGCodec::Decode(kGoogleThumbnail, sizeof(kGoogleThumbnail))); Time time; GURL gurl; backend_->thumbnail_db_->SetPageThumbnail(gurl, row1_id, *google_bitmap, score, time); scoped_ptr<SkBitmap> weewar_bitmap( - JPEGCodec::Decode(kWeewarThumbnail, sizeof(kWeewarThumbnail))); + gfx::JPEGCodec::Decode(kWeewarThumbnail, sizeof(kWeewarThumbnail))); backend_->thumbnail_db_->SetPageThumbnail(gurl, row2_id, *weewar_bitmap, score, time); @@ -405,7 +405,7 @@ TEST_F(HistoryBackendTest, GetPageThumbnailAfterRedirects) { // Add a thumbnail for the end of that redirect chain. scoped_ptr<SkBitmap> thumbnail( - JPEGCodec::Decode(kGoogleThumbnail, sizeof(kGoogleThumbnail))); + gfx::JPEGCodec::Decode(kGoogleThumbnail, sizeof(kGoogleThumbnail))); backend_->SetPageThumbnail(GURL(thumbnail_url), *thumbnail, ThumbnailScore(0.25, true, true)); diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc index be84f01..ce6121a 100644 --- a/chrome/browser/history/history_unittest.cc +++ b/chrome/browser/history/history_unittest.cc @@ -20,12 +20,12 @@ #include <time.h> #include <algorithm> +#include "app/gfx/codec/jpeg_codec.h" #include "app/sql/connection.h" #include "app/sql/statement.h" #include "base/basictypes.h" #include "base/file_path.h" #include "base/file_util.h" -#include "base/gfx/jpeg_codec.h" #include "base/message_loop.h" #include "base/path_service.h" #include "base/scoped_vector.h" @@ -668,7 +668,7 @@ TEST_F(HistoryTest, Thumbnails) { ASSERT_TRUE(history->Init(history_dir_, NULL)); scoped_ptr<SkBitmap> thumbnail( - JPEGCodec::Decode(kGoogleThumbnail, sizeof(kGoogleThumbnail))); + gfx::JPEGCodec::Decode(kGoogleThumbnail, sizeof(kGoogleThumbnail))); static const double boringness = 0.25; const GURL url("http://www.google.com/thumbnail_test/"); @@ -687,7 +687,7 @@ TEST_F(HistoryTest, Thumbnails) { // compression and we don't have a similarity measure. EXPECT_TRUE(thumbnail_data_.size()); scoped_ptr<SkBitmap> decoded_thumbnail( - JPEGCodec::Decode(&thumbnail_data_[0], thumbnail_data_.size())); + gfx::JPEGCodec::Decode(&thumbnail_data_[0], thumbnail_data_.size())); EXPECT_TRUE(decoded_thumbnail.get()); // Request a nonexistent thumbnail and make sure we get diff --git a/chrome/browser/history/thumbnail_database.cc b/chrome/browser/history/thumbnail_database.cc index 735440f..ac06464 100644 --- a/chrome/browser/history/thumbnail_database.cc +++ b/chrome/browser/history/thumbnail_database.cc @@ -4,10 +4,10 @@ #include "chrome/browser/history/thumbnail_database.h" +#include "app/gfx/codec/jpeg_codec.h" #include "app/sql/statement.h" #include "app/sql/transaction.h" #include "base/file_util.h" -#include "base/gfx/jpeg_codec.h" #include "base/time.h" #include "base/string_util.h" #include "chrome/browser/history/history_publisher.h" @@ -229,9 +229,9 @@ void ThumbnailDatabase::SetPageThumbnail( // highly detailed images. std::vector<unsigned char> jpeg_data; SkAutoLockPixels thumbnail_lock(thumbnail); - bool encoded = JPEGCodec::Encode( + bool encoded = gfx::JPEGCodec::Encode( reinterpret_cast<unsigned char*>(thumbnail.getAddr32(0, 0)), - JPEGCodec::FORMAT_BGRA, thumbnail.width(), + gfx::JPEGCodec::FORMAT_BGRA, thumbnail.width(), thumbnail.height(), static_cast<int>(thumbnail.rowBytes()), 90, &jpeg_data); diff --git a/chrome/browser/history/thumbnail_database_unittest.cc b/chrome/browser/history/thumbnail_database_unittest.cc index d6a93ff..83d67cf 100644 --- a/chrome/browser/history/thumbnail_database_unittest.cc +++ b/chrome/browser/history/thumbnail_database_unittest.cc @@ -1,11 +1,11 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "app/gfx/codec/jpeg_codec.h" #include "base/basictypes.h" #include "base/file_path.h" #include "base/file_util.h" -#include "base/gfx/jpeg_codec.h" #include "base/path_service.h" #include "chrome/browser/history/thumbnail_database.h" #include "chrome/common/chrome_paths.h" @@ -55,7 +55,7 @@ class ThumbnailDatabaseTest : public testing::Test { file_util::Delete(file_name_, false); google_bitmap_.reset( - JPEGCodec::Decode(kGoogleThumbnail, sizeof(kGoogleThumbnail))); + gfx::JPEGCodec::Decode(kGoogleThumbnail, sizeof(kGoogleThumbnail))); } virtual void TearDown() { diff --git a/chrome/browser/history/top_sites.cc b/chrome/browser/history/top_sites.cc index 48a1751..1206843 100644 --- a/chrome/browser/history/top_sites.cc +++ b/chrome/browser/history/top_sites.cc @@ -4,7 +4,7 @@ #include "chrome/browser/history/top_sites.h" -#include "base/gfx/jpeg_codec.h" +#include "app/gfx/codec/jpeg_codec.h" #include "base/logging.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -45,9 +45,9 @@ bool TopSites::SetPageThumbnail(const GURL& url, image.thumbnail = new RefCountedBytes; SkAutoLockPixels thumbnail_lock(thumbnail); - bool encoded = JPEGCodec::Encode( + bool encoded = gfx::JPEGCodec::Encode( reinterpret_cast<unsigned char*>(thumbnail.getAddr32(0, 0)), - JPEGCodec::FORMAT_BGRA, thumbnail.width(), + gfx::JPEGCodec::FORMAT_BGRA, thumbnail.width(), thumbnail.height(), static_cast<int>(thumbnail.rowBytes()), 90, &image.thumbnail->data); |