summaryrefslogtreecommitdiffstats
path: root/tools/imagediff/image_diff.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-03 03:12:20 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-03 03:12:20 +0000
commit468fec96cd171682405d30b266f71f1766396a07 (patch)
treee3dc28717fa79c7149303d1c9ec6bb8437edfbcc /tools/imagediff/image_diff.cc
parentdb1faced81ea15604ca67135c5597d35269ff84a (diff)
downloadchromium_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 'tools/imagediff/image_diff.cc')
-rw-r--r--tools/imagediff/image_diff.cc20
1 files changed, 10 insertions, 10 deletions
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 <string>
#include <iostream>
+#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<unsigned char> 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<char*>(&png_encoding.front()), png_encoding.size()) < 0)
return kStatusError;