The grLfbWriteRegion() convenience function copies a rectangle of pixels from a region of memory into the linear frame buffer as efficiently as possible. It performs the buffer locks and unlocks as needed.
FxBoolgrLfbWriteRegion(GrBuffer_t buffer, FxU32 xStart, FxU32 yStart,
GrLfbSrcFmt_t srcFormat, FxU32 width, FxU32 height, FxI32 strideInBytes,
void *data )
The first argument, buffer, specifies the buffer that the data will be copied into; the choices are GR_BUFFER_FRONTBUFFER, GR_BUFFER_BACKBUFFER, and GR_BUFFER_AUXBUFFER. The next two parameters, xStart and yStart, specify the starting coordinates in the buffer where the data will be written. The y origin is assumed to be in the upper left corner of the screen.
The srcFormat argument describes the format of the data; valid values are shown in Table Accessing the Linear Frame Buffer.5. The width and height parameters give the dimensions, in pixels, of the rectangular region to be written to the LFB and strideInBytes specifies how many bytes are in one row of the array. The final argument, data, points to the pixel data in memory.
Note that strideInBytes can be a negative number. If data points to the pixel closest to the origin, and strideInBytes is the length of a row in the array, then the sign of strideInBytes represents the location of the origin in the image pointed to by data. A negative strideInBytes is used if data points to the lower left corner, as shown in Figure Accessing the Linear Frame Buffer.2.
Table Accessing the Linear Frame Buffer.5 Source data formats for the grLfbWriteRegion() routine.