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

Unified Diff: Source/platform/image-encoders/skia/PNGImageEncoder.h

Issue 290893002: [wip] Add canvas.toDataURL("image/png") compression control Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update after https://src.chromium.org/viewvc/blink?view=rev&revision=175387 Created 6 years, 6 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 | « Source/platform/graphics/ImageBuffer.cpp ('k') | Source/platform/image-encoders/skia/PNGImageEncoder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/image-encoders/skia/PNGImageEncoder.h
diff --git a/Source/platform/image-encoders/skia/PNGImageEncoder.h b/Source/platform/image-encoders/skia/PNGImageEncoder.h
index e8fc52f121c399ce101461d7c6ea8d2deea2d098..5e4732c8b304b2a090b121680454a1976241cfbf 100644
--- a/Source/platform/image-encoders/skia/PNGImageEncoder.h
+++ b/Source/platform/image-encoders/skia/PNGImageEncoder.h
@@ -39,11 +39,14 @@ namespace WebCore {
struct ImageDataBuffer;
-// Interface for encoding PNG data. This is a wrapper around libpng.
class PNGImageEncoder {
public:
- static bool encode(const SkBitmap&, Vector<unsigned char>* output);
- static bool encode(const ImageDataBuffer&, Vector<unsigned char>* output);
+ // Encode the input data with a compression quality in [0-100].
+ static bool encode(const SkBitmap&, int quality, Vector<unsigned char>* output);
+ static bool encode(const ImageDataBuffer&, int quality, Vector<unsigned char>* output);
+
+ // For callers: provide a reasonable compression quality default.
+ enum Quality { DefaultCompressionQuality = 30 };
};
} // namespace WebCore
« no previous file with comments | « Source/platform/graphics/ImageBuffer.cpp ('k') | Source/platform/image-encoders/skia/PNGImageEncoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698