Skip to content
Permalink
Browse files

Make QgsMapRendererCache protected members private

This class isn't designed to be subclassed
  • Loading branch information
nyalldawson committed Feb 1, 2017
1 parent 54d8d11 commit d74fbff0aa797556b9d6d7c1e0db3cad8f837cfa
Showing with 14 additions and 35 deletions.
  1. +5 −0 doc/api_break.dox
  2. +0 −25 python/core/qgsmaprenderercache.sip
  3. +9 −10 src/core/qgsmaprenderercache.h
@@ -1335,6 +1335,11 @@ be returned instead of a null pointer if no transformation is required.
- destinationSrsChanged() was renamed to destinationCrsChanged()
- getCompositionMode(), getBlendModeEnum() and BlendMode enum have been moved to QgsPainting utility class.

QgsMapRendererCache {#qgis_api_break_3_0_QgsMapRendererCache}
-------------------

- All protected members have been made private. This class is not designed to be subclassed.


QgsMapRendererJob {#qgis_api_break_3_0_QgsMapRendererJob}
-----------------
@@ -1,15 +1,3 @@

/**
* This class is responsible for keeping cache of rendered images of individual layers.
*
* Once a layer has rendered image stored in the cache (using setCacheImage(...)),
* the cache listens to repaintRequested() signals from layer. If triggered, the cache
* removes the rendered image (and disconnects from the layer).
*
* The class is thread-safe (multiple classes can access the same instance safely).
*
* @note added in 2.4
*/
class QgsMapRendererCache : QObject
{
%TypeHeaderCode
@@ -20,27 +8,14 @@ class QgsMapRendererCache : QObject

QgsMapRendererCache();

//! invalidate the cache contents
void clear();

//! initialize cache: set new parameters and erase cache if parameters have changed
//! @return flag whether the parameters are the same as last time
bool init( const QgsRectangle& extent, double scale );

//! set cached image for the specified layer ID
void setCacheImage( const QString& layerId, const QImage& img );

//! get cached image for the specified layer ID. Returns null image if it is not cached.
QImage cacheImage( const QString& layerId );

//! remove layer from the cache
void clearCacheImage( const QString& layerId );

protected slots:
//! remove layer (that emitted the signal) from the cache
void layerRequestedRepaint();

protected:
//! invalidate cache contents (without locking)
void clearInternal();
};
@@ -42,31 +42,30 @@ class CORE_EXPORT QgsMapRendererCache : public QObject

QgsMapRendererCache();

//! invalidate the cache contents
//! Invalidate the cache contents
void clear();

//! initialize cache: set new parameters and erase cache if parameters have changed
//! Initialize cache: set new parameters and erase cache if parameters have changed
//! @return flag whether the parameters are the same as last time
bool init( const QgsRectangle& extent, double scale );

//! set cached image for the specified layer ID
//! Set the cached image for the specified layer ID
void setCacheImage( const QString& layerId, const QImage& img );

//! get cached image for the specified layer ID. Returns null image if it is not cached.
//! Returns the cached image for the specified layer ID. Returns null image if it is not cached.
QImage cacheImage( const QString& layerId );

//! remove layer from the cache
//! Removes a layer from the cache
void clearCacheImage( const QString& layerId );

protected slots:
//! remove layer (that emitted the signal) from the cache
private slots:
//! Remove layer (that emitted the signal) from the cache
void layerRequestedRepaint();

protected:
//! invalidate cache contents (without locking)
private:
//! Invalidate cache contents (without locking)
void clearInternal();

protected:
QMutex mMutex;
QgsRectangle mExtent;
double mScale;

0 comments on commit d74fbff

Please sign in to comment.
You can’t perform that action at this time.