Skia
2D Graphics Library
SkBitmap::HeapAllocator Class Reference

Subclass of SkBitmap::Allocator that returns a SkPixelRef that allocates its pixel memory from the heap. More...

#include <SkBitmap.h>

Inheritance diagram for SkBitmap::HeapAllocator:

Public Member Functions

bool allocPixelRef (SkBitmap *bitmap) override
 Allocates the pixel memory for the bitmap, given its dimensions and SkColorType. More...
 

Detailed Description

Subclass of SkBitmap::Allocator that returns a SkPixelRef that allocates its pixel memory from the heap.

This is the default SkBitmap::Allocator invoked by allocPixels().

Member Function Documentation

◆ allocPixelRef()

bool SkBitmap::HeapAllocator::allocPixelRef ( SkBitmap bitmap)
override

Allocates the pixel memory for the bitmap, given its dimensions and SkColorType.

Returns true on success, where success means either setPixels() or setPixelRef() was called.

Parameters
bitmapSkBitmap containing SkImageInfo as input, and SkPixelRef as output
Returns
true if pixels are allocated

example: https://fiddle.skia.org/c/@Bitmap_HeapAllocator_allocPixelRef


The documentation for this class was generated from the following file: