Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Unified Diff: src/gpu/GrLayerAtlas.h

Issue 1406013006: Update Layer Hoisting to store its atlas texture in the resource cache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix Android bug Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkMultiPictureDraw.cpp ('k') | src/gpu/GrLayerAtlas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/core/SkMultiPictureDraw.cpp ('k') | src/gpu/GrLayerAtlas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698