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

Unified Diff: ui/gfx/image/image_util.cc

Issue 2592983002: [devtools] Support different encodings for Page.CaptureScreenshot. (Closed)
Patch Set: Wait for load in CaptureScreenshotTest to fix android bot. Created 3 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
Index: ui/gfx/image/image_util.cc
diff --git a/ui/gfx/image/image_util.cc b/ui/gfx/image/image_util.cc
index d0d79b2f5bae9e3d3564d4a39e3e2aa9c3ef0805..3fca705a8256bf341070991f748e3805b53f1c80 100644
--- a/ui/gfx/image/image_util.cc
+++ b/ui/gfx/image/image_util.cc
@@ -44,8 +44,18 @@ Image ImageFrom1xJPEGEncodedData(const unsigned char* input,
return Image();
}
-bool JPEG1xEncodedDataFromImage(const Image& image, int quality,
+// The MacOS implementation of this function is in image_utils_mac.mm.
+#if !defined(OS_MACOSX)
+bool JPEG1xEncodedDataFromImage(const Image& image,
+ int quality,
std::vector<unsigned char>* dst) {
+ return JPEG1xEncodedDataFromSkiaRepresentation(image, quality, dst);
+}
+#endif // !defined(OS_MACOSX)
+
+bool JPEG1xEncodedDataFromSkiaRepresentation(const Image& image,
+ int quality,
+ std::vector<unsigned char>* dst) {
const gfx::ImageSkiaRep& image_skia_rep =
image.AsImageSkia().GetRepresentation(1.0f);
if (image_skia_rep.scale() != 1.0f)

Powered by Google App Engine
This is Rietveld 408576698