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

Unified Diff: base/gfx/png_encoder.h

Issue 18347: Add a PNGEncoder helper function that takes an SkBitmap, (Closed)
Patch Set: Test2 Created 11 years, 11 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
« no previous file with comments | « no previous file | base/gfx/png_encoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/gfx/png_encoder.h
diff --git a/base/gfx/png_encoder.h b/base/gfx/png_encoder.h
old mode 100644
new mode 100755
index e346bd0ec332f6fd780e69087954b1012a59d50b..7d284bee1b8e64bc11bf90f8824f4c83972cf042
--- a/base/gfx/png_encoder.h
+++ b/base/gfx/png_encoder.h
@@ -9,6 +9,8 @@
#include "base/basictypes.h"
+class SkBitmap;
+
// Interface for encoding PNG data. This is a wrapper around libpng,
// which has an inconvenient interface for callers. This is currently designed
// for use in tests only (where we control the files), so the handling isn't as
@@ -51,6 +53,14 @@ class PNGEncoder {
bool discard_transparency,
std::vector<unsigned char>* output);
+ // Call PNGEncoder::Encode on the supplied SkBitmap |input|, which is assumed
+ // to be BGRA, 32 bits per pixel. The params |discard_transparency| and
+ // |output| are passed directly to Encode; refer to Encode for more
+ // information. During the call, an SkAutoLockPixels lock is held on |input|.
+ static bool EncodeBGRASkBitmap(const SkBitmap& input,
+ bool discard_transparency,
+ std::vector<unsigned char>* output);
+
private:
DISALLOW_EVIL_CONSTRUCTORS(PNGEncoder);
};
« no previous file with comments | « no previous file | base/gfx/png_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698