| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Allows specifying a subsection of the defined path to be displayed.
This mirrors the recently added trimmed() method of QPainterPath.
[ChangeLog][QtQuick][Shapes] Add path trimming functionality
Change-Id: I76371832df07cbab9d81a557b25a6fd53150630e
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Removing paths other than the last could put the the renderers out of
sync, since the path items would change their place in the list. Fix
by ensuring that all items added to the list are marked as dirty. This
works since removals are implemented as list clearing followed by
adding back the unremoved items.
In addition, the curve renderer did not remove the scene graph nodes
when the path list shrinks. Same for the geometry renderer when the
list shrinks to empty. So removed paths would still be visible. Fix by
implementing handling of these cases.
Fixes: QTBUG-133230
Fixes: QTBUG-133231
Pick-to: 6.9 6.8
Change-Id: Ie871e480b99c6b22be9efbceb1e3a4f828f868e7
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A stroke of zero width should not be visible: that seems to be the
intuitively expected behavior, and corresponds to what SVG
does. However, in Qt Quick shapes, only the curve renderer backend
behaved like that. The geometry and software renderers would behave
differently, and different to each other. This commit standardizes on
the SVG behavior.
Fixes: QTBUG-126819
Pick-to: 6.8
Change-Id: I63410a732066facfad0a5f6e0565e2e80becb397
Reviewed-by: Matthias Rauter <[email protected]>
Reviewed-by: Hatem ElKharashy <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
CurveRenderer can render a QPainterPath directly, while its sister
classes require a QQuickPainterPath. This patch adds the same API to the
generic shape renderer and the software renderer.
Pick-to: 6.8
Change-Id: Ib0b4a6739d21f7d27c38df2d93f2394be23eced8
Reviewed-by: Paul Olav Tvete <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
This introduces a "fillItem" property to ShapePath. Similar to
gradient, this enables filling a shape with any texture provider
item, such as an image, a ShaderEffectSource or a layer-enabled
item.
Fixes: QTBUG-104121
Change-Id: I8748a90c825e8eb4655a4ac90648c6ae74420527
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
| |
This adds functionality corresponding to QBrush transform to QuickShapes.
Change-Id: I2b5903f8c228adec65a6f5be64e3816143879302
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
|
|
|
|
|
|
|
|
|
| |
This will be used in RenderMode3D only in practice, where Qt Quick 3D
is going to pass in multiple matrices to the QSGRenderer.
Task-number: QTBUG-114871
Change-Id: Icae7f05958729d9e51948e1f38621ec4a541192d
Reviewed-by: Andy Nichols <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
This moves the internals of the curve renderer out from
Qt Quick Shapes and into a more centralized location
in Qt Quick, so that we can use the same code to create
a new text backend for rendering large scale text without
artifacts.
Change-Id: I3f7e6f7961c1bbe230fcb531c0ca028e038c1afd
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Besides following the header naming changes, make the obvious API
changes that are based on data that is already there but was hidden
previously due to not wanting anything QRhi to shine through in the
public API.
This kind of hiding is no longer needed, even if qrhi.h and similar
still cannot be included from a public header. Forward declarations
are now perfectly fine however.
Task-number: QTBUG-113331
Change-Id: I9a114082cf9218edc487df50956f5793d6b8bdb4
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The handling of the stroke color lacks the extra checks that are
performed when setting the fill color. Switching from "transparent"
to another color involves setting not just the color-dirty flag but
also the geometry-dirty since alpha == 0 may skip operations such as
triangulating, meaning the work has to be performed later when once
again switching to an alpha > 0 color.
Change-Id: Ibd6d762cfcb07ca8b9c852553c979bcb4ee9fa21
Fixes: QTBUG-109882
Pick-to: 6.5 6.4 6.2 5.15
Reviewed-by: Christian Strømme <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For many typical uses in Qt Quick the hardcoded TRI_SCALE = 1 was
just fine. However, this is not quite sufficient for Qt Location's
purposes since the triangulator in QtGui may run out of precision
when zooming in a map and having to deal with large coordinates.
To overcome this one would pass in a transform with a < 1 scale
to the triangulator and then apply the same scaling in reverse
to the generated vertex positions (e.g. this is what the OpenGL
paint engine does). But to allow doing this, there needs to be
an internal way at least, so that one can send the desired scale
down to the default Shape rendering backend.
Pick-to: 6.5
Change-Id: I4e7f72b79d317ebc31e9d661f4a93723854e3504
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a semantic patch using ClangTidyTransformator to convert
sequences of Q_UNREACHABLE() + return into Q_UNREACHABLE_RETURN(),
newly added to qtbase.
const std::string unr = "unr", val = "val", ret = "ret";
auto makeUnreachableReturn = cat("Q_UNREACHABLE_RETURN(",
ifBound(val, cat(node(val)), cat("")),
")");
auto ignoringSwitchCases = [](auto stmt) {
return anyOf(stmt, switchCase(subStmt(stmt)));
};
makeRule(stmt(ignoringSwitchCases(stmt(isExpandedFromMacro("Q_UNREACHABLE")).bind(unr)),
nextStmt(returnStmt(optionally(hasReturnValue(expr().bind(val)))).bind(ret))),
{changeTo(node(unr), cat(makeUnreachableReturn,
";")), // TODO: why is the ; lost w/o this?
changeTo(node(ret), cat(""))},
cat("use ", makeUnreachableReturn));
a.k.a qt-use-unreachable-return.
subStmt() and nextStmt() are non-standard matchers.
There was one false positive, suppressed it with NOLINTNEXTLINE.
It's not really a false positiive, it's just that Clang sees the world
in one way and if conditonal compilation (#if) differs for other
compilers, Clang doesn't know better. This is an artifact of matching
two consecutive statements.
Change-Id: I3855b2dc8523db1ea860f72ad9818738162495c6
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Fabian Kosmale <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to
handle typedefs and accesses through pointers, too:
const std::string o = "object";
auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); };
auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) {
auto exprOfDeclaredType = [&](auto decl) {
return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o);
};
return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))));
};
auto renameMethod = [&] (ArrayRef<StringRef> classes,
StringRef from, StringRef to) {
return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)),
callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))),
changeTo(cat(access(o, cat(to)), "()")),
cat("use '", to, "' instead of '", from, "'"));
};
renameMethod(<classes>, "count", "size");
renameMethod(<classes>, "length", "size");
except that on() was replaced with a matcher that doesn't ignoreParens().
a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'.
Change-Id: I58e1b41b91c34d2e860dbb5847b3752edbfc6fc9
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Ulf Hermann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.
Task-number: QTBUG-99313
Change-Id: I601bf70f020f511019ed28731ba53b14b765dbf0
Reviewed-by: Shawn Rutledge <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8:
auto QtContainerClass = anyOf(
expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o),
expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o));
makeRule(cxxMemberCallExpr(on(QtContainerClass),
callee(cxxMethodDecl(hasAnyName({"count", "length"),
parameterCountIs(0))))),
changeTo(cat(access(o, cat("size"), "()"))),
cat("use 'size()' instead of 'count()/length()'"))
a.k.a qt-port-to-std-compatible-api with config Scope: 'Container',
with the extended set of container classes recognized.
Change-Id: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7
Reviewed-by: Fabian Kosmale <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
Works anyway because the data layout (a single m_node member) is the same
for all the materials, but let's correct the casts.
Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-106824
Change-Id: I84038b04ca03339bdefc61d5780b35309fcf6670
Reviewed-by: Andy Nichols <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.
Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
Including moc files directly into their classes' TU tends to improve
codegen and enables extended compiler warnings, e.g. about unused
private functions or fields.
Pick-to: 6.3 6.2 5.15
Task-number: QTBUG-102948
Change-Id: Ifd2eff233a07bf8e5b42f46b8658caa56bf0e58c
Reviewed-by: Mårten Nordheim <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a color is not the rgb format, when QColor::red() QColor::blue()
QColor::green() is used continuously to obtain the values of different
channels, three times color conversions will occur. Therefore, use
QColor::toRgb() before that to ensure that only one conversion is
performed at most. Not only rgb, the conversion of other formats is the
same.
Change-Id: Ia969e1ca6f1524ad5d7e8dec915bcbc407875c66
Reviewed-by: Shawn Rutledge <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
An alpha of 0 removes the scenegraph node for the fill. If the alpha
changes to non-zero afterwards, the geometry needs to be regenerated.
Pick-to: 6.0 5.15
Fixes: QTBUG-85103
Change-Id: I180b9eb78bd98b99bc87c4d960108b95eb6ae723
Reviewed-by: Andy Nichols <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Shapes has an unusual setup where changing properties (or properties
of the Path objects) does not lead to calling update() on the Shape
item. That's why it was done in updatePolish() but that can be made
less heavy by only doing it when the shape found that something got
changed.
Task-number: QTBUG-86089
Change-Id: I74f708a960a29f26eb003ac160d2b1258b9ae50f
Reviewed-by: Andy Nichols <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
Accelerated graphics is now possible without OpenGL support. With
this change, a Qt build with -no-opengl can still run Qt Quick with
a Vulkan, Metal, or Direct3D backend.
Fixes: QTBUG-84027
Change-Id: Ib63c733d28cfdf7de16b138df136fa7628e1747b
Reviewed-by: Laszlo Agocs <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For perspective transforms, we need to find the sample
range in the glyph cache per pixel. We can do this by
getting the gradient of the distance field at the
specific pixel.
This will ensure proper antialiasing with any
projection, but has the limitation that when glyph contours
become thinner than a pixel, they may disappear or become
too emphasized, because the hardware-gradient - based on
neighbouring fragments - is not reliable at that scale.
So we should only default to this when we detect that the
text is child of a 3D scene.
To make this smooth, we need to know the mode of the renderer
when creating the shader. So QSGMaterial::createShader()
now takes a render mode that we can use to customize behavior
based on whether it is rendering into a 2D or 3D scene.
[ChangeLog][QtQuick] The QSGMaterial::createShader() virtual
function has been extended to take a render mode argument,
which can be used for any customizations needed in the case
where the shader will be used in combination with 3D perspective
transformations.
Fixes: QTBUG-84695
Change-Id: I5a18a4edbdfa07e8f9d506c42bb20e8eb580927d
Reviewed-by: Laszlo Agocs <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After a symbiotic relationship in Qt 5.14 and 5.15, it is time for
QSGMaterialRhiShader to devour its older sibling and take its place.
This makes the direct OpenGL rendering path disfunctional. All
QSGMaterial Qt 6 TODOs are solved, the API is clean and straightforward
again: a QSGMaterial creates a QSGMaterialShader, no special flags and
options needed. (it's just that QSGMaterialShader now has a slightly
different API)
Task-number: QTBUG-79268
Task-number: QTBUG-82997
Change-Id: I545ca8d796c5535e81957c706e7832133be15b7d
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use a more descriptive name, commitTextureOperations() in order to avoid
confusion with QSGDynamicTexture::updateTexture() which has nothing to
do with this.
With this the QSGTexture interface has all 5.14 pending changes done
(changes that were plumbed via ugly hacks due to having had to deal with
binary compatibility). The awful enforcing of subclassing QSGTexturePrivate
for each and every QSGTexture subclass is now eliminated.
Purging the direct OpenGL code path will involve removing QSGTexture functions
like textureId(), bind(), updateBindOptions(). With this patch we now we have all
the equivalents (or, in some cases, spiritual successors) in place.
Task-number: QTBUG-82997
Change-Id: I7a831f982070c52abc7a36604130a1110d14ff9c
Reviewed-by: Andy Nichols <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need to either ensure the context is destroyed before the offscreen
surface, or make sure the context is not current (and so the surface is
not associated with it anymore) when it is destroyed. We choose the
latter here.
Change-Id: If4424b98c4d8a718aa49d99285360ded6a5e128e
Fixes: QTBUG-82371
Pick-to: 5.15
Reviewed-by: Andy Nichols <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The headers are moving from QtGui to QtOpenGL. By avoiding the
qualification we can keep them compiling either way. Also, add
opengl-private to make the types available.
Also removed the QGraphicsRotation hack to get access to the projected
rotation function of QMatrix4x4. The function is public now.
Task-number: QTBUG-74409
Change-Id: I216e8ca09f8e247f96627b081308e3a57c55c29c
Reviewed-by: Ulf Hermann <[email protected]>
|
|
|
|
|
|
|
| |
Amends 744e77b841878fb017c0f2d60607090008f28180.
Change-Id: I16e37aaf503eb62f67fca0e48be4c92c4a72ae46
Reviewed-by: Ulf Hermann <[email protected]>
|
|
|
|
|
|
| |
Change-Id: I7783ed26a66f03ebe3b26bcba2f42f9fff45a417
Reviewed-by: Lars Knoll <[email protected]>
Reviewed-by: Christian Strømme <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Opt in via environment variables:
QSG_RHI=1 -> enable using QRhi instead of GL
QSG_RHI_BACKEND -> set to vulkan, metal, d3d11, gl to override the default
(the default is d3d11 on Windows, metal on Mac, gl elsewhere)
Or force a given rhi backend via the existing
QQuickWindow::setSceneGraphBackend().
Otherwise the default behavior is the same as before, the rhi code path
is never active by default.
-no-opengl builds are supported in the sense that they work and default
to the software backend. However, the rhi code path cannot currently be
used in such builds, even though QRhi from qtbase is fully functional
with Vulkan, D3D, or Metal even when qtbase was configured with
-no-opengl. This cannot be utilized by Quick atm due to OpenGL usage
being all over the place in the sources corresponding to the default
backend, and those host the rhi code path as well. This will be cleaned up
hopefully in Qt 6, with the removal all direct OpenGL usage.
Other env.vars.:
QSG_RHI_DEBUG_LAYER=1 -> enable D3D debug or Vulkan validation layer
(assuming the system is set up for this)
QSG_RHI_SHADEREFFECT_DEBUG=1 -> print stuff from ShaderEffect
QSG_SAMPLES=1,2,4,... -> MSAA sample count (but QSurfaceFormat works too)
QT_D3D_ADAPTER_INDEX=0,1,... -> D3D adapter index
QT_VK_PHYSICAL_DEVICE_INDEX=0,1,... -> Vulkan physical device index
QSG_RHI_UINT32_INDEX=1 -> always use uint index data (both
merged/unmerged, convert when needed - with some rhi backends this is
implicit)
QSG_RENDER_LOOP -> to override the render loop as usual. The default
with RHI is threaded for Metal, threaded for Vulkan on Windows, basic
for Vulkan on Linux and Android (to be checked later), while the existing
rules apply for OpenGL.
Not supported when running with QRhi:
- particles
- compressed atlases (though this is transparent to the apps)
- QSGRenderNode
- QQuickRenderControl
- QQuickFramebufferObject
- certain QQuickWindow functionality that depends directly on OpenGL
- anisotropic filtering for textures
- native text may lack some gamma correction
- QSGEngine applicability unclear
- some QML profiler logs may be incorrect or irrelevant
Change-Id: I7822e99ad79e342e4166275da6e9e66498d76521
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
This avoids the race condition created by calling it the first time
inside the threads.
Fixes: QTBUG-76338
Fixes: QTBUG-76069
Change-Id: I6108526eb6f5b5ba9c3334437102fc5959f53030
Reviewed-by: Laszlo Agocs <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Force synchronous rendering in QQuickShapGenericRenderer.
(In theory, we could support async also for no-thread
by running the tasks on the Gui thread, but there would
perhaps be little gain from doing this.)
Change-Id: I0fb7526fdaa56d3c609c83c8d4790b4352d782fd
Reviewed-by: Lorn Potter <[email protected]>
Reviewed-by: Simon Hausmann <[email protected]>
|
|
This change moves the implementation of QtQuick.Shapes into an own
qt module, where classes are privately exported.
In this way Shapes QML types can be internally (= from other Qt
modules) instantiated also from cpp.
Change-Id: I428f981f0a1f3083e6571cbeaffa706fd8ef7254
Reviewed-by: Shawn Rutledge <[email protected]>
Reviewed-by: Laszlo Agocs <[email protected]>
|