Skia
2D Graphics Library
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 
23 namespace SkMallocPixelRef {
34  SK_API sk_sp<SkPixelRef> MakeAllocate(const SkImageInfo&, size_t rowBytes);
35 
43  SK_API sk_sp<SkPixelRef> MakeWithData(const SkImageInfo&, size_t rowBytes, sk_sp<SkData> data);
44 } // namespace SkMallocPixelRef
45 #endif
SkData holds an immutable data buffer.
Definition: SkData.h:25
This class is the smart container for pixel memory, and is used with SkBitmap.
Definition: SkPixelRef.h:28
We explicitly use the same allocator for our pixels that SkMask does, so that we can freely assign me...
Definition: SkMallocPixelRef.h:23
SK_API sk_sp< SkPixelRef > MakeAllocate(const SkImageInfo &, size_t rowBytes)
Return a new SkMallocPixelRef, automatically allocating storage for the pixels.
SK_API sk_sp< SkPixelRef > MakeWithData(const SkImageInfo &, size_t rowBytes, sk_sp< SkData > data)
Return a new SkMallocPixelRef that will use the provided SkData and rowBytes as pixel storage.
Describes pixel dimensions and encoding.
Definition: SkImageInfo.h:194