The namespace offers interfaces to port Qt Quick Ultralite to new platforms. 更多...
Header: | #include <Platform> |
struct | FrameStatistics |
struct | SinglePointTouchEvent |
class | SinglePointTouchEventDispatcher |
class | StackAllocator |
enum | FrameBufferingType { SingleBuffering, FlippedDoubleBuffering, CopyingDoubleBuffering, OtherBuffering } |
PlatformInterface::Screen * | availableScreens (size_t * screenCount ) |
PlatformInterface::DrawingDevice * | beginFrame (const PlatformInterface::LayerEngine::ItemLayer * layer , const PlatformInterface::Rect & rect , int refreshInterval = 1) |
uint64_t | currentTimestamp () |
void | endFrame (const PlatformInterface::LayerEngine::ItemLayer * layer ) |
void | exec () |
void | flushCachesForAsyncRead (const void * address , size_t length ) |
Qul::Platform::FrameBufferingType | frameBufferingType (const PlatformInterface::LayerEngine::ItemLayer * layer ) |
void | initializeDisplay (const PlatformInterface::Screen * screen ) |
void | initializeHardware () |
PlatformInterface::LayerEngine * | layerEngine () |
Qul::Platform::FrameStatistics | presentFrame (const PlatformInterface::Screen * screen , const PlatformInterface::Rect & rect ) |
void | printHeapStats () |
void | printStackStats () |
void | qul_free (void * ptr ) |
void * | qul_malloc (std::size_t size ) |
void * | qul_realloc (void * ptr , std::size_t new_size ) |
double | rand () |
void | scheduleEngineUpdate (uint64_t timestamp ) |
void | waitUntilAsyncReadFinished (const void * begin , const void * end ) |
Provides frame rendering statistics. 更多...
A struct containing information related to a single point touch event. 更多...
A convenience class for handling single point touch from the platform. 更多...
Provides a simple memory allocator for functions that might temporarily require some extra memory for caching. 更多...
Defines the different buffering mechanisms that are supported.
常量 | 值 | 描述 |
---|---|---|
SingleBuffering
|
0
|
There is only single buffer used for rendering. All rendering must happen within timing budget allowed by the display refresh rate. |
FlippedDoubleBuffering
|
1
|
Two buffers are used and both can be displayed. One is used for displaying while the other is used for rendering and then flipped. |
CopyingDoubleBuffering
|
2
|
There is one buffer for rendering and one for displaying. When rendering is finished the content from rendering buffer is copied to the display buffer. |
OtherBuffering
|
3
|
Other platform specific buffering type. |
This enum was introduced or modified in Qt Quick Ultralite (Platform) 1.5.
Returns array of the available screens. If there is no screen available function returns
nullptr
. Number of the items in the array is returned in
screenCount
output pointer.
The screen objects returned provide information about the screen dimensions as well as a swap chain used to draw to and present buffers for a particular display. First item in the returned array is treated as a default, primary screen.
注意: The memory allocated for the return value is owned by the platform. There is no transfer of ownership.
This function was introduced in Qt Quick Ultralite (Platform) 1.5.
Begins Qt Quick Ultralite frame rendering.
Marks the beginning of Qt Quick Ultralite frame rendering for a given layer , and returns a DrawingDevice for it. The rect value specifies the dirty area that will be drawn to. The refreshInterval value specifies when to show the new frame, relative to when the last frame was shown. A refreshInterval of -1 indicates that the new frame should be shown immediately.
This function was introduced in Qt Quick Ultralite (Platform) 1.7.
另请参阅 endFrame (), presentFrame (), Qul::PlatformInterface::DrawingDevice ,和 Qul::PlatformInterface::Rect .
Returns the currently elapsed system time, in milliseconds.
This function was introduced in Qt Quick Ultralite 1.0.
Ends Qt Quick Ultralite frame rendering.
Marks the end of Qt Quick Ultralite frame rendering for the given layer .
This function was introduced in Qt Quick Ultralite (Platform) 1.5.
另请参阅 beginFrame () 和 presentFrame ().
Runs the main exec loop provided by the platform.
The exec loop will run forever, or at least for as long as the application is running, and is responsible for calling Qul::PlatformInterface::updateEngine at appropriate times. When no updates need to performed, it should enter a sleep state if possible.
Here's an example showing how the exec() function might look:
static uint64_t nextUpdate = 0; void scheduleEngineUpdate(uint64_t timestamp) { nextUpdate = timestamp; } ... void exec() { while (true) { const uint64_t timestamp = currentTimestamp(); if (timestamp >= nextUpdate) { // Handle deadline or pending events Qul::PlatformInterface::updateEngine(timestamp); } else { // The core library has no pending actions. // The device may go to a sleep mode. // wait_for_interrupt(nextUpdate - timestamp); } } }
This function was introduced in Qt Quick Ultralite (Platform) 1.0.
另请参阅 Qul::PlatformInterface::updateEngine (uint64_t timestamp).
This function is called to synchronize a given area of memory before an asynchronous read.
For asynchronous transfers, such as blitting and blending using DMA2D (STM) or PXP (NXP), it might be necessary to invalidate some caches (like D-Cache on ARM based CPUs) so that any changes to memory are actually fully committed before the transfer begins.
Use this function to indicate that the memory range specified by address and length might have been modified, and that caches need to be flushed to ensure that asynchronous transfers read the correct up-to-date data.
This function was introduced in Qt Quick Ultralite 1.2.
Returns layer's buffering type.
返回 FrameBufferingType 为给定 layer .
This function was introduced in Qt Quick Ultralite (Platform) 1.5.
另请参阅 FrameBufferingType .
Initializes the platform display.
Initializes the platform display, with the screen geometry provided by the screen parameter. Called some time after initializeHardware .
This function was introduced in Qt Quick Ultralite (Platform) 1.1.
Initializes the platform hardware.
Performs basic hardware initialization, such as interrupts, timers, MPU. Called before initializeDisplay .
This function was introduced in Qt Quick Ultralite (Platform) 1.1.
Returns the layer engine for the platform.
Returns the layer engine responsible for allocating, updating and deallocating hardware layers. If the platform doesn't support multiple layers, nullptr can be returned.
This function was introduced in Qt Quick Ultralite (Platform) 1.7.
Presents layer and frame updates to the screen and returns statistics.
Qt Quick Ultralite core calls
presentFrame
for a given
screen
after all its layer updates have been done using the
Qul::Platform::layerEngine
, and all updated frame contents have been rendered using
beginFrame
and
endFrame
.
rect parameter specifies the bounding rectangle of the areas of the screen that have changed relative to the last frame, assuming no layer positions have changed.
Platforms that support it should update the background color based on Qul::PlatformInterface::Screen::backgroundColor ().
注意: presentFrame might get called without beginFrame or endFrame being called first, if layer properties such as position or opacity have changed, or if the screen's background color has changed.
This function was introduced in Qt Quick Ultralite (Platform) 1.5.
另请参阅 beginFrame (), endFrame (), Qul::Platform::FrameStatistics , Qul::PlatformInterface::Rect ,和 Qul::PlatformInterface::Screen .
Print heap usage statistics to stderr.
This function was introduced in Qt Quick Ultralite (Platform) 1.5.
Print stack usage statistics to stderr.
This function was introduced in Qt Quick Ultralite (Platform) 1.5.
Frees a memory block allocated by qul_malloc .
ptr is the pointer to the memory block to be freed.
This function was introduced in Qt Quick Ultralite (Platform) 1.5.
另请参阅 Qul::Platform::qul_malloc (std::size_t size) and Qul::Platform::qul_realloc (void *ptr, std::size_t new_size).
Allocates memory in the way optimal for the platform.
size is the size of the requested block of memory, in bytes.
All of Qt Quick Ultralite performs dynamic memory allocation through this function.
Memory allocated using this function must be freed using qul_free . Resizing the memory block that was allocated can also be done using qul_realloc .
Might return NULL if there is not sufficient memory to satisfy the request.
This function was introduced in Qt Quick Ultralite (Platform) 1.5.
另请参阅 Qul::Platform::qul_free (void *ptr) and Qul::Platform::qul_realloc (void *ptr, std::size_t new_size).
Attempt to resize a memory block allocated with qul_malloc .
ptr is the pointer the the previously allocated memory block, and new_size is the the size for the memory block, in bytes.
Might return NULL if there is not sufficient memory to satisfy the request.
This function was introduced in Qt Quick Ultralite (Platform) 1.5.
另请参阅 Qul::Platform::qul_malloc (std::size_t size) and Qul::Platform::qul_free (void *ptr).
Return a uniformly random value in the range [0, 1).
This function returns a random value in the range [0, 1), meaning 1 should not be inclusive. It might use a hardware random number generator if available. Otherwise the standard library rand() or a custom software RNG can be used.
This function was introduced in Qt Quick Ultralite 1.1.
Requests the platform implementation to schedule a Qt Quick Ultralite engine update at timestamp .
This function is supposed to be only called from the Qt Quick Ultralite engine during execution of updateEngine(). It requests the platform implementation to schedule an update of the Qt Quick Ultralite engine at the given timestamp. The timestamp is calculated based on the Qt Quick Ultralite engine timers and running animations.
A timestamp lesser than the current timestamp, or even 0, should result in calling updateEngine as soon as possible. A greater timestamp value than the current timestamp means that the platform implementation should call updateEngine at that given time. Until the scheduled time, the device may enter a sleep mode. Qul::PlatformInterface::updateEngine should not be called earlier than required.
For an example usage see the exec () or updateEngine() documentation.
注意: The implementation of this function can get called from an interrupt and it must be safe for running within an interrupt context.
This function was introduced in Qt Quick Ultralite (Platform) 1.3.
另请参阅 Qul::PlatformInterface::updateEngine (uint64_t timestamp) and Qul::Platform::exec ().
Block until no asynchronous transfer is reading from the given memory range.
Some platforms support asynchronous transfers, like DMA2D (STM) or PXP (NXP), that are used for drawing and blending. If the CPU writes to memory that is currently being read from by some asynchronous blending operation, then that could cause unwanted graphical glitches.
Use this function to wait until all asynchronous reads from the memory area specified by begin and end have finished. The range is [ begin , end ), meaning end is not included but serves to indicate the end of the range.
This function was introduced in Qt Quick Ultralite 1.2.