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

Unified Diff: Source/platform/graphics/GraphicsContextRecorder.cpp

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
Index: Source/platform/graphics/GraphicsContextRecorder.cpp
diff --git a/Source/platform/graphics/GraphicsContextRecorder.cpp b/Source/platform/graphics/GraphicsContextRecorder.cpp
index 02615de435184b81902e47fee8b0ae3087c9a66d..5c6fb51bba50e8cbab2c46d9feb437343148a5e1 100644
--- a/Source/platform/graphics/GraphicsContextRecorder.cpp
+++ b/Source/platform/graphics/GraphicsContextRecorder.cpp
@@ -714,7 +714,8 @@ private:
{
RefPtr<JSONObject> dataItem = JSONObject::create();
Vector<unsigned char> output;
- WebCore::PNGImageEncoder::encode(bitmap, &output);
+ int compressionQuality = PNGImageEncoder::DefaultCompressionQuality;
+ WebCore::PNGImageEncoder::encode(bitmap, compressionQuality, &output);
dataItem->setString("base64", WTF::base64Encode(reinterpret_cast<char*>(output.data()), output.size()));
dataItem->setString("mimeType", "image/png");
return dataItem.release();
« no previous file with comments | « LayoutTests/fast/canvas/canvas-toDataURL-png-compression-expected.txt ('k') | Source/platform/graphics/ImageBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698