Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Folloup to PR 36399 OSM prefetch
  • Loading branch information
github-actions[bot] authored and nyalldawson committed May 14, 2020
1 parent 600cea2 commit f6aa330
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
7 changes: 3 additions & 4 deletions src/core/raster/qgsrasterlayerrenderer.cpp
Expand Up @@ -64,7 +64,7 @@ void QgsRasterLayerRendererFeedback::onNewData()
///
QgsRasterLayerRenderer::QgsRasterLayerRenderer( QgsRasterLayer *layer, QgsRenderContext &rendererContext )
: QgsMapLayerRenderer( layer->id(), &rendererContext )
, mLayer( layer )
, mProviderCapabilities( static_cast<QgsRasterDataProvider::Capability>( layer->dataProvider()->capabilities() ) )
, mFeedback( new QgsRasterLayerRendererFeedback( this ) )
{
QgsMapToPixel mapToPixel = rendererContext.mapToPixel();
Expand Down Expand Up @@ -241,9 +241,8 @@ QgsRasterLayerRenderer::~QgsRasterLayerRenderer()
bool QgsRasterLayerRenderer::render()
{
// Skip rendering of out of view tiles (xyz)
if ( !mRasterViewPort || ( mLayer && renderContext()->testFlag( QgsRenderContext::Flag::RenderPreviewJob ) &&
mLayer->dataProvider() &&
!( mLayer->dataProvider()->capabilities() &
if ( !mRasterViewPort || ( renderContext()->testFlag( QgsRenderContext::Flag::RenderPreviewJob ) &&
!( mProviderCapabilities &
QgsRasterInterface::Capability::Prefetch ) ) )
return true;

Expand Down
3 changes: 2 additions & 1 deletion src/core/raster/qgsrasterlayerrenderer.h
Expand Up @@ -19,6 +19,7 @@
#define SIP_NO_FILE

#include "qgsmaplayerrenderer.h"
#include "qgsrasterdataprovider.h"

class QPainter;

Expand Down Expand Up @@ -80,7 +81,7 @@ class CORE_EXPORT QgsRasterLayerRenderer : public QgsMapLayerRenderer

QgsRasterPipe *mPipe = nullptr;

QgsRasterLayer *mLayer;
QgsRasterDataProvider::Capability mProviderCapabilities;

//! feedback class for cancellation and preview generation
QgsRasterLayerRendererFeedback *mFeedback = nullptr;
Expand Down
34 changes: 17 additions & 17 deletions src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -728,24 +728,24 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, in
return image;
}

QgsDebugMsg( QStringLiteral( "layer extent: %1,%2,%3,%4 %5x%6" )
.arg( qgsDoubleToString( mLayerExtent.xMinimum() ),
qgsDoubleToString( mLayerExtent.yMinimum() ) )
.arg( qgsDoubleToString( mLayerExtent.xMaximum() ),
qgsDoubleToString( mLayerExtent.yMaximum() ) )
.arg( mLayerExtent.width() )
.arg( mLayerExtent.height() )
);
QgsDebugMsgLevel( QStringLiteral( "layer extent: %1,%2,%3,%4 %5x%6" )
.arg( qgsDoubleToString( mLayerExtent.xMinimum() ),
qgsDoubleToString( mLayerExtent.yMinimum() ) )
.arg( qgsDoubleToString( mLayerExtent.xMaximum() ),
qgsDoubleToString( mLayerExtent.yMaximum() ) )
.arg( mLayerExtent.width() )
.arg( mLayerExtent.height() ), 3
);

QgsDebugMsg( QStringLiteral( "view extent: %1,%2,%3,%4 %5x%6 res:%7" )
.arg( qgsDoubleToString( viewExtent.xMinimum() ),
qgsDoubleToString( viewExtent.yMinimum() ) )
.arg( qgsDoubleToString( viewExtent.xMaximum() ),
qgsDoubleToString( viewExtent.yMaximum() ) )
.arg( viewExtent.width() )
.arg( viewExtent.height() )
.arg( vres, 0, 'f' )
);
QgsDebugMsgLevel( QStringLiteral( "view extent: %1,%2,%3,%4 %5x%6 res:%7" )
.arg( qgsDoubleToString( viewExtent.xMinimum() ),
qgsDoubleToString( viewExtent.yMinimum() ) )
.arg( qgsDoubleToString( viewExtent.xMaximum() ),
qgsDoubleToString( viewExtent.yMaximum() ) )
.arg( viewExtent.width() )
.arg( viewExtent.height() )
.arg( vres, 0, 'f' ), 3
);

QgsDebugMsgLevel( QStringLiteral( "tile matrix %1,%2 res:%3 tilesize:%4x%5 matrixsize:%6x%7 id:%8" )
.arg( tm->topLeft.x() ).arg( tm->topLeft.y() ).arg( tm->tres )
Expand Down

0 comments on commit f6aa330

Please sign in to comment.