Flutter Engine
The Flutter Engine
third_party
skia
tools
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
11
#include "
include/core/SkImage.h
"
12
#include "
include/core/SkRefCnt.h
"
13
#include "
tools/Resources.h
"
14
15
class
SkBitmap
;
16
class
SkData
;
17
18
namespace
ToolUtils
{
19
bool
DecodeDataToBitmap
(
sk_sp<SkData>
data
,
SkBitmap
*
dst
);
20
21
inline
bool
GetResourceAsBitmap
(
const
char
*
resource
,
SkBitmap
*
dst
) {
22
return
DecodeDataToBitmap
(
GetResourceAsData
(
resource
),
dst
);
23
}
24
25
inline
sk_sp<SkImage>
GetResourceAsImage
(
const
char
*
resource
) {
26
return
SkImages::DeferredFromEncodedData
(
GetResourceAsData
(
resource
));
27
}
28
29
}
// namespace ToolUtils
30
31
#endif
GetResourceAsData
sk_sp< SkData > GetResourceAsData(const char *resource)
Definition:
Resources.cpp:42
Resources.h
SkImage.h
resource
static SkString resource(SkPDFResourceType type, int index)
Definition:
SkPDFResourceDict.cpp:62
SkRefCnt.h
SkBitmap
Definition:
SkBitmap.h:59
SkData
Definition:
SkData.h:25
sk_sp< SkData >
SkImages::DeferredFromEncodedData
SK_API sk_sp< SkImage > DeferredFromEncodedData(sk_sp< SkData > encoded, std::optional< SkAlphaType > alphaType=std::nullopt)
Definition:
SkImageGenerator_FromEncoded.cpp:52
ToolUtils
Definition:
DecodeUtils.cpp:20
ToolUtils::DecodeDataToBitmap
bool DecodeDataToBitmap(sk_sp< SkData > data, SkBitmap *dst)
Definition:
DecodeUtils.cpp:22
ToolUtils::GetResourceAsImage
sk_sp< SkImage > GetResourceAsImage(const char *resource)
Definition:
DecodeUtils.h:25
ToolUtils::GetResourceAsBitmap
bool GetResourceAsBitmap(const char *resource, SkBitmap *dst)
Definition:
DecodeUtils.h:21
gn.cp.dst
dst
Definition:
cp.py:12
data
std::shared_ptr< const fml::Mapping > data
Definition:
texture_gles.cc:63
Generated on Sun Jun 23 2024 21:56:49 for Flutter Engine by
1.9.4