Flutter Engine
The Flutter Engine
third_party
skia
include
core
SkMallocPixelRef.h
Go to the documentation of this file.
1
/*
2
* Copyright 2008 The Android Open Source Project
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 SkMallocPixelRef_DEFINED
9
#define SkMallocPixelRef_DEFINED
10
11
#include "
include/core/SkRefCnt.h
"
12
#include "
include/core/SkTypes.h
"
13
14
#include <cstddef>
15
16
class
SkData
;
17
class
SkPixelRef
;
18
struct
SkImageInfo
;
19
20
/** We explicitly use the same allocator for our pixels that SkMask does,
21
so that we can freely assign memory allocated by one class to the other.
22
*/
23
namespace
SkMallocPixelRef
{
24
/**
25
* Return a new SkMallocPixelRef, automatically allocating storage for the
26
* pixels. If rowBytes are 0, an optimal value will be chosen automatically.
27
* If rowBytes is > 0, then it will be respected, or NULL will be returned
28
* if rowBytes is invalid for the specified info.
29
*
30
* All pixel bytes are zeroed.
31
*
32
* Returns NULL on failure.
33
*/
34
SK_API
sk_sp<SkPixelRef>
MakeAllocate
(
const
SkImageInfo
&,
size_t
rowBytes);
35
36
/**
37
* Return a new SkMallocPixelRef that will use the provided SkData and
38
* rowBytes as pixel storage. The SkData will be ref()ed and on
39
* destruction of the PixelRef, the SkData will be unref()ed.
40
*
41
* Returns NULL on failure.
42
*/
43
SK_API
sk_sp<SkPixelRef>
MakeWithData
(
const
SkImageInfo
&,
size_t
rowBytes,
sk_sp<SkData>
data
);
44
}
// namespace SkMallocPixelRef
45
#endif
SK_API
#define SK_API
Definition:
SkAPI.h:35
SkRefCnt.h
SkTypes.h
SkData
Definition:
SkData.h:25
SkPixelRef
Definition:
SkPixelRef.h:28
sk_sp< SkPixelRef >
SkMallocPixelRef
Definition:
SkMallocPixelRef.h:23
SkMallocPixelRef::MakeWithData
SK_API sk_sp< SkPixelRef > MakeWithData(const SkImageInfo &, size_t rowBytes, sk_sp< SkData > data)
Definition:
SkMallocPixelRef.cpp:59
SkMallocPixelRef::MakeAllocate
SK_API sk_sp< SkPixelRef > MakeAllocate(const SkImageInfo &, size_t rowBytes)
Definition:
SkMallocPixelRef.cpp:29
SkImageInfo
Definition:
SkImageInfo.h:208
data
std::shared_ptr< const fml::Mapping > data
Definition:
texture_gles.cc:63
Generated on Sun Jun 23 2024 21:56:02 for Flutter Engine by
1.9.4