8#include <private/qsgadaptationlayer_p.h>
9#include <QtQuick/private/qsgrenderer_p.h>
13#include <QtQuick/private/qsgtexture_p.h>
14#include <QtCore/QRunnable>
150 , m_textureSize(0, 0)
154 , m_hideSource(
false)
158 , m_textureMirroring(MirrorVertically)
167 QQuickWindow::AfterSynchronizingStage);
184void QQuickShaderEffectSource::ensureTexture()
192 "QQuickShaderEffectSource::ensureTexture",
193 "Cannot be used outside the rendering thread");
208 qWarning(
"QQuickShaderEffectSource::textureProvider: can only be queried on the rendering thread of an exposed window");
250 if (
mode == m_wrapMode)
280 if (
item == m_sourceItem)
284 d->derefFromEffectItem(m_hideSource);
304 else if (m_sourceItem->
window())
305 d->refWindow(m_sourceItem->
window());
306 d->refFromEffectItem(m_hideSource);
310 qWarning(
"ShaderEffectSource: sourceItem and ShaderEffectSource must both be children of the same window.");
311 m_sourceItem =
nullptr;
318void QQuickShaderEffectSource::sourceItemDestroyed(
QObject *
item)
322 m_sourceItem =
nullptr;
344 if (
rect == m_sourceRect)
367 return m_textureSize;
372 if (
size == m_textureSize)
374 m_textureSize =
size;
448 if (
hide == m_hideSource)
537 m_textureMirroring = mirroring;
573 if (
count == m_samples)
619 if (m_texture || m_provider) {
621 QQuickWindow::AfterSynchronizingStage);
623 m_provider =
nullptr;
656 if (!m_sourceItem || m_sourceItem->
width() <= 0 || m_sourceItem->
height() <= 0) {
672 const float dpr =
d->window->effectiveDevicePixelRatio();
720 node =
d->sceneGraphContext()->createInternalImageNode(
d->sceneGraphRenderContext());
725 connect(m_texture,
SIGNAL(updateRequested()), attached,
SLOT(markTextureDirty()));
729 if (m_live && m_recursive)
743void QQuickShaderEffectSource::invalidateSceneGraph()
750 m_provider =
nullptr;
767#include "qquickshadereffectsource.moc"
768#include "moc_qquickshadereffectsource_p.cpp"
static QObjectPrivate * get(QObject *o)
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
QThread * thread() const
Returns the thread in which the object lives.
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
QSGRenderContext * sceneGraphRenderContext() const
void removeItemChangeListener(QQuickItemChangeListener *, ChangeTypes types)
void derefFromEffectItem(bool unhide)
void refWindow(QQuickWindow *)
void refFromEffectItem(bool hide)
static QQuickItemPrivate * get(QQuickItem *item)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
void setFlag(Flag flag, bool enabled=true)
Enables the specified flag for this item if enabled is true; if enabled is false, the flag is disable...
QQuickWindow * window() const
Returns the window in which this item is rendered.
qreal width
This property holds the width of this item.
virtual void itemChange(ItemChange, const ItemChangeData &)
Called when change occurs for this item.
bool smooth
\qmlproperty bool QtQuick::Item::smooth
qreal height
This property holds the height of this item.
ItemChange
Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes.
bool enabled
\qmlproperty bool QtQuick::Item::enabled
void update()
Schedules a call to updatePaintNode() for this item.
QQuickShaderEffectSourceCleanup(QSGLayer *t, QQuickShaderEffectSourceTextureProvider *p)
QQuickShaderEffectSourceTextureProvider * provider
void run() override
Implement this pure virtual function in your subclass.
QSGTexture::Filtering mipmapFiltering
QSGTexture * texture() const override
Returns a pointer to the texture object.
QSGTexture::WrapMode verticalWrap
QSGTexture::WrapMode horizontalWrap
QSGTexture::Filtering filtering
QQuickShaderEffectSourceTextureProvider()
void setFormat(Format format)
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) override
~QQuickShaderEffectSource() override
QQuickShaderEffectSource(QQuickItem *parent=nullptr)
\qmltype ShaderEffectSource \instantiates QQuickShaderEffectSource \inqmlmodule QtQuick
TextureMirroring textureMirroring
void textureSizeChanged()
void setSourceItem(QQuickItem *item)
void setRecursive(bool enabled)
QSGTextureProvider * textureProvider() const override
Returns the texture provider for an item.
void setTextureMirroring(TextureMirroring mirroring)
void setSourceRect(const QRectF &rect)
void textureMirroringChanged()
void setTextureSize(const QSize &size)
void scheduledUpdateCompleted()
void setHideSource(bool hide)
void releaseResources() override
This function is called when an item should release graphics resources which are not already managed ...
QSGNode * updatePaintNode(QSGNode *, UpdatePaintNodeData *) override
Called on the render thread when it is time to sync the state of the item with the scene graph.
Q_INVOKABLE void scheduleUpdate()
\qmlmethod QtQuick::ShaderEffectSource::scheduleUpdate()
void setWrapMode(WrapMode mode)
void setMipmap(bool enabled)
void itemChange(ItemChange change, const ItemChangeData &value) override
Called when change occurs for this item.
void setSamples(int count)
Q_SLOT void markTextureDirty()
\inmodule QtCore\reentrant
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
virtual QSGLayer * createLayer(QSGRenderContext *renderContext)=0
virtual void setHorizontalWrapMode(QSGTexture::WrapMode wrapMode)=0
virtual void setTexture(QSGTexture *texture)=0
virtual void setTargetRect(const QRectF &rect)=0
virtual void setFiltering(QSGTexture::Filtering filtering)=0
virtual void setInnerTargetRect(const QRectF &rect)=0
virtual void setMipmapFiltering(QSGTexture::Filtering filtering)=0
virtual void setVerticalWrapMode(QSGTexture::WrapMode wrapMode)=0
virtual void scheduleUpdate()=0
virtual void setRecursive(bool recursive)=0
virtual void setMirrorVertical(bool mirror)=0
virtual void setSamples(int samples)=0
virtual void setDevicePixelRatio(qreal ratio)=0
virtual void setItem(QSGNode *item)=0
virtual void setMirrorHorizontal(bool mirror)=0
virtual void setLive(bool live)=0
virtual void setFormat(Format format)=0
virtual void setSize(const QSize &pixelSize)=0
virtual void setRect(const QRectF &logicalRect)=0
virtual void setHasMipmaps(bool mipmap)=0
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
void appendChildNode(QSGNode *node)
Appends node to this node's list of children.
QSGNode * parent() const
Returns the parent node of this node.
void markDirty(DirtyState bits)
Notifies all connected renderers that the node has dirty bits.
NodeType type() const
Returns the type of this node.
void setFlag(Flag, bool=true)
Sets the flag f on this node if enabled is true; otherwise clears the flag.
QSGContext * sceneGraphContext() const
The QSGTextureProvider class encapsulates texture based entities in QML.
void setMipmapFiltering(Filtering filter)
Sets the mipmap sampling mode to filter.
Filtering
Specifies how sampling of texels should filter when texture coordinates are not pixel aligned.
WrapMode
Specifies how the sampler should treat texture coordinates.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
constexpr int & rheight() noexcept
Returns a reference to the height.
constexpr int & rwidth() noexcept
Returns a reference to the width.
constexpr bool isEmpty() const noexcept
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
static QThread * currentThread()
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
constexpr T qAbs(const T &t)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLint GLsizei GLsizei GLenum format
static QT_BEGIN_NAMESPACE qreal dpr(const QWindow *w)
static void get_wrap_mode(QQuickShaderEffectSource::WrapMode mode, QSGTexture::WrapMode *hWrap, QSGTexture::WrapMode *vWrap)
static QSGLayer::Format toLayerFormat(QQuickShaderEffectSource::Format format)
#define Q_ASSERT_X(cond, x, msg)
static const QSize minTextureSize
myObject disconnect()
[26]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent