Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkPixelRefPriv.h
Go to the documentation of this file.
1// Copyright 2019 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3
4#ifndef SkPixelRefPriv_DEFINED
5#define SkPixelRefPriv_DEFINED
6
8
9#include <cstddef>
10
11class SkPixelRef;
12
13/**
14 * Return a new SkMallocPixelRef with the provided pixel storage and
15 * rowBytes. On destruction, ReleaseProc will be called.
16 *
17 * If ReleaseProc is NULL, the pixels will never be released. This
18 * can be useful if the pixels were stack allocated. However, such an
19 * SkMallocPixelRef must not live beyond its pixels (e.g. by copying
20 * an SkBitmap pointing to it, or drawing to an SkPicture).
21 *
22 * Returns NULL on failure.
23 */
24sk_sp<SkPixelRef> SkMakePixelRefWithProc(int w, int h, size_t rowBytes, void* addr,
25 void (*releaseProc)(void* addr, void* ctx), void* ctx);
26
27#endif // SkPixelRefPriv_DEFINED
static void releaseProc(const void *ptr, void *context)
sk_sp< SkPixelRef > SkMakePixelRefWithProc(int w, int h, size_t rowBytes, void *addr, void(*releaseProc)(void *addr, void *ctx), void *ctx)
size_t rowBytes() const
Definition SkPixelRef.h:37
SkScalar w
SkScalar h