equal
deleted
inserted
replaced
1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
8 ** |
8 ** |
44 #include "qtextureglyphcache_p.h" |
44 #include "qtextureglyphcache_p.h" |
45 |
45 |
46 #include "private/qnumeric_p.h" |
46 #include "private/qnumeric_p.h" |
47 #include "private/qnativeimage_p.h" |
47 #include "private/qnativeimage_p.h" |
48 #include "private/qfontengine_ft_p.h" |
48 #include "private/qfontengine_ft_p.h" |
|
49 |
|
50 #ifndef QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH |
|
51 #define QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH 256 |
|
52 #endif |
49 |
53 |
50 QT_BEGIN_NAMESPACE |
54 QT_BEGIN_NAMESPACE |
51 |
55 |
52 // #define CACHE_DEBUG |
56 // #define CACHE_DEBUG |
53 |
57 |
110 if (listItemCoordinates.isEmpty()) |
114 if (listItemCoordinates.isEmpty()) |
111 return; |
115 return; |
112 |
116 |
113 rowHeight += margin * 2; |
117 rowHeight += margin * 2; |
114 if (isNull()) |
118 if (isNull()) |
115 createCache(256, rowHeight); |
119 createCache(QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH, rowHeight); |
116 |
120 |
117 // now actually use the coords and paint the wanted glyps into cache. |
121 // now actually use the coords and paint the wanted glyps into cache. |
118 QHash<glyph_t, Coord>::iterator iter = listItemCoordinates.begin(); |
122 QHash<glyph_t, Coord>::iterator iter = listItemCoordinates.begin(); |
119 while (iter != listItemCoordinates.end()) { |
123 while (iter != listItemCoordinates.end()) { |
120 Coord c = iter.value(); |
124 Coord c = iter.value(); |