From 468fec96cd171682405d30b266f71f1766396a07 Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Sat, 3 Oct 2009 03:12:20 +0000 Subject: 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 --- tools/imagediff/image_diff.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tools/imagediff/image_diff.cc') diff --git a/tools/imagediff/image_diff.cc b/tools/imagediff/image_diff.cc index 044b89c..60c3a7f 100644 --- a/tools/imagediff/image_diff.cc +++ b/tools/imagediff/image_diff.cc @@ -1,4 +1,4 @@ -// 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. @@ -13,11 +13,10 @@ #include #include +#include "app/gfx/codec/png_codec.h" #include "base/basictypes.h" #include "base/command_line.h" #include "base/file_util.h" -#include "base/gfx/png_decoder.h" -#include "base/gfx/png_encoder.h" #include "base/logging.h" #include "base/process_util.h" #include "base/scoped_ptr.h" @@ -78,8 +77,9 @@ class Image { if (fread(source.get(), 1, byte_length, stdin) != byte_length) return false; - if (!PNGDecoder::Decode(source.get(), byte_length, PNGDecoder::FORMAT_RGBA, - &data_, &w_, &h_)) { + if (!gfx::PNGCodec::Decode(source.get(), byte_length, + gfx::PNGCodec::FORMAT_RGBA, + &data_, &w_, &h_)) { Clear(); return false; } @@ -103,8 +103,8 @@ class Image { file_util::CloseFile(f); - if (!PNGDecoder::Decode(&compressed[0], compressed.size(), - PNGDecoder::FORMAT_RGBA, &data_, &w_, &h_)) { + if (!gfx::PNGCodec::Decode(&compressed[0], compressed.size(), + gfx::PNGCodec::FORMAT_RGBA, &data_, &w_, &h_)) { Clear(); return false; } @@ -308,9 +308,9 @@ int DiffImages(const char* file1, const char* file2, const char* out_file) { return kStatusSame; std::vector png_encoding; - PNGEncoder::Encode(diff_image.data(), PNGEncoder::FORMAT_RGBA, - diff_image.w(), diff_image.h(), diff_image.w() * 4, - false, &png_encoding); + gfx::PNGCodec::Encode(diff_image.data(), gfx::PNGCodec::FORMAT_RGBA, + diff_image.w(), diff_image.h(), diff_image.w() * 4, + false, &png_encoding); if (file_util::WriteFile(UTF8ToWide(out_file), reinterpret_cast(&png_encoding.front()), png_encoding.size()) < 0) return kStatusError; -- cgit v1.1