
Add Assign(Span) and Append(span) and drop the pointer+size variants. Drop the templated constructors and operator= because such users can trivially be converted to use the span<const uint8_t> constructor instead. For content::DecodeImage, pass the data to decode as a span instead of as a pointer+size. Bug: 40285824, 351564777 Change-Id: If2ddf008481fce5bfea47fc35234f5bdf29e8046 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6084896 Reviewed-by: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org> Auto-Submit: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/main@{#1394441}
22 lines
637 B
C++
22 lines
637 B
C++
// Copyright 2013 The Chromium Authors
|
|
// 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/web/web_image.h"
|
|
#include "third_party/skia/include/core/SkBitmap.h"
|
|
|
|
using blink::WebData;
|
|
using blink::WebImage;
|
|
|
|
namespace content {
|
|
|
|
SkBitmap DecodeImage(base::span<const unsigned char> data,
|
|
const gfx::Size& desired_image_size) {
|
|
return WebImage::FromData(WebData(data), desired_image_size);
|
|
}
|
|
|
|
} // namespace content
|