From 3ebe2c3112d2c11141be41ca8b3f8e68f613022d Mon Sep 17 00:00:00 2001 From: "jnd@chromium.org" Date: Wed, 25 Apr 2012 04:46:24 +0000 Subject: Add EncodeRGBAPNGWithChecksum method. Adding this method is to dump image for DRT on Chromium Android port. See https://bugs.webkit.org/show_bug.cgi?id=84682 for details. NOTE. Skia pixel layout definition is in /third_party/skia/include/core/SkPostConfig.h for Chromium Android platform. /skia/config/SkUserConfig.h for other Chromium platforms. BUG=None. TEST=should not affect any tests. Review URL: http://codereview.chromium.org/10202008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133861 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/support/webkit_support_gfx.cc | 14 ++++++++++++++ webkit/support/webkit_support_gfx.h | 10 +++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'webkit/support') diff --git a/webkit/support/webkit_support_gfx.cc b/webkit/support/webkit_support_gfx.cc index bc342e9..1471e29 100644 --- a/webkit/support/webkit_support_gfx.cc +++ b/webkit/support/webkit_support_gfx.cc @@ -676,4 +676,18 @@ bool EncodeBGRAPNGWithChecksum(const unsigned char* input, comments, output); } +bool EncodeRGBAPNGWithChecksum(const unsigned char* input, + int width, + int height, + int row_byte_width, + bool discard_transparency, + const std::string& checksum, + std::vector* output) { + std::vector comments; + comments.push_back(Comment("checksum", checksum)); + return Encode(input, FORMAT_RGBA, + width, height, row_byte_width, discard_transparency, + comments, output); +} + } // namespace webkit_support diff --git a/webkit/support/webkit_support_gfx.h b/webkit/support/webkit_support_gfx.h index 4823022..19d011f 100644 --- a/webkit/support/webkit_support_gfx.h +++ b/webkit/support/webkit_support_gfx.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -38,6 +38,14 @@ bool EncodeBGRAPNGWithChecksum(const unsigned char* input, const std::string& checksum, std::vector* output); +bool EncodeRGBAPNGWithChecksum(const unsigned char* input, + int width, + int height, + int row_byte_width, + bool discard_transparency, + const std::string& checksum, + std::vector* output); + } // namespace webkit_support #endif // WEBKIT_SUPPORT_WEBKIT_SUPPORT_GFX_H_ -- cgit v1.1