Tutorial
FM4, S6E2DH/S6E2DF/S6E2D5/S6E2D3 Series, 32-Bit Microcontroller, Graphic Driver User Manual, Doc. No. 002-04387 Rev. *A
58
6.9 Tutorial: Chart (Single render buffer sample)
6.9.1 Summary
This example shows an animated chart using a single buffer render mode. Source code:
04_sample/basic_graphics/chart/.
Figure 25. chart
6.9.1.1
Learning Goals
The following techniques and features are used:
Work with clip rectangle for the STORE surface.
Synchronize display read and blit operations.
Analyze render time.
Analyze command sequencer buffer size.
Color matrix operations for blit operations.
Use alpha multiply with MASK surface.
6.9.1.2
Memory Calculation for VRAM
The target device has a VRAM size of 512 kByte. The panel used for our samples has a size of 480
∗
272 pixels.
The sample should use a high quality render buffer requiring an alpha channel. If we want to use at least 6 bit for all
color and the alpha channel we need 480
∗
272
∗
24
∗
2 / 8 = 765 kByte.
That means double buffering is not possible for such a resolution and color format. To render such targets anyway it
is possible to use a single buffer render mode. In single buffer mode we need only 383 kByte to store the frame
buffer.
The command sequencer size assigned by mmlGdcSysSetInstructionBuffer() must be big enough to store all
operations for one render loop. This is important because the blit operations must be queued until the display
controller passes a defined line in a single buffer environment. The example starts with a Command Sequencer
buffer size measurement for the first frame if MEASURE_CMD_SEQ is defined with the following result:
CmdSeq buffer size: 13.46 of 16.00 kB used