Changeset View
Changeset View
Standalone View
Standalone View
core/document.cpp
Show First 20 Lines • Show All 1297 Lines • ▼ Show 20 Line(s) | 1296 | { | |||
---|---|---|---|---|---|
1298 | if (!r) | 1298 | if (!r) | ||
1299 | { | 1299 | { | ||
1300 | m_pixmapRequestsStack.pop_back(); | 1300 | m_pixmapRequestsStack.pop_back(); | ||
1301 | continue; | 1301 | continue; | ||
1302 | } | 1302 | } | ||
1303 | 1303 | | |||
1304 | QRect requestRect = r->isTile() ? r->normalizedRect().geometry( r->width(), r->height() ) : QRect( 0, 0, r->width(), r->height() ); | 1304 | QRect requestRect = r->isTile() ? r->normalizedRect().geometry( r->width(), r->height() ) : QRect( 0, 0, r->width(), r->height() ); | ||
1305 | TilesManager *tilesManager = r->d->tilesManager(); | 1305 | TilesManager *tilesManager = r->d->tilesManager(); | ||
1306 | const double normalizedArea = r->normalizedRect().width() * r->normalizedRect().height(); | ||||
aacid: make this const | |||||
1306 | 1307 | | |||
1307 | // If it's a preload but the generator is not threaded no point in trying to preload | 1308 | // If it's a preload but the generator is not threaded no point in trying to preload | ||
1308 | if ( r->preload() && !m_generator->hasFeature( Generator::Threaded ) ) | 1309 | if ( r->preload() && !m_generator->hasFeature( Generator::Threaded ) ) | ||
1309 | { | 1310 | { | ||
1310 | m_pixmapRequestsStack.pop_back(); | 1311 | m_pixmapRequestsStack.pop_back(); | ||
1311 | delete r; | 1312 | delete r; | ||
1312 | } | 1313 | } | ||
1313 | // request only if page isn't already present and request has valid id | 1314 | // request only if page isn't already present and request has valid id | ||
Show All 9 Lines | 1321 | { | |||
1323 | delete r; | 1324 | delete r; | ||
1324 | } | 1325 | } | ||
1325 | // Ignore requests for pixmaps that are already being generated | 1326 | // Ignore requests for pixmaps that are already being generated | ||
1326 | else if ( tilesManager && tilesManager->isRequesting( r->normalizedRect(), r->width(), r->height() ) ) | 1327 | else if ( tilesManager && tilesManager->isRequesting( r->normalizedRect(), r->width(), r->height() ) ) | ||
1327 | { | 1328 | { | ||
1328 | m_pixmapRequestsStack.pop_back(); | 1329 | m_pixmapRequestsStack.pop_back(); | ||
1329 | delete r; | 1330 | delete r; | ||
1330 | } | 1331 | } | ||
1331 | // If the requested area is above 8000000 pixels, switch on the tile manager | 1332 | // If the requested area is above 8000000 pixels, and we're not rendering most of the page, switch on the tile manager | ||
1332 | else if ( !tilesManager && m_generator->hasFeature( Generator::TiledRendering ) && (long)r->width() * (long)r->height() > 8000000L ) | 1333 | else if ( !tilesManager && m_generator->hasFeature( Generator::TiledRendering ) && | ||
1334 | (long)r->width() * (long)r->height() > 8000000L && | ||||
1335 | normalizedArea < 0.75 && normalizedArea != 0 ) | ||||
1333 | { | 1336 | { | ||
1334 | // if the image is too big. start using tiles | 1337 | // if the image is too big. start using tiles | ||
1335 | qCDebug(OkularCoreDebug).nospace() << "Start using tiles on page " << r->pageNumber() | 1338 | qCDebug(OkularCoreDebug).nospace() << "Start using tiles on page " << r->pageNumber() | ||
1336 | << " (" << r->width() << "x" << r->height() << " px);"; | 1339 | << " (" << r->width() << "x" << r->height() << " px);"; | ||
1337 | 1340 | | |||
1338 | // fill the tiles manager with the last rendered pixmap | 1341 | // fill the tiles manager with the last rendered pixmap | ||
1339 | const QPixmap *pixmap = r->page()->_o_nearestPixmap( r->observer(), r->width(), r->height() ); | 1342 | const QPixmap *pixmap = r->page()->_o_nearestPixmap( r->observer(), r->width(), r->height() ); | ||
1340 | if ( pixmap ) | 1343 | if ( pixmap ) | ||
▲ Show 20 Lines • Show All 4331 Lines • Show Last 20 Lines |
make this const