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/GrTypes.h

Issue 858123002: Add specialized content key class for resources. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove default template arg Created 5 years, 11 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/GrTexture.h ('k') | include/gpu/SkGr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrTypes.h
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index c4e374fdf2b710f0f15dc8cc1eb81f0ad7341ba8..f4fb3ab43f3acb30f1ecbb8b2b2174bc6ed224fb 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -473,58 +473,6 @@ struct GrSurfaceDesc {
typedef GrSurfaceDesc GrTextureDesc;
/**
- * GrCacheID is used create and find cached GrResources (e.g. GrTextures). The ID has two parts:
- * the domain and the key. Domains simply allow multiple clients to use 0-based indices as their
- * cache key without colliding. The key uniquely identifies a GrResource within the domain.
- * Users of the cache must obtain a domain via GenerateDomain().
- */
-struct GrCacheID {
-public:
- typedef uint8_t Domain;
-
- struct Key {
- union {
- uint8_t fData8[16];
- uint32_t fData32[4];
- uint64_t fData64[2];
- };
- };
-
- /**
- * A default cache ID is invalid; a set method must be called before the object is used.
- */
- GrCacheID() { fDomain = kInvalid_Domain; }
-
- /**
- * Initialize the cache ID to a domain and key.
- */
- GrCacheID(Domain domain, const Key& key) {
- SkASSERT(kInvalid_Domain != domain);
- this->reset(domain, key);
- }
-
- void reset(Domain domain, const Key& key) {
- fDomain = domain;
- memcpy(&fKey, &key, sizeof(Key));
- }
-
- /** Has this been initialized to a valid domain */
- bool isValid() const { return kInvalid_Domain != fDomain; }
-
- const Key& getKey() const { SkASSERT(this->isValid()); return fKey; }
- Domain getDomain() const { SkASSERT(this->isValid()); return fDomain; }
-
- /** Creates a new unique ID domain. */
- static Domain GenerateDomain();
-
-private:
- Key fKey;
- Domain fDomain;
-
- static const Domain kInvalid_Domain = 0;
-};
-
-/**
* Clips are composed from these objects.
*/
enum GrClipType {
« no previous file with comments | « include/gpu/GrTexture.h ('k') | include/gpu/SkGr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698