![]() |
Qt 6.x
The Qt SDK
|
#include "qquickcontext2d_p.h"#include "qquickcontext2dcommandbuffer_p.h"#include "qquickcanvasitem_p.h"#include <private/qtquickglobal_p.h>#include <private/qquickcontext2dtexture_p.h>#include <private/qquickitem_p.h>#include <qsgrendererinterface.h>#include <QtQuick/private/qsgcontext_p.h>#include <private/qquicksvgparser_p.h>#include <private/qquickimage_p_p.h>#include <qqmlinfo.h>#include <qqmlengine.h>#include <private/qv4domerrors_p.h>#include <private/qv4engine_p.h>#include <private/qv4object_p.h>#include <private/qv4qobjectwrapper_p.h>#include <private/qquickwindow_p.h>#include <private/qv4value_p.h>#include <private/qv4functionobject_p.h>#include <private/qv4objectproto_p.h>#include <private/qv4scopedvalue_p.h>#include <private/qlocale_tools_p.h>#include <QtCore/qmath.h>#include <QtCore/qvector.h>#include <QtCore/private/qnumeric_p.h>#include <QtCore/QRunnable>#include <QtGui/qguiapplication.h>#include <private/qguiapplication_p.h>#include <qpa/qplatformintegration.h>#include <private/qsgdefaultrendercontext_p.h>#include <cmath>#include "moc_qquickcontext2d_p.cpp"
Include dependency graph for qquickcontext2d.cpp:Go to the source code of this file.
Classes | |
| class | QQuickContext2DEngineData |
| struct | QV4::Heap::QQuickJSContext2D |
| struct | QV4::Heap::QQuickJSContext2DPrototype |
| struct | QV4::Heap::QQuickContext2DStyle |
| struct | QV4::Heap::QQuickJSContext2DPixelData |
| struct | QV4::Heap::QQuickJSContext2DImageData |
| struct | QQuickJSContext2D |
| struct | QQuickJSContext2DPrototype |
| struct | QQuickContext2DStyle |
| struct | QQuickJSContext2DPixelData |
| struct | QQuickJSContext2DImageData |
Namespaces | |
| namespace | QV4 |
| \qmltype Particle \inqmlmodule QtQuick.Particles | |
| namespace | QV4::Heap |
Macros | |
| #define | CHECK_CONTEXT(r) |
| \qmltype Context2D \instantiates QQuickContext2D \inqmlmodule QtQuick | |
| #define | CHECK_CONTEXT_SETTER(r) |
| #define | qClamp(val, min, max) qMin(qMax(val, min), max) |
| #define | CHECK_RGBA(c) (c == '-' || c == '.' || (c >=0 && c <= 9)) |
| #define | Q_TRY_SET_TOKEN(token, value, setStatement) |
Enumerations | |
| enum | FontToken { NoTokens = 0x00 , FontStyle = 0x01 , FontVariant = 0x02 , FontWeight = 0x04 } |
| #define CHECK_CONTEXT | ( | r | ) |
\qmltype Context2D \instantiates QQuickContext2D \inqmlmodule QtQuick
Provides 2D context for shapes on a Canvas item.
The Context2D object can be created by Canvas item's getContext() method:
The Context2D API implements the same \l {http://www.w3.org/TR/2dcontext}{W3C Canvas 2D Context API standard} with some enhanced features.
The Context2D API provides the rendering {context} which defines the methods and attributes needed to draw on the Canvas item. The following assigns the canvas rendering context to a {context} variable:
The Context2D API renders the canvas as a coordinate system whose origin (0,0) is at the top left corner, as shown in the figure below. Coordinates increase along the {x} axis from left to right and along the {y} axis from top to bottom of the canvas.
Definition at line 92 of file qquickcontext2d.cpp.
| #define CHECK_CONTEXT_SETTER | ( | r | ) |
Definition at line 95 of file qquickcontext2d.cpp.
Definition at line 98 of file qquickcontext2d.cpp.
Definition at line 316 of file qquickcontext2d.cpp.
Definition at line 97 of file qquickcontext2d.cpp.
| enum FontToken |
| Enumerator | |
|---|---|
| NoTokens | |
| FontStyle | |
| FontVariant | |
| FontWeight | |
Definition at line 308 of file qquickcontext2d.cpp.
Definition at line 4173 of file qquickcontext2d.cpp.
References qFuzzyCompare().
Referenced by QQuickContext2D::isPointInPath().
Here is the call graph for this function:
Here is the caller graph for this function:| int baseLineOffset | ( | QQuickContext2D::TextBaseLineType | value, |
| const QFontMetrics & | metrics | ||
| ) |
Definition at line 4109 of file qquickcontext2d.cpp.
References QQuickContext2D::Alphabetic, QQuickContext2D::Bottom, QQuickContext2D::Hanging, QQuickContext2D::Middle, and QQuickContext2D::Top.
Referenced by QQuickContext2D::createTextGlyphs().
Here is the caller graph for this function:| DEFINE_OBJECT_VTABLE | ( | QQuickContext2DStyle | ) |
| DEFINE_OBJECT_VTABLE | ( | QQuickJSContext2D | ) |
| DEFINE_OBJECT_VTABLE | ( | QQuickJSContext2DImageData | ) |
| DEFINE_OBJECT_VTABLE | ( | QQuickJSContext2DPixelData | ) |
| DEFINE_OBJECT_VTABLE | ( | QQuickJSContext2DPrototype | ) |
|
static |
Definition at line 217 of file qquickcontext2d.cpp.
References QStringView::at(), ch, QString::clear(), QString::isEmpty(), QStringView::mid(), QString::push_back(), qWarning, QStringView::size(), and QStringView::toString().
Referenced by qt_font_from_string().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 171 of file qquickcontext2d.cpp.
References ok, qWarning, QStringView::toFloat(), and QStringView::trimmed().
Referenced by qSetFontSizeFromToken().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 275 of file qquickcontext2d.cpp.
References QFont::Cursive, QFont::defaultFamily(), QFont::Fantasy, font, QFontDatabase::hasFamily(), QFont::Monospace, qPrintable, qWarning, QFont::SansSerif, QFont::Serif, QFont::setFamily(), and QFont::setStyleHint().
Referenced by qt_font_from_string().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 187 of file qquickcontext2d.cpp.
References font, QStringView::left(), ok, qParseFontSizeFromToken(), qWarning, QStringView::right(), QFont::setPixelSize(), QFont::setPointSize(), QStringView::size(), and QStringView::trimmed().
Referenced by qt_font_from_string().
Here is the call graph for this function:
Here is the caller graph for this function:| Q_QUICK_PRIVATE_EXPORT QColor qt_color_from_string | ( | const QV4::Value & | name | ) |
Definition at line 99 of file qquickcontext2d.cpp.
References QString::data(), QColor::fromHsl(), QColor::fromRgba(), QColor::fromString(), hasAlpha(), ok, Q_UNUSED, qClamp, qRgba(), qRound(), qstrtod(), QString::size(), str, and QString::toUtf8().
Referenced by QQuickContext2DStyle::gradient_proto_addColorStop(), QQuickJSContext2D::method_set_fillStyle(), QQuickJSContext2D::method_set_shadowColor(), and QQuickJSContext2D::method_set_strokeStyle().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 777 of file qquickcontext2d.cpp.
References QPainter::CompositionMode_Clear, QPainter::CompositionMode_ColorBurn, QPainter::CompositionMode_ColorDodge, QPainter::CompositionMode_Darken, QPainter::CompositionMode_Destination, QPainter::CompositionMode_DestinationAtop, QPainter::CompositionMode_DestinationIn, QPainter::CompositionMode_DestinationOut, QPainter::CompositionMode_DestinationOver, QPainter::CompositionMode_Difference, QPainter::CompositionMode_Exclusion, QPainter::CompositionMode_HardLight, QPainter::CompositionMode_Lighten, QPainter::CompositionMode_Multiply, QPainter::CompositionMode_Overlay, QPainter::CompositionMode_Plus, QPainter::CompositionMode_Screen, QPainter::CompositionMode_SoftLight, QPainter::CompositionMode_Source, QPainter::CompositionMode_SourceAtop, QPainter::CompositionMode_SourceIn, QPainter::CompositionMode_SourceOut, QPainter::CompositionMode_SourceOver, and QPainter::CompositionMode_Xor.
Referenced by QQuickJSContext2D::method_set_globalCompositeOperation().
Here is the caller graph for this function:
|
static |
Definition at line 831 of file qquickcontext2d.cpp.
References QPainter::CompositionMode_Clear, QPainter::CompositionMode_ColorBurn, QPainter::CompositionMode_ColorDodge, QPainter::CompositionMode_Darken, QPainter::CompositionMode_Destination, QPainter::CompositionMode_DestinationAtop, QPainter::CompositionMode_DestinationIn, QPainter::CompositionMode_DestinationOut, QPainter::CompositionMode_DestinationOver, QPainter::CompositionMode_Difference, QPainter::CompositionMode_Exclusion, QPainter::CompositionMode_HardLight, QPainter::CompositionMode_Lighten, QPainter::CompositionMode_Multiply, QPainter::CompositionMode_Overlay, QPainter::CompositionMode_Plus, QPainter::CompositionMode_Screen, QPainter::CompositionMode_SoftLight, QPainter::CompositionMode_Source, QPainter::CompositionMode_SourceAtop, QPainter::CompositionMode_SourceIn, QPainter::CompositionMode_SourceOut, QPainter::CompositionMode_SourceOver, QPainter::CompositionMode_Xor, and QStringLiteral.
Referenced by QQuickJSContext2D::method_get_globalCompositeOperation().
Here is the caller graph for this function:
|
static |
Definition at line 935 of file qquickcontext2d.cpp.
References QV4::MemoryManager::allocate(), QV4::Scoped< T >::asReturnedValue(), QV4::Scope::engine, QImage::Format_ARGB32, imageData, QV4::EngineBase::memoryManager, QQuickContext2DEngineData::pixelArrayProto, Q_ASSERT, qAbs(), qRound(), and QV4::PersistentValue::value().
Referenced by QQuickJSContext2DPrototype::method_createImageData(), and QQuickJSContext2DPrototype::method_getImageData().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 330 of file qquickcontext2d.cpp.
References FontStyle, FontVariant, FontWeight, QString::indexOf(), QString::isEmpty(), QStringView::isEmpty(), QString::lastIndexOf(), QStringView::mid(), QString::mid(), NoTokens, Q_TRY_SET_TOKEN, qExtractFontFamiliesFromString(), qSetFontFamilyFromTokens(), qSetFontSizeFromToken(), qWarning, QString::remove(), QFont::setBold(), QFont::setCapitalization(), QFont::setStyle(), QFont::setWeight(), QFont::SmallCaps, QStringView::split(), QFont::StyleItalic, QFont::StyleOblique, token, QStringView::trimmed(), and QStringView::truncate().
Referenced by QQuickJSContext2D::method_set_font().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 769 of file qquickcontext2d.cpp.
References i, and qt_image_convolute_filter().
Here is the call graph for this function:
|
static |
Definition at line 4129 of file qquickcontext2d.cpp.
References QQuickContext2D::Center, QQuickContext2D::End, QGuiApplication::layoutDirection, QQuickContext2D::Left, Qt::LeftToRight, QQuickContext2D::Right, QQuickContext2D::Start, and text.
Referenced by QQuickContext2D::createTextGlyphs().
Here is the caller graph for this function:Definition at line 4179 of file qquickcontext2d.cpp.
Referenced by QQuickContext2D::isPointInPath().
Here is the caller graph for this function: