Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
DecodeUtils.h
Go to the documentation of this file.
1/*
2 * Copyright 2023 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef DecodeUtils_DEFINED
9#define DecodeUtils_DEFINED
10
13#include "tools/Resources.h"
14
15class SkBitmap;
16class SkData;
17
18namespace ToolUtils {
20
21inline bool GetResourceAsBitmap(const char* resource, SkBitmap* dst) {
22 return DecodeDataToBitmap(GetResourceAsData(resource), dst);
23}
24
25inline sk_sp<SkImage> GetResourceAsImage(const char* resource) {
27}
28
29} // namespace ToolUtils
30
31#endif
sk_sp< SkData > GetResourceAsData(const char *resource)
Definition Resources.cpp:42
SK_API sk_sp< SkImage > DeferredFromEncodedData(sk_sp< SkData > encoded, std::optional< SkAlphaType > alphaType=std::nullopt)
bool DecodeDataToBitmap(sk_sp< SkData > data, SkBitmap *dst)
sk_sp< SkImage > GetResourceAsImage(const char *resource)
Definition DecodeUtils.h:25
bool GetResourceAsBitmap(const char *resource, SkBitmap *dst)
Definition DecodeUtils.h:21