Qt 4.6 supports openvg

Source: Internet
Author: User

Recently we 've been working on writing an openvg Graphics System for Qt 4.6, and now it is all ready to go!

Qt 4.5 added support for pluggable graphics systems, which allow the window drawing surfaces and their associated paint engines to be redirected to a plugin for handling. there are graphics systems for OpenGL 1.x and 2.x, and now for openvg!

The new graphics system supports openvg 1.0 and 1.1, and uses the khronos egl api's to access VG contexts and low-level window surfaces. it directly converts qpaintengine requests into the equivalent openvg requests-the two API's are very similar in functionality, so it was relatively easy to do this. it has been tested using X11/EGL and s60. there is also a demonstration plugin that uses shivavg, which shows how to use a non-egl vg implementation.

What's supported?

  • Single-context VS Multi-context-the default configuration uses a single VG context and multiple window surfaces. this improves performance by sharing VG paths, images, and paint objects. but you can switch it to one VG context per window if your engine requires that behaviour.
  • All QT transformations are supported, both affine and projective. however projective path transformations need to be done client-side, so they won't perform as well as affine transformations. images support both affine and projective path transformations server-side.
  • Pen and brush styles before t conical gradients, which don't have a VG equivalent. Opacity is supported for all drawing operations.
  • All the usual QT primitives: lines, rectangles, points, polygons, ellipses, etc. For Rectangles and other simple objects, path objects are reused to reduce the overhead of recreating them every time.
  • Clipping uses both masking and scissoring, or just scissoring if your engine doesn't support masking. Scissoring will generally be preferred for simple rectangular clipping.
  • Text drawing is very dependent upon the features in your VG engine. for openvg 1.0 it uses the default vector path rendering in QT, which may not give the best result. for openvg 1.1 systems that support vgfont objects, you have a choice of image-based or path-based glyph uploading. image-based glyphs are the default.
  • Pixmaps are represented as vgimage objects (in single-context mode only) and so they can be drawn and transformed very quickly. the pixmap filters from QT 4.5 (Convolution, drop shadow, and colorize) are supported using VG functions.

What's left to do?

  • Testing, testing, testing! Every VG engine has its subtle quirks so help us narrow them down.
  • Rendering into a qpixmap using VG-at present it drops back to the raster paint engine.
  • Text drawing with image glyphs under openvg 1.0.
  • QT/Embedded support-some experimental screen drivers have been written internally but every vendor's EGL is different, which makes QT/Embedded difficult to support for both openvg and OpenGL/es.

Where to get it?

You can get the engine from the public QT repository. to build it, you'll need to edit your mkspecs to specify the include directories and libraries to link against for EGL and openvg. and then configure QT with the "-openvg" option. once it has built, use "app-graphicssystem openvg" to run an app using the graphics system plugin (or "app-graphicssystem shivavg" for the shivavg version ).

 

From: http://labs.trolltech.com/blogs/2009/06/24/openvg-support-in-qt-46/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.