Index: src/gpu/GrLayerAtlas.h |
diff --git a/src/gpu/GrLayerAtlas.h b/src/gpu/GrLayerAtlas.h |
index ae08e4527ba6738cba02b2a73986028d2a3d832d..e84667b5ea02cec6b8ca4e2cb9b75c84a896da24 100644 |
--- a/src/gpu/GrLayerAtlas.h |
+++ b/src/gpu/GrLayerAtlas.h |
@@ -9,15 +9,13 @@ |
#ifndef GrLayerAtlas_DEFINED |
#define GrLayerAtlas_DEFINED |
-#include "GrTypes.h" |
+#include "GrTexture.h" |
#include "SkPoint.h" |
-#include "SkSize.h" |
#include "SkTDArray.h" |
#include "SkTInternalLList.h" |
class GrLayerAtlas; |
-class GrTexture; |
class GrTextureProvider; |
class GrRectanizer; |
@@ -109,10 +107,23 @@ public: |
// nullptr is returned if there is no more space in the atlas. |
Plot* addToAtlas(ClientPlotUsage*, int width, int height, SkIPoint16* loc); |
+ GrTexture* getTextureOrNull() const { |
+ return fTexture; |
+ } |
+ |
GrTexture* getTexture() const { |
+ SkASSERT(fTexture); |
return fTexture; |
} |
+ bool reattachBackingTexture(); |
+ |
+ void detachBackingTexture() { |
+ fTexture.reset(nullptr); |
+ } |
+ |
+ void resetPlots(); |
+ |
enum IterOrder { |
kLRUFirst_IterOrder, |
kMRUFirst_IterOrder |
@@ -127,12 +138,14 @@ public: |
} |
private: |
+ void createBackingTexture(); |
+ |
void makeMRU(Plot* plot); |
GrTextureProvider* fTexProvider; |
GrPixelConfig fPixelConfig; |
GrSurfaceFlags fFlags; |
- GrTexture* fTexture; |
+ SkAutoTUnref<GrTexture> fTexture; |
SkISize fBackingTextureSize; |