Changeset 561 for trunk/src/gui/painting/qvectorpath_p.h
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/gui/painting/qvectorpath_p.h (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/painting/qvectorpath_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 56 56 #include <QtGui/qpaintengine.h> 57 57 58 #include "qpaintengine_p.h"59 #include "qstroker_p.h"60 #include "qpainter_p.h"58 #include 59 #include 60 #include 61 61 62 62 … … 67 67 QT_MODULE(Gui) 68 68 69 69 70 70 #define QVECTORPATH_NO_CACHE 71 typedef void (*qvectorpath_cache_cleanup)(QPaintEngineEx *engine, void *data); 71 72 72 73 struct QRealRect { … … 78 79 public: 79 80 enum Hint { 80 // Basic shapes... 81 LinesHint = 0x0001, // Just plain lines... 82 RectangleHint = 0x0002, 83 ConvexPolygonHint = 0x0003, // Convex polygon... 84 NonISectPolygonHint = 0x0004, // concave polygon, but not intersecting.. 85 NonCurvedShapeHint = 0x0005, // Generic polygon, possibly self-intersecting... 86 CurvedShapeHint = 0x0006, // Generic vector path.. 87 EllipseHint = 0x0007, 88 ShapeHintMask = 0x000f, 81 // Shape hints, in 0x000000ff, access using shape() 82 AreaShapeMask = 0x0001, // shape covers an area 83 NonConvexShapeMask = 0x0002, // shape is not convex 84 CurvedShapeMask = 0x0004, // shape contains curves... 85 LinesShapeMask = 0x0008, 86 RectangleShapeMask = 0x0010, 87 ShapeMask = 0x001f, 88 89 // Shape hints merged into basic shapes.. 90 LinesHint = LinesShapeMask, 91 RectangleHint = AreaShapeMask | RectangleShapeMask, 92 EllipseHint = AreaShapeMask | CurvedShapeMask, 93 ConvexPolygonHint = AreaShapeMask, 94 PolygonHint = AreaShapeMask | NonConvexShapeMask, 95 RoundedRectHint = AreaShapeMask | CurvedShapeMask, 96 ArbitraryShapeHint = AreaShapeMask | NonConvexShapeMask | CurvedShapeMask, 89 97 90 98 // Other hints 91 CacheHint = 0x0100, 92 ControlPointRect = 0x0200, // Set if the control point rect has been calculated... 99 IsCachedHint = 0x0100, // Set if the cache hint is set 100 ShouldUseCacheHint = 0x0200, // Set if the path should be cached when possible.. 101 ControlPointRect = 0x0400, // Set if the control point rect has been calculated... 93 102 94 103 // Shape rendering specifiers... 95 104 OddEvenFill = 0x1000, 96 105 WindingFill = 0x2000, 97 ImplicitClose = 0x4000 ,106 ImplicitClose = 0x4000 98 107 }; 99 108 … … 102 111 int count, 103 112 const QPainterPath::ElementType *elements = 0, 104 uint hints = CurvedShapeHint)113 uint hints = ShapeHint) 105 114 : m_elements(elements), 106 115 m_points(points), 107 116 m_count(count), 108 117 m_hints(hints) 109 #ifndef QVECTORPATH_NO_CACHE110 , m_cache(0)111 #endif112 118 { 113 119 } 114 120 115 const QRealRect &controlPointRect() const;121 ; 116 122 117 inline Hint shape() const { return (Hint) (m_hints & ShapeHintMask); }123 118 124 119 inline bool hasCacheHint() const { return m_hints & CacheHint; } 125 inline Hint shape() const { return (Hint) (m_hints & ShapeMask); } 126 inline bool isConvex() const { return (m_hints & NonConvexShapeMask) == 0; } 127 inline bool isCurved() const { return m_hints & CurvedShapeMask; } 128 129 inline bool isCacheable() const { return m_hints & ShouldUseCacheHint; } 120 130 inline bool hasImplicitClose() const { return m_hints & ImplicitClose; } 121 131 inline bool hasWindingFill() const { return m_hints & WindingFill; } 122 132 133 123 134 inline uint hints() const { return m_hints; } 124 135 … … 128 139 129 140 inline int elementCount() const { return m_count; } 141 130 142 131 143 static inline uint polygonFlags(QPaintEngine::PolygonDrawMode mode); 132 144 133 private:134 Q_DISABLE_COPY(QVectorPath)135 136 #ifndef QVECTORPATH_NO_CACHE137 145 struct CacheEntry { 138 void*engine;139 int id;140 void *extra;146 *engine; 147 ; 148 ; 141 149 CacheEntry *next; 142 150 }; 143 151 144 void addCacheData(CacheEntry *d) { 145 d->next = m_cache; 146 m_cache = d; 152 CacheEntry *addCacheData(QPaintEngineEx *engine, void *data, qvectorpath_cache_cleanup cleanup) const; 153 inline CacheEntry *lookupCacheData(QPaintEngineEx *engine) const { 154 Q_ASSERT(m_hints & ShouldUseCacheHint); 155 CacheEntry *e = m_cache; 156 while (e) { 157 if (e->engine == engine) 158 return e; 159 e = e->next; 160 } 161 return 0; 147 162 } 148 163 149 CacheEntry *m_cache; 150 #endif 164 165 private: 166 Q_DISABLE_COPY(QVectorPath) 151 167 152 168 const QPainterPath::ElementType *m_elements; … … 156 172 mutable uint m_hints; 157 173 mutable QRealRect m_cp_rect; 174 175 158 176 }; 159 177
Note:
See TracChangeset
for help on using the changeset viewer.
