diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2013-11-13 14:17:00 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-15 13:49:20 +0100 |
commit | b83153f1f790614b4807a607990f87557a332bfc (patch) | |
tree | 0c16b78b16092134984cbf02bc636c0c30ef33d4 /lib/delegated_frame_node.cpp | |
parent | b6039e76c2ecfd6b95359d6ac1bc7ecbd6c1d9c5 (diff) |
Delegated renderer: implement cc::DrawQuad::SOLID_COLOR.
I could currently only test this with --enable-overlay-scrollbars.
Background color quads still need some work in Chromium to be able to
to use this kind of quads, see
<http://code.google.com/p/chromium/issues/detail?id=114658>.
Change-Id: I9c9bdb5c72b91827cfdb7e38e44755c6361a05cf
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'lib/delegated_frame_node.cpp')
-rw-r--r-- | lib/delegated_frame_node.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/delegated_frame_node.cpp b/lib/delegated_frame_node.cpp index 0c50776e0..c770f388d 100644 --- a/lib/delegated_frame_node.cpp +++ b/lib/delegated_frame_node.cpp @@ -60,6 +60,7 @@ #include "cc/output/delegated_frame_data.h" #include "cc/quads/draw_quad.h" #include "cc/quads/render_pass_draw_quad.h" +#include "cc/quads/solid_color_draw_quad.h" #include "cc/quads/texture_draw_quad.h" #include "cc/quads/tile_draw_quad.h" #include "cc/quads/yuv_video_draw_quad.h" @@ -68,6 +69,7 @@ #include <QSGTexture> #include <QtQuick/private/qquickclipnode_p.h> #include <QtQuick/private/qquickwindow_p.h> +#include <QtQuick/private/qsgadaptationlayer_p.h> #include <QtQuick/private/qsgcontext_p.h> #include <QtQuick/private/qsgrenderer_p.h> #include <QtQuick/private/qsgtexture_p.h> @@ -412,6 +414,21 @@ void DelegatedFrameNode::commit(cc::DelegatedFrameData *frameData, cc::Transfera textureNode->setTexture(texture.data()); currentLayerChain->appendChildNode(textureNode); break; + } case cc::DrawQuad::SOLID_COLOR: { + const cc::SolidColorDrawQuad *scquad = cc::SolidColorDrawQuad::MaterialCast(quad); + QSGRenderContext *sgrc = QQuickWindowPrivate::get(m_window)->context; + QSGRectangleNode *rectangleNode = sgrc->sceneGraphContext()->createRectangleNode(); + + // Qt only supports MSAA and this flag shouldn't be needed. + // If we ever want to use QSGRectangleNode::setAntialiasing for this we should + // try to see if we can do something similar for tile quads first. + Q_UNUSED(scquad->force_anti_aliasing_off); + + rectangleNode->setRect(toQt(quad->rect)); + rectangleNode->setColor(toQt(scquad->color)); + rectangleNode->update(); + currentLayerChain->appendChildNode(rectangleNode); + break; } case cc::DrawQuad::TILED_CONTENT: { const cc::TileDrawQuad *tquad = cc::TileDrawQuad::MaterialCast(quad); QSharedPointer<MailboxTexture> &texture = m_mailboxTextures[tquad->resource_id] = mailboxTextureCandidates.take(tquad->resource_id); |