diff options
author | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-08-01 12:41:59 +0200 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-08-01 14:10:24 +0200 |
commit | 2b3493c1b216d1d2ce1cbac974db1a9ee449e01f (patch) | |
tree | ba70524cd2d04e00fbaa250018d079f42bc87124 /src/quick/items/context2d/qquickcontext2dtexture_p.h | |
parent | 78923902089d0a70c096e5f47f42e24fbcd4fa56 (diff) |
Support Canvas.antialiasing without multisample support.
FBO based rendering relies on framebuffer multisampling to do
antialiasing, which is often not available on OpenGL ES and even on
some desktop chips. As a high-level API, it is quite bad that Canvas
users (on embedded in particular) have to choose between quality
(Image) or performance (FBO).
This change implements super sampling, rendering the content
at twice the size and then scaling it down.
[ChangeLog][QtQuick][Canvas] Implement antialiasing on
FramebufferObject based render targets through super-sampling (SSAA)
when framebuffer multisampling is not available.
Change-Id: I373f3a645342dac157506b746c1e39b0f3f3f9f2
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/quick/items/context2d/qquickcontext2dtexture_p.h')
-rw-r--r-- | src/quick/items/context2d/qquickcontext2dtexture_p.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quick/items/context2d/qquickcontext2dtexture_p.h b/src/quick/items/context2d/qquickcontext2dtexture_p.h index 186863c1aa..7c48453857 100644 --- a/src/quick/items/context2d/qquickcontext2dtexture_p.h +++ b/src/quick/items/context2d/qquickcontext2dtexture_p.h @@ -124,6 +124,8 @@ public Q_SLOTS: virtual void grabImage(const QRectF& region = QRectF()) = 0; protected: + virtual QVector2D scaleFactor() const { return QVector2D(1, 1); } + void paintWithoutTiles(QQuickContext2DCommandBuffer *ccb); virtual QPaintDevice* beginPainting() {m_painting = true; return 0; } virtual void endPainting() {m_painting = false;} @@ -173,6 +175,9 @@ public: QSGTexture *textureForNextFrame(QSGTexture *); +protected: + QVector2D scaleFactor() const Q_DECL_OVERRIDE; + public Q_SLOTS: virtual void grabImage(const QRectF& region = QRectF()); |