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

Unified Diff: printing/image.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: printing/image.cc
===================================================================
--- printing/image.cc (revision 27832)
+++ printing/image.cc (working copy)
@@ -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 @@
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 @@
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;

Powered by Google App Engine
This is Rietveld 408576698