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

Unified Diff: tools/imagediff/image_diff.cc

Issue 243076: Move the JPEG and PNG codecs from base/gfx to app/gfx/codec. Move the classes... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months 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
Index: tools/imagediff/image_diff.cc
===================================================================
--- tools/imagediff/image_diff.cc (revision 27832)
+++ tools/imagediff/image_diff.cc (working copy)
@@ -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 @@
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 @@
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 @@
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;

Powered by Google App Engine
This is Rietveld 408576698