Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qpixmapcache_p.h
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
#
ifndef
QPIXMAPCACHE_P_H
5
#
define
QPIXMAPCACHE_P_H
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. This header
12
// file may change from version to version without notice, or even be removed.
13
//
14
// We mean it.
15
//
16
17
#
include
<
QtGui
/
private
/
qtguiglobal_p
.
h
>
18
#
include
"qpixmapcache.h"
19
#
include
"qpaintengine.h"
20
#
include
<
private
/
qimage_p
.
h
>
21
#
include
<
private
/
qpixmap_raster_p
.
h
>
22
#
include
"qcache.h"
23
24
QT_BEGIN_NAMESPACE
25
26
class
QPixmapCache
::
KeyData
27
{
28
public
:
29
KeyData
() :
isValid
(
true
),
key
(0),
ref
(1) {}
30
KeyData
(
const
KeyData &other)
31
:
isValid
(
other
.
isValid
),
key
(
other
.
key
),
ref
(1) {}
32
~
KeyData
() {}
33
34
QString
stringKey
;
35
bool
isValid
;
36
int
key
;
37
int
ref
;
38
};
39
40
// XXX: hw: is this a general concept we need to abstract?
41
class
QPixmapCacheEntry
:
public
QPixmap
42
{
43
public
:
44
QPixmapCacheEntry
(
const
QPixmapCache::Key &key,
const
QPixmap &pix) :
QPixmap
(
pix
),
key
(
key
)
45
{
46
QPlatformPixmap *pd = handle();
47
if
(pd && pd->classId() == QPlatformPixmap::RasterClass) {
48
QRasterPlatformPixmap *d =
static_cast
<QRasterPlatformPixmap*>(pd);
49
if
(!d->image.isNull() && d->image.d->paintEngine
50
&& !d->image.d->paintEngine->isActive())
51
{
52
delete
d->image.d->paintEngine;
53
d->image.d->paintEngine =
nullptr
;
54
}
55
}
56
}
57
~
QPixmapCacheEntry
();
58
QPixmapCache
::
Key
key
;
59
};
60
61
QT_END_NAMESPACE
62
63
#
endif
// QPIXMAPCACHE_P_H
QPMCache
Definition
qpixmapcache.cpp:178
QPMCache::remove
bool remove(const QString &key)
Definition
qpixmapcache.cpp:327
QPMCache::insert
bool insert(const QString &key, const QPixmap &pixmap, int cost)
Definition
qpixmapcache.cpp:298
QPMCache::releaseKey
void releaseKey(const QPixmapCache::Key &key)
Definition
qpixmapcache.cpp:361
QPMCache::clear
void clear()
Definition
qpixmapcache.cpp:377
QPMCache::getKeyData
static QPixmapCache::KeyData * getKeyData(QPixmapCache::Key *key)
Definition
qpixmapcache.cpp:394
QPMCache::~QPMCache
~QPMCache()
Definition
qpixmapcache.cpp:237
QPMCache::flushDetachedPixmaps
bool flushDetachedPixmaps(bool nt)
Definition
qpixmapcache.cpp:257
QPMCache::object
QPixmap * object(const QString &key) const
Definition
qpixmapcache.cpp:281
QPMCache::get
static QPixmapCache::KeyData * get(const QPixmapCache::Key &key)
Definition
qpixmapcache.cpp:198
QPMCache::resizeKeyArray
void resizeKeyArray(int size)
Definition
qpixmapcache.cpp:338
QPMCache::createKey
QPixmapCache::Key createKey()
Definition
qpixmapcache.cpp:349
QPMCache::insert
QPixmapCache::Key insert(const QPixmap &pixmap, int cost)
Definition
qpixmapcache.cpp:313
QPMCache::timerEvent
void timerEvent(QTimerEvent *) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
Definition
qpixmapcache.cpp:269
QPixmapCacheEntry
Definition
qpixmapcache_p.h:42
QPixmapCacheEntry::key
QPixmapCache::Key key
Definition
qpixmapcache_p.h:58
QPixmapCacheEntry::~QPixmapCacheEntry
~QPixmapCacheEntry()
Definition
qpixmapcache.cpp:408
QPixmapCacheEntry::QPixmapCacheEntry
QPixmapCacheEntry(const QPixmapCache::Key &key, const QPixmap &pix)
Definition
qpixmapcache_p.h:44
QPixmapCache::KeyData
Definition
qpixmapcache_p.h:27
QPixmapCache::KeyData::KeyData
KeyData()
Definition
qpixmapcache_p.h:29
QPixmapCache::KeyData::KeyData
KeyData(const KeyData &other)
Definition
qpixmapcache_p.h:30
QPixmapCache::KeyData::key
int key
Definition
qpixmapcache_p.h:36
QPixmapCache::KeyData::ref
int ref
Definition
qpixmapcache_p.h:37
QPixmapCache::KeyData::isValid
bool isValid
Definition
qpixmapcache_p.h:35
QPlatformGraphicsBufferHelper
\inmodule QtGui
cache_limit_default
static const int cache_limit_default
Definition
qpixmapcache.cpp:60
qt_pixmapcache_thread_test
static bool qt_pixmapcache_thread_test()
Definition
qpixmapcache.cpp:72
cost
static qsizetype cost(const QPixmap &pixmap)
Definition
qpixmapcache.cpp:62
qt_qpixmapcache_qpixmapcache_total_used
Q_AUTOTEST_EXPORT int qt_qpixmapcache_qpixmapcache_total_used()
Definition
qpixmapcache.cpp:595
qt_qpixmapcache_flush_detached_pixmaps
Q_AUTOTEST_EXPORT void qt_qpixmapcache_flush_detached_pixmaps()
Definition
qpixmapcache.cpp:588
qtbase
src
gui
image
qpixmapcache_p.h
Generated on
for Qt by
1.14.0