summaryrefslogtreecommitdiff
path: root/src/svg/qsvggraphics_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/svg/qsvggraphics_p.h')
-rw-r--r--src/svg/qsvggraphics_p.h53
1 files changed, 14 insertions, 39 deletions
diff --git a/src/svg/qsvggraphics_p.h b/src/svg/qsvggraphics_p.h
index d2af6d6..96be929 100644
--- a/src/svg/qsvggraphics_p.h
+++ b/src/svg/qsvggraphics_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt SVG module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QSVGGRAPHICS_P_H
#define QSVGGRAPHICS_P_H
@@ -77,6 +41,7 @@ public:
QSvgArc(QSvgNode *parent, const QPainterPath &path);
void draw(QPainter *p, QSvgExtraStates &states) override;
Type type() const override;
+ QRectF fastBounds(QPainter *p, QSvgExtraStates &states) const override;
QRectF bounds(QPainter *p, QSvgExtraStates &states) const override;
private:
QPainterPath m_path;
@@ -88,6 +53,7 @@ public:
QSvgEllipse(QSvgNode *parent, const QRectF &rect);
void draw(QPainter *p, QSvgExtraStates &states) override;
Type type() const override;
+ QRectF fastBounds(QPainter *p, QSvgExtraStates &states) const override;
QRectF bounds(QPainter *p, QSvgExtraStates &states) const override;
private:
QRectF m_bounds;
@@ -119,6 +85,7 @@ public:
QSvgLine(QSvgNode *parent, const QLineF &line);
void draw(QPainter *p, QSvgExtraStates &states) override;
Type type() const override;
+ QRectF fastBounds(QPainter *p, QSvgExtraStates &states) const override;
QRectF bounds(QPainter *p, QSvgExtraStates &states) const override;
private:
QLineF m_line;
@@ -130,6 +97,7 @@ public:
QSvgPath(QSvgNode *parent, const QPainterPath &qpath);
void draw(QPainter *p, QSvgExtraStates &states) override;
Type type() const override;
+ QRectF fastBounds(QPainter *p, QSvgExtraStates &states) const override;
QRectF bounds(QPainter *p, QSvgExtraStates &states) const override;
QPainterPath *qpath() {
@@ -145,6 +113,7 @@ public:
QSvgPolygon(QSvgNode *parent, const QPolygonF &poly);
void draw(QPainter *p, QSvgExtraStates &states) override;
Type type() const override;
+ QRectF fastBounds(QPainter *p, QSvgExtraStates &states) const override;
QRectF bounds(QPainter *p, QSvgExtraStates &states) const override;
private:
QPolygonF m_poly;
@@ -156,6 +125,7 @@ public:
QSvgPolyline(QSvgNode *parent, const QPolygonF &poly);
void draw(QPainter *p, QSvgExtraStates &states) override;
Type type() const override;
+ QRectF fastBounds(QPainter *p, QSvgExtraStates &states) const override;
QRectF bounds(QPainter *p, QSvgExtraStates &states) const override;
private:
QPolygonF m_poly;
@@ -167,6 +137,7 @@ public:
QSvgRect(QSvgNode *paren, const QRectF &rect, int rx=0, int ry=0);
Type type() const override;
void draw(QPainter *p, QSvgExtraStates &states) override;
+ QRectF fastBounds(QPainter *p, QSvgExtraStates &states) const override;
QRectF bounds(QPainter *p, QSvgExtraStates &states) const override;
private:
QRectF m_rect;
@@ -196,8 +167,12 @@ public:
void addLineBreak() {m_tspans.append(LINEBREAK);}
void setWhitespaceMode(WhitespaceMode mode) {m_mode = mode;}
- //QRectF bounds(QPainter *p, QSvgExtraStates &states) const override;
+ QRectF fastBounds(QPainter *p, QSvgExtraStates &states) const override;
+ QRectF bounds(QPainter *p, QSvgExtraStates &states) const override;
+
private:
+ void draw_helper(QPainter *p, QSvgExtraStates &states, QRectF *boundingRect = nullptr) const;
+
static QSvgTspan * const LINEBREAK;
QPointF m_coord;