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

Unified Diff: include/gpu/GrTextureAccess.h

Issue 542723004: Make GrDrawState and GrEffectStage use the pending io/exec ref mechanisms. (Closed) Base URL: https://skia.googlesource.com/skia.git@complete
Patch Set: rebase again Created 6 years, 3 months 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 | « include/gpu/GrProgramElementRef.h ('k') | src/gpu/GrDrawState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrTextureAccess.h
diff --git a/include/gpu/GrTextureAccess.h b/include/gpu/GrTextureAccess.h
index 9f56171c60a2b143e5af049ecfa03d60b9038bbe..3d44d9e44f1f084928da2a5f3bb21741759df09d 100644
--- a/include/gpu/GrTextureAccess.h
+++ b/include/gpu/GrTextureAccess.h
@@ -10,7 +10,7 @@
#include "SkRefCnt.h"
#include "SkShader.h"
-#include "SkTypes.h"
+#include "GrProgramResource.h"
class GrTexture;
@@ -112,8 +112,10 @@ private:
* key. However, if a GrEffect uses different swizzles based on its input then it must
* consider that variation in its key-generation.
*/
-class GrTextureAccess : SkNoncopyable {
+class GrTextureAccess : public SkNoncopyable {
public:
+ SK_DECLARE_INST_COUNT_ROOT(GrTextureAccess);
+
/**
* A default GrTextureAccess must have reset() called on it in a GrEffect subclass's
* constructor if it will be accessible via GrEffect::textureAccess().
@@ -155,13 +157,18 @@ public:
strcmp(fSwizzle, other.fSwizzle));
#endif
return fParams == other.fParams &&
- (fTexture.get() == other.fTexture.get()) &&
+ (this->getTexture() == other.getTexture()) &&
(0 == memcmp(fSwizzle, other.fSwizzle, sizeof(fSwizzle)-1));
}
bool operator!= (const GrTextureAccess& other) const { return !(*this == other); }
- GrTexture* getTexture() const { return fTexture.get(); }
+ GrTexture* getTexture() const { return (GrTexture*)fTexture.getResource(); }
+
+ /**
+ * For internal use by GrEffect.
+ */
+ const GrProgramResource* getTextureProgramResource() const { return &fTexture; }
/**
* Returns a string representing the swizzle. The string is is null-terminated.
@@ -177,10 +184,10 @@ public:
private:
void setSwizzle(const char*);
- GrTextureParams fParams;
- SkAutoTUnref<GrTexture> fTexture;
- uint32_t fSwizzleMask;
- char fSwizzle[5];
+ GrProgramResource fTexture;
+ GrTextureParams fParams;
+ uint32_t fSwizzleMask;
+ char fSwizzle[5];
typedef SkNoncopyable INHERITED;
};
« no previous file with comments | « include/gpu/GrProgramElementRef.h ('k') | src/gpu/GrDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698