PebbleOS v4.47.0-327-g7753e801d
Loading...
Searching...
No Matches
gpu.h File Reference
#include <stdint.h>
#include <pbl/device.h>
#include <pbl/kernel/mutex.h>
#include <pbl/util/bits.h>

Data Structures

struct  pbl_gpu_caps
 What a GPU can do. More...
 
struct  pbl_gpu_buffer
 A pixel buffer. More...
 
struct  pbl_gpu_rect
 A rectangle of a buffer. More...
 
struct  pbl_gpu_transform
 Rotation and scaling of a blit around a pivot, which stays where it is. More...
 
struct  pbl_gpu_blit
 A blit: a source drawn over what the target holds. More...
 
struct  pbl_gpu_ops
 GPU driver operations. More...
 
struct  pbl_gpu
 A GPU. More...
 

Macros

#define PBL_GPU_ALPHA_OPAQUE   255U
 Opaque alpha.
 
#define PBL_GPU_SCALE_NONE   256U
 Scale of 1:1.
 
#define PBL_GPU_STATE_DEFINE(sym)
 Define the class state of GPU sym, for the PBL_*_DEFINE() macro of a driver.
 
#define PBL_GPU_INIT(sym, _name, _ops, _deps, ...)
 Initializer for the struct pbl_gpu of GPU sym.
 

Enumerations

enum  pbl_gpu_format : uint8_t {
  PBL_GPU_FORMAT_RGB565 , PBL_GPU_FORMAT_RGB888 , PBL_GPU_FORMAT_ARGB8888 , PBL_GPU_FORMAT_A8 ,
  PBL_GPU_FORMAT_COUNT
}
 Pixel formats. More...
 
enum  : uint32_t { PBL_GPU_CAP_ROTATE = PBL_BIT(0) , PBL_GPU_CAP_SCALE = PBL_BIT(1) }
 Capability flags. More...
 

Functions

int pbl_gpu_init (const struct pbl_device *dev)
 Device init of every GPU: calls the driver's init.
 
static const struct pbl_gpu_caps * pbl_gpu_get_caps (const struct pbl_gpu *gpu)
 Get what a GPU can do.
 
int pbl_gpu_fill (const struct pbl_gpu *gpu, const struct pbl_gpu_buffer *dst, const struct pbl_gpu_rect *rect, uint32_t argb)
 Fill a rectangle with a color.
 
int pbl_gpu_blit (const struct pbl_gpu *gpu, const struct pbl_gpu_buffer *dst, const struct pbl_gpu_rect *clip, const struct pbl_gpu_blit *blit)
 Draw a buffer over another.
 

Variables

const struct pbl_device_class pbl_gpu_class
 Class of the GPUs.
 
const struct pbl_gpu *const GPU
 The GPU, defined by the board.