1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-06-28 12:09:15 +02:00

Optimization

This commit is contained in:
2021-04-13 20:30:27 +02:00
parent a42709e6a2
commit 071056b9bc
6 changed files with 20 additions and 22 deletions

View File

@ -228,11 +228,11 @@ void RasterTile::render()
std::sort(_points.begin(), _points.end());
QList<TextItem*> textItems;
QRect tileRect(_xy, _img.size());
QRect tileRect(_xy, _pixmap.size());
_img.fill(Qt::transparent);
_pixmap.fill(Qt::transparent);
QPainter painter(&_img);
QPainter painter(&_pixmap);
painter.setRenderHint(QPainter::Antialiasing);
painter.translate(-_xy.x(), -_xy.y());

View File

@ -1,7 +1,7 @@
#ifndef MAPSFORGE_RASTERTILE_H
#define MAPSFORGE_RASTERTILE_H
#include <QImage>
#include <QPixmap>
#include "map/projection.h"
#include "map/transform.h"
#include "style.h"
@ -19,12 +19,11 @@ public:
const QRect &rect, const QString &key, const QList<MapData::Path> &paths,
const QList<MapData::Point> &points)
: _proj(proj), _transform(transform), _zoom(zoom), _xy(rect.topLeft()),
_key(key), _img(rect.size(), QImage::Format_ARGB32_Premultiplied),
_paths(paths), _points(points) {}
_key(key), _pixmap(rect.size()), _paths(paths), _points(points) {}
const QString &key() const {return _key;}
const QPoint &xy() const {return _xy;}
const QImage &img() const {return _img;}
const QPixmap &pixmap() const {return _pixmap;}
void render();
@ -83,7 +82,7 @@ private:
int _zoom;
QPoint _xy;
QString _key;
QImage _img;
QPixmap _pixmap;
QList<MapData::Path> _paths;
QList<MapData::Point> _points;
};