6#include <QtCore/qglobal.h>
7#include <QtCore/qrect.h>
8#include <QtCore/qpoint.h>
9#include <QtCore/qdatastream.h>
10#include <QtCore/qstack.h>
11#include <QtCore/qendian.h>
12#include <QtCore/qvarlengtharray.h>
78 return deallocateInNode(
rect.topLeft(), m_root);
99 QRect splitRect = currentRect;
113 QRect leftRect = currentRect;
114 QRect rightRect = currentRect;
140 mergeNodeWithNeighbors(node);
153 if (node->
parent ==
nullptr)
189 neighbor = neighbor->
right;
200 nodeRef = &
parent->parent->left;
202 nodeRef = &
parent->parent->right;
227 neighbor = neighbor->
left;
238 nodeRef = &
parent->parent->left;
240 nodeRef = &
parent->parent->right;
254 struct AreaAllocatorTable
280 template <
typename T>
286 template <
typename T>
303 nodesToProcess.
append(node);
304 if (node->
left !=
nullptr)
306 if (node->
right !=
nullptr)
311 ret.resize(AreaAllocatorTable::HeaderSize + AreaAllocatorTable::NodeSize * nodesToProcess.
size());
314 AreaAllocatorTable::put(
data, AreaAllocatorTable::majorVersion,
quint8(5));
315 AreaAllocatorTable::put(
data, AreaAllocatorTable::minorVersion,
quint8(12));
316 AreaAllocatorTable::put(
data, AreaAllocatorTable::width,
quint32(m_size.
width()));
317 AreaAllocatorTable::put(
data, AreaAllocatorTable::height,
quint32(m_size.
height()));
319 data += AreaAllocatorTable::HeaderSize;
321 AreaAllocatorTable::put(
data, AreaAllocatorTable::split,
qint32(node->
split));
325 (node->
isOccupied ? AreaAllocatorTable::IsOccupied : 0)
326 | (node->
left !=
nullptr ? AreaAllocatorTable::HasLeft : 0)
327 | (node->
right !=
nullptr ? AreaAllocatorTable::HasRight : 0);
328 AreaAllocatorTable::put(
data, AreaAllocatorTable::flags,
flags);
329 data += AreaAllocatorTable::NodeSize;
337 if (
uint(
size) < AreaAllocatorTable::HeaderSize) {
338 qWarning(
"QSGAreaAllocator::deserialize: Data not long enough to fit header");
344 quint8 majorVersion = AreaAllocatorTable::fetch<quint8>(
data, AreaAllocatorTable::majorVersion);
345 quint8 minorVersion = AreaAllocatorTable::fetch<quint8>(
data, AreaAllocatorTable::minorVersion);
346 if (majorVersion != 5 || minorVersion != 12) {
347 qWarning(
"Unrecognized version %d.%d of QSGAreaAllocator",
353 m_size =
QSize(AreaAllocatorTable::fetch<quint32>(
data, AreaAllocatorTable::width),
354 AreaAllocatorTable::fetch<quint32>(
data, AreaAllocatorTable::height));
363 data += AreaAllocatorTable::HeaderSize;
365 if (
data + AreaAllocatorTable::NodeSize >
end) {
366 qWarning(
"QSGAreaAllocator::deseriable: Data not long enough for nodes");
372 node->
split = AreaAllocatorTable::fetch<qint32>(
data, AreaAllocatorTable::split);
375 quint8 flags = AreaAllocatorTable::fetch<quint8>(
data, AreaAllocatorTable::flags);
378 if (
flags & AreaAllocatorTable::HasLeft) {
383 if (
flags & AreaAllocatorTable::HasRight) {
388 data += AreaAllocatorTable::NodeSize;
bool isEmpty() const noexcept
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr int top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr void setLeft(int pos) noexcept
Sets the left edge of the rectangle to the given x coordinate.
constexpr int left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr void setWidth(int w) noexcept
Sets the width of the rectangle to the given width.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr void setHeight(int h) noexcept
Sets the height of the rectangle to the given height.
constexpr void setTop(int pos) noexcept
Sets the top edge of the rectangle to the given y coordinate.
QSGAreaAllocator(const QSize &size)
const char * deserialize(const char *data, int size)
QRect allocate(const QSize &size)
bool deallocate(const QRect &rect)
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
T pop()
Removes the top item from the stack and returns it.
void push(const T &t)
Adds element t to the top of the stack.
constexpr size_type size() const noexcept
QPair< bool, quint32 > HeaderSize
QList< QAnyStringView > split(QAnyStringView source, QAnyStringView sep)
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
constexpr T qToBigEndian(T source)
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
static const int maxMargin
QSGAreaAllocatorNode(QSGAreaAllocatorNode *parent)
QSGAreaAllocatorNode * parent
QSGAreaAllocatorNode * right
QSGAreaAllocatorNode * left
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent