blob: 0b2bd641476a06521a03fcd00f201374920e83e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
#include "qblittable_p.h"
#ifndef QT_NO_BLITTABLE
QT_BEGIN_NAMESPACE
class QBlittablePrivate
{
public:
QBlittablePrivate(const QSize &size, QBlittable::Capabilities caps)
: caps(caps), m_size(size), locked(false), cachedImg(0)
{}
QBlittable::Capabilities caps;
QSize m_size;
bool locked;
QImage *cachedImg;
};
QBlittable::QBlittable(const QSize &size, Capabilities caps)
: d_ptr(new QBlittablePrivate(size,caps))
{
}
QBlittable::~QBlittable()
{
delete d_ptr;
}
QBlittable::Capabilities QBlittable::capabilities() const
{
Q_D(const QBlittable);
return d->caps;
}
QSize QBlittable::size() const
{
Q_D(const QBlittable);
return d->m_size;
}
QImage *QBlittable::lock()
{
Q_D(QBlittable);
if (!d->locked) {
d->cachedImg = doLock();
d->locked = true;
}
return d->cachedImg;
}
void QBlittable::unlock()
{
Q_D(QBlittable);
if (d->locked) {
doUnlock();
d->locked = false;
}
}
QT_END_NAMESPACE
#endif //QT_NO_BLITTABLE
|