summaryrefslogtreecommitdiffstats
path: root/skia
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-28 18:24:21 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-28 18:24:21 +0000
commitc99fcf5a1913cea79dbf53cc5ca3dba8e3ee5d64 (patch)
treeec671064fb18a8e0cf198c514680ea6f86ecc345 /skia
parenta6e70b07a557d6c1765df2560c0104a9033c4015 (diff)
downloadchromium_src-c99fcf5a1913cea79dbf53cc5ca3dba8e3ee5d64.zip
chromium_src-c99fcf5a1913cea79dbf53cc5ca3dba8e3ee5d64.tar.gz
chromium_src-c99fcf5a1913cea79dbf53cc5ca3dba8e3ee5d64.tar.bz2
Add the ability to write comments to PNGCodec::Encode.
I'm going to use this to write layout test checksums to the expected png files. Review URL: http://codereview.chromium.org/6696085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79592 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r--skia/ext/image_operations_unittest.cc5
-rw-r--r--skia/ext/vector_canvas_unittest.cc5
2 files changed, 6 insertions, 4 deletions
diff --git a/skia/ext/image_operations_unittest.cc b/skia/ext/image_operations_unittest.cc
index c1bd3e1..e8c0e9f 100644
--- a/skia/ext/image_operations_unittest.cc
+++ b/skia/ext/image_operations_unittest.cc
@@ -14,6 +14,7 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkRect.h"
#include "ui/gfx/codec/png_codec.h"
+#include "ui/gfx/size.h"
namespace {
@@ -193,9 +194,9 @@ void SaveBitmapToPNG(const SkBitmap& bmp, const char* path) {
gfx::PNGCodec::ColorFormat color_format = gfx::PNGCodec::FORMAT_RGBA;
if (!gfx::PNGCodec::Encode(
reinterpret_cast<const unsigned char*>(bmp.getPixels()),
- color_format, bmp.width(), bmp.height(),
+ color_format, gfx::Size(bmp.width(), bmp.height()),
static_cast<int>(bmp.rowBytes()),
- false, &png)) {
+ false, std::vector<gfx::PNGCodec::Comment>(), &png)) {
FAIL() << "Failed to encode image";
}
diff --git a/skia/ext/vector_canvas_unittest.cc b/skia/ext/vector_canvas_unittest.cc
index 1066c0c..355aa13 100644
--- a/skia/ext/vector_canvas_unittest.cc
+++ b/skia/ext/vector_canvas_unittest.cc
@@ -18,6 +18,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/effects/SkDashPathEffect.h"
#include "ui/gfx/codec/png_codec.h"
+#include "ui/gfx/size.h"
namespace skia {
@@ -126,10 +127,10 @@ class Image {
std::vector<unsigned char> compressed;
ASSERT_TRUE(gfx::PNGCodec::Encode(&*data_.begin(),
gfx::PNGCodec::FORMAT_BGRA,
- width_,
- height_,
+ gfx::Size(width_, height_),
row_length_,
true,
+ std::vector<gfx::PNGCodec::Comment>(),
&compressed));
ASSERT_TRUE(compressed.size());
FILE* f = file_util::OpenFile(filename, "wb");