forked from qt-creator/qt-creator
QmlDesigner: Do not apply smooth rendering if root is a 3D node
Task-number: QDS-7136 Change-Id: I5260153b8d6131160a8d4b67418e81c6f6e4d862 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
@@ -407,8 +407,6 @@ QImage Qt5NodeInstanceServer::grabItem(QQuickItem *item)
|
|||||||
const bool renderEffects = qEnvironmentVariableIsSet("QMLPUPPET_RENDER_EFFECTS");
|
const bool renderEffects = qEnvironmentVariableIsSet("QMLPUPPET_RENDER_EFFECTS");
|
||||||
const bool smoothRendering = qEnvironmentVariableIsSet("QMLPUPPET_SMOOTH_RENDERING");
|
const bool smoothRendering = qEnvironmentVariableIsSet("QMLPUPPET_SMOOTH_RENDERING");
|
||||||
|
|
||||||
int scaleFactor = smoothRendering ? 2 : 1;
|
|
||||||
|
|
||||||
if (renderEffects) {
|
if (renderEffects) {
|
||||||
if (parentEffectItem(item))
|
if (parentEffectItem(item))
|
||||||
return renderImage;
|
return renderImage;
|
||||||
@@ -430,17 +428,20 @@ QImage Qt5NodeInstanceServer::grabItem(QQuickItem *item)
|
|||||||
|
|
||||||
ServerNodeInstance instance = instanceForObject(item);
|
ServerNodeInstance instance = instanceForObject(item);
|
||||||
|
|
||||||
|
const bool rootIs3DObject = rootIsRenderable3DObject();
|
||||||
|
|
||||||
// Setting layer enabled to false messes up the bounding rect.
|
// Setting layer enabled to false messes up the bounding rect.
|
||||||
// Therefore we calculate it upfront.
|
// Therefore we calculate it upfront.
|
||||||
QRectF renderBoundingRect;
|
QRectF renderBoundingRect;
|
||||||
if (instance.isValid())
|
if (instance.isValid())
|
||||||
renderBoundingRect = instance.boundingRect();
|
renderBoundingRect = instance.boundingRect();
|
||||||
|
else if (rootIs3DObject)
|
||||||
else if (rootIsRenderable3DObject())
|
|
||||||
renderBoundingRect = item->boundingRect();
|
renderBoundingRect = item->boundingRect();
|
||||||
else
|
else
|
||||||
renderBoundingRect = ServerNodeInstance::effectAdjustedBoundingRect(item);
|
renderBoundingRect = ServerNodeInstance::effectAdjustedBoundingRect(item);
|
||||||
|
|
||||||
|
const int scaleFactor = (smoothRendering && !rootIs3DObject) ? 2 : 1;
|
||||||
|
|
||||||
// Hide immediate children that have instances and are QQuickItems so we get only
|
// Hide immediate children that have instances and are QQuickItems so we get only
|
||||||
// the parent item's content, as compositing is handled on creator side.
|
// the parent item's content, as compositing is handled on creator side.
|
||||||
QSet<QQuickItem *> layerChildren;
|
QSet<QQuickItem *> layerChildren;
|
||||||
@@ -521,7 +522,6 @@ QImage Qt5NodeInstanceServer::grabItem(QQuickItem *item)
|
|||||||
|
|
||||||
if (!isLayerEnabled(pItem))
|
if (!isLayerEnabled(pItem))
|
||||||
pItem->derefFromEffectItem(false);
|
pItem->derefFromEffectItem(false);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
Q_UNUSED(item)
|
Q_UNUSED(item)
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user