mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-25 08:44:38 +00:00
Merge branch 'docs' of https://bitbucket.org/johnprestonmail/telegram-desktop into docs
This commit is contained in:
commit
322eef660e
@ -315,7 +315,7 @@ QPixmap _prepareFrame(const ClipFrameRequest &request, const QImage &original, Q
|
|||||||
if (fill) p.fillRect(0, 0, cache.width() / factor, cache.height() / factor, st::black);
|
if (fill) p.fillRect(0, 0, cache.width() / factor, cache.height() / factor, st::black);
|
||||||
if (smooth && badSize) p.setRenderHint(QPainter::SmoothPixmapTransform);
|
if (smooth && badSize) p.setRenderHint(QPainter::SmoothPixmapTransform);
|
||||||
QRect to((request.outerw - request.framew) / (2 * factor), (request.outerh - request.frameh) / (2 * factor), request.framew / factor, request.frameh / factor);
|
QRect to((request.outerw - request.framew) / (2 * factor), (request.outerh - request.frameh) / (2 * factor), request.framew / factor, request.frameh / factor);
|
||||||
QRect from(0, 0, original.width() / factor, original.height() / factor);
|
QRect from(0, 0, original.width(), original.height());
|
||||||
p.drawImage(to, original, from, Qt::ColorOnly);
|
p.drawImage(to, original, from, Qt::ColorOnly);
|
||||||
}
|
}
|
||||||
if (request.rounded) {
|
if (request.rounded) {
|
||||||
@ -351,6 +351,9 @@ ClipReader::ClipReader(const FileLocation &location, const QByteArray &data) : _
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ClipReader::start(int32 framew, int32 frameh, int32 outerw, int32 outerh, bool rounded) {
|
void ClipReader::start(int32 framew, int32 frameh, int32 outerw, int32 outerh, bool rounded) {
|
||||||
|
if (_clipManagers.size() <= _threadIndex) error();
|
||||||
|
if (_state == ClipError) return;
|
||||||
|
|
||||||
int32 factor(cIntRetinaFactor());
|
int32 factor(cIntRetinaFactor());
|
||||||
_request.factor = factor;
|
_request.factor = factor;
|
||||||
_request.framew = framew * factor;
|
_request.framew = framew * factor;
|
||||||
@ -380,7 +383,10 @@ QPixmap ClipReader::current(int32 framew, int32 frameh, int32 outerw, int32 oute
|
|||||||
result = _current = QPixmap();
|
result = _current = QPixmap();
|
||||||
result = _current = _prepareFrame(_request, current, _cacheForResize, true);
|
result = _current = _prepareFrame(_request, current, _cacheForResize, true);
|
||||||
|
|
||||||
_clipManagers.at(_threadIndex)->update(this);
|
if (_clipManagers.size() <= _threadIndex) error();
|
||||||
|
if (_state != ClipError) {
|
||||||
|
_clipManagers.at(_threadIndex)->update(this);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -409,8 +415,11 @@ ClipState ClipReader::state() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ClipReader::stop() {
|
void ClipReader::stop() {
|
||||||
_clipManagers.at(_threadIndex)->stop(this);
|
if (_clipManagers.size() <= _threadIndex) error();
|
||||||
_width = _height = 0;
|
if (_state != ClipError) {
|
||||||
|
_clipManagers.at(_threadIndex)->stop(this);
|
||||||
|
_width = _height = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClipReader::error() {
|
void ClipReader::error() {
|
||||||
@ -761,3 +770,20 @@ void ClipReadManager::process() {
|
|||||||
|
|
||||||
_processingInThread = 0;
|
_processingInThread = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClipReadManager::~ClipReadManager() {
|
||||||
|
{
|
||||||
|
QMutexLocker lock(&_readerPointersMutex);
|
||||||
|
for (ReaderPointers::iterator i = _readerPointers.begin(), e = _readerPointers.end(); i != e; ++i) {
|
||||||
|
if (i.value()) {
|
||||||
|
i.key()->_private = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_readerPointers.clear();
|
||||||
|
|
||||||
|
for (Readers::iterator i = _readers.begin(), e = _readers.end(); i != e; ++i) {
|
||||||
|
delete i.key();
|
||||||
|
}
|
||||||
|
_readers.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -560,6 +560,7 @@ public:
|
|||||||
void start(ClipReader *reader);
|
void start(ClipReader *reader);
|
||||||
void update(ClipReader *reader);
|
void update(ClipReader *reader);
|
||||||
void stop(ClipReader *reader);
|
void stop(ClipReader *reader);
|
||||||
|
~ClipReadManager();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public:
|
|||||||
typedef QHash<PeerId, History*> Map;
|
typedef QHash<PeerId, History*> Map;
|
||||||
Map map;
|
Map map;
|
||||||
|
|
||||||
Histories() : unreadFull(0), unreadMuted(0), _a_typings(animation(this, &Histories::step_typings)) {
|
Histories() : _a_typings(animation(this, &Histories::step_typings)), unreadFull(0), unreadMuted(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void regSendAction(History *history, UserData *user, const MTPSendMessageAction &action);
|
void regSendAction(History *history, UserData *user, const MTPSendMessageAction &action);
|
||||||
|
@ -83,8 +83,8 @@ NotifyWindow::NotifyWindow(HistoryItem *msg, int32 x, int32 y, int32 fwdCount) :
|
|||||||
, hiding(false)
|
, hiding(false)
|
||||||
, _index(0)
|
, _index(0)
|
||||||
, a_opacity(0)
|
, a_opacity(0)
|
||||||
, a_y(y + st::notifyHeight + st::notifyDeltaY)
|
|
||||||
, a_func(anim::linear)
|
, a_func(anim::linear)
|
||||||
|
, a_y(y + st::notifyHeight + st::notifyDeltaY)
|
||||||
, _a_appearance(animation(this, &NotifyWindow::step_appearance)) {
|
, _a_appearance(animation(this, &NotifyWindow::step_appearance)) {
|
||||||
|
|
||||||
updateNotifyDisplay();
|
updateNotifyDisplay();
|
||||||
|
Loading…
Reference in New Issue
Block a user