summaryrefslogtreecommitdiffstats
path: root/printing/image.cc
diff options
context:
space:
mode:
Diffstat (limited to 'printing/image.cc')
-rw-r--r--printing/image.cc23
1 files changed, 11 insertions, 12 deletions
diff --git a/printing/image.cc b/printing/image.cc
index 667adae..b9c86dd 100644
--- a/printing/image.cc
+++ b/printing/image.cc
@@ -1,12 +1,11 @@
-// Copyright (c) 2006-2009 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 "printing/image.h"
+#include "app/gfx/codec/png_codec.h"
#include "base/file_util.h"
-#include "base/gfx/png_decoder.h"
-#include "base/gfx/png_encoder.h"
#include "base/gfx/rect.h"
#include "base/md5.h"
#include "base/string_util.h"
@@ -101,13 +100,13 @@ std::string Image::checksum() const {
bool Image::SaveToPng(const std::wstring& filename) const {
DCHECK(!data_.empty());
std::vector<unsigned char> compressed;
- bool success = PNGEncoder::Encode(&*data_.begin(),
- PNGEncoder::FORMAT_BGRA,
- size_.width(),
- size_.height(),
- row_length_,
- true,
- &compressed);
+ bool success = gfx::PNGCodec::Encode(&*data_.begin(),
+ gfx::PNGCodec::FORMAT_BGRA,
+ size_.width(),
+ size_.height(),
+ row_length_,
+ true,
+ &compressed);
DCHECK(success && compressed.size());
if (success) {
int write_bytes = file_util::WriteFile(
@@ -179,9 +178,9 @@ double Image::PercentageDifferent(const Image& rhs) const {
bool Image::LoadPng(const std::string& compressed) {
int w;
int h;
- bool success = PNGDecoder::Decode(
+ bool success = gfx::PNGCodec::Decode(
reinterpret_cast<const unsigned char*>(compressed.c_str()),
- compressed.size(), PNGDecoder::FORMAT_BGRA, &data_, &w, &h);
+ compressed.size(), gfx::PNGCodec::FORMAT_BGRA, &data_, &w, &h);
size_.SetSize(w, h);
row_length_ = size_.width() * sizeof(uint32);
return success;