C

DrawingEngine Class

class Qul::PlatformInterface::DrawingEngine

This class provides an abstract interface for blending functions. More...

Header: #include <platforminterface/drawingengine.h>
Since: Qt Quick Ultralite (Platform) 1.5

This class was introduced in Qt Quick Ultralite (Platform) 1.5.

Public Types

enum BlendMode { BlendMode_SourceOver, BlendMode_Source }

Public Functions

virtual void blendAlphaMap(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Point &pos, const Qul::PlatformInterface::Texture &source, const Qul::PlatformInterface::Rect &sourceRect, Qul::PlatformInterface::Rgba32 color, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)
virtual void blendImage(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Point &pos, const Qul::PlatformInterface::Texture &source, const Qul::PlatformInterface::Rect &sourceRect, int sourceOpacity, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)
virtual void blendRect(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Rect &rect, Qul::PlatformInterface::Rgba32 color, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)
virtual void blendRoundedRect(Qul::PlatformInterface::DrawingDevice *drawingDevice, const PlatformInterface::Rect &rect, const PlatformInterface::Rect &clipRect, PlatformInterface::Rgba32 color, int radius, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)
virtual void blendTransformedAlphaMap(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Transform &transform, const Qul::PlatformInterface::RectF &destinationRect, const Qul::PlatformInterface::Texture &source, const Qul::PlatformInterface::RectF &sourceRect, const Qul::PlatformInterface::Rect &clipRect, Qul::PlatformInterface::Rgba32 color, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)
virtual void blendTransformedImage(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Transform &transform, const Qul::PlatformInterface::RectF &destinationRect, const Qul::PlatformInterface::Texture &source, const Qul::PlatformInterface::RectF &sourceRect, const Qul::PlatformInterface::Rect &clipRect, int sourceOpacity, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)
virtual void synchronizeForCpuAccess(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Rect &rect)

Detailed Description

An instance of this class can be used to blend graphic elements together on a drawing device. Depending on the implementation on each platform the operations can be accelerate in case there is a hardware component that available that supports the blending operation of the given graphical elements.

Each platform can implement these blending functions. In case a platform has no special support, a default blend function is called that uses the CPU to perform the task.

Member Type Documentation

enum DrawingEngine::BlendMode

This enum type specifies blending modes.

ConstantValue
Qul::PlatformInterface::DrawingEngine::BlendMode_SourceOver0

The source is placed over the destination.

ConstantValue
Qul::PlatformInterface::DrawingEngine::BlendMode_Source1

The source is blitted over the destination without a blending operation.

This enum was introduced or modified in Qt Quick Ultralite (Platform) 1.5.

Member Function Documentation

[virtual] void DrawingEngine::blendAlphaMap(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Point &pos, const Qul::PlatformInterface::Texture &source, const Qul::PlatformInterface::Rect &sourceRect, Qul::PlatformInterface::Rgba32 color, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)

Blends an alpha map onto a drawing device.

The specified sourceRect of source is multiplied by color and blended to drawingDevice at pos using blendMode. Default blend mode is BlendMode_SourceOver

The default implementation first calls synchronizeForCpuAccess and then blendAlphaMap using the fallbackDrawingEngine.

[virtual] void DrawingEngine::blendImage(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Point &pos, const Qul::PlatformInterface::Texture &source, const Qul::PlatformInterface::Rect &sourceRect, int sourceOpacity, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)

Blends an image onto a drawing device.

The specified sourceRect of source is blended to drawingDevice at pos using blendMode. Default blend mode is BlendMode_SourceOver sourceOpacity specifies the overall opacity of the source with a range from 0 to 256, with 256 being fully opaque.

The default implementation first calls synchronizeForCpuAccess and then blendImage using the fallbackDrawingEngine.

[virtual] void DrawingEngine::blendRect(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Rect &rect, Qul::PlatformInterface::Rgba32 color, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)

Blends a solid color onto a drawing device.

color is used to fill rect on the drawingDevice using blendMode. Default blend mode is BlendMode_SourceOver

The default implementation first calls synchronizeForCpuAccess and then blendRect using the fallbackDrawingEngine.

[virtual] void DrawingEngine::blendRoundedRect(Qul::PlatformInterface::DrawingDevice *drawingDevice, const PlatformInterface::Rect &rect, const PlatformInterface::Rect &clipRect, PlatformInterface::Rgba32 color, int radius, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)

Blends a rectangle with rounded corners onto a drawing device.

color is used to fill rect on the drawingDevice using blendMode. Default blend mode is BlendMode_SourceOver The blending must be clipped against the provided clipRect. radius Defines a corner radius used to draw a rounded rectangle. The same radius is used by all 4 corners; there is currently no way to specify different radii for different corners.

The default implementation first calls synchronizeForCpuAccess and then blendRoundedRect on the fallback drawing engine.

This function was introduced in Qt Quick Ultralite (Platform) 1.6.

See also DrawingDevice::fallbackDrawingEngine().

[virtual] void DrawingEngine::blendTransformedAlphaMap(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Transform &transform, const Qul::PlatformInterface::RectF &destinationRect, const Qul::PlatformInterface::Texture &source, const Qul::PlatformInterface::RectF &sourceRect, const Qul::PlatformInterface::Rect &clipRect, Qul::PlatformInterface::Rgba32 color, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)

Blends a transformed alpha map onto a drawing device.

The specified sourceRect of source is multiplied by color and blended to drawingDevice at destinationRect using blendMode. transform is applied to source before the blending operation. The result should be clipped by clipRect which is in display coordinates.

Default blend mode is BlendMode_SourceOver

The default implementation first calls synchronizeForCpuAccess and then blendTransformedAlphaMap using the fallbackDrawingEngine.

[virtual] void DrawingEngine::blendTransformedImage(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Transform &transform, const Qul::PlatformInterface::RectF &destinationRect, const Qul::PlatformInterface::Texture &source, const Qul::PlatformInterface::RectF &sourceRect, const Qul::PlatformInterface::Rect &clipRect, int sourceOpacity, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)

Blends a transformed image onto a drawing device.

The specified sourceRect of source is blended to drawingDevice at destinationRect using blendMode. transform is applied to source before the blending operation. The result should be clipped by clipRect which is in display coordinates. sourceOpacity specifies the overall opacity of the source with a range from 0 to 256, with 256 being fully opaque.

Default blend mode is BlendMode_SourceOver

The default implementation first calls synchronizeForCpuAccess and then blendTransformedImage using the fallbackDrawingEngine.

[virtual] void DrawingEngine::synchronizeForCpuAccess(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Rect &rect)

Synchronizes the graphics hardware for being accessed by the CPU.

The drawingDevice hardware is synchronized to be accessed by the CPU. This will block the CPU until the graphics hardware has finished all active operations in the given rect.

The default implementation does nothing.

Available under certain Qt licenses.
Find out more.