summaryrefslogtreecommitdiff
path: root/chromium/content/child/image_decoder_utils.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-03-11 11:32:04 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-03-18 13:40:17 +0000
commit31ccca0778db85c159634478b4ec7997f6704860 (patch)
tree3d33fc3afd9d5ec95541e1bbe074a9cf8da12a0e /chromium/content/child/image_decoder_utils.cc
parent248b70b82a40964d5594eb04feca0fa36716185d (diff)
downloadqtwebengine-chromium-31ccca0778db85c159634478b4ec7997f6704860.tar.gz
BASELINE: Update Chromium to 80.0.3987.136
Change-Id: I98e1649aafae85ba3a83e67af00bb27ef301db7b Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'chromium/content/child/image_decoder_utils.cc')
-rw-r--r--chromium/content/child/image_decoder_utils.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/chromium/content/child/image_decoder_utils.cc b/chromium/content/child/image_decoder_utils.cc
new file mode 100644
index 00000000000..a9058b5c90c
--- /dev/null
+++ b/chromium/content/child/image_decoder_utils.cc
@@ -0,0 +1,24 @@
+// Copyright (c) 2013 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.
+
+#include "content/public/child/image_decoder_utils.h"
+
+#include "third_party/blink/public/platform/web_data.h"
+#include "third_party/blink/public/platform/web_size.h"
+#include "third_party/blink/public/web/web_image.h"
+#include "third_party/skia/include/core/SkBitmap.h"
+
+using blink::WebData;
+using blink::WebImage;
+
+namespace content {
+
+SkBitmap DecodeImage(const unsigned char* data,
+ const gfx::Size& desired_image_size,
+ size_t size) {
+ WebData buffer(reinterpret_cast<const char*>(data), size);
+ return WebImage::FromData(buffer, desired_image_size);
+}
+
+} // namespace content