Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / src / gpu / GrResourceCache.h
index 1a81fe6..235b11a 100644 (file)
 
 #include "GrConfig.h"
 #include "GrTypes.h"
-#include "GrTMultiMap.h"
+#include "SkTMultiMap.h"
 #include "GrBinHashKey.h"
 #include "SkMessageBus.h"
 #include "SkTInternalLList.h"
 
-class GrCacheable;
+class GrGpuResource;
 class GrResourceCache;
 class GrResourceCacheEntry;
 
@@ -29,11 +29,11 @@ public:
         return gDomain;
     }
 
-    /** Uniquely identifies the GrCacheable subclass in the key to avoid collisions
+    /** Uniquely identifies the GrGpuResource subclass in the key to avoid collisions
         across resource types. */
     typedef uint8_t ResourceType;
 
-    /** Flags set by the GrCacheable subclass. */
+    /** Flags set by the GrGpuResource subclass. */
     typedef uint8_t ResourceFlags;
 
     /** Generate a unique ResourceType */
@@ -118,7 +118,7 @@ struct GrResourceInvalidatedMessage {
 
 class GrResourceCacheEntry {
 public:
-    GrCacheable* resource() const { return fResource; }
+    GrGpuResource* resource() const { return fResource; }
     const GrResourceKey& key() const { return fKey; }
 
     static const GrResourceKey& GetKey(const GrResourceCacheEntry& e) { return e.key(); }
@@ -131,7 +131,7 @@ public:
 
     /**
      *  Update the cached size for this entry and inform the resource cache that
-     *  it has changed. Usually invoked from GrCacheable::didChangeGpuMemorySize,
+     *  it has changed. Usually invoked from GrGpuResource::didChangeGpuMemorySize,
      *  not directly from here.
      */
     void didChangeResourceSize();
@@ -139,12 +139,12 @@ public:
 private:
     GrResourceCacheEntry(GrResourceCache* resourceCache,
                          const GrResourceKey& key,
-                         GrCacheable* resource);
+                         GrGpuResource* resource);
     ~GrResourceCacheEntry();
 
     GrResourceCache* fResourceCache;
     GrResourceKey    fKey;
-    GrCacheable*     fResource;
+    GrGpuResource*   fResource;
     size_t           fCachedSize;
     bool             fIsExclusive;
 
@@ -157,7 +157,7 @@ private:
 ///////////////////////////////////////////////////////////////////////////////
 
 /**
- *  Cache of GrCacheable objects.
+ *  Cache of GrGpuResource objects.
  *
  *  These have a corresponding GrResourceKey, built from 128bits identifying the
  *  resource. Multiple resources can map to same GrResourceKey.
@@ -170,7 +170,7 @@ private:
  *  For fast searches, we maintain a hash map based on the GrResourceKey.
  *
  *  It is a goal to make the GrResourceCache the central repository and bookkeeper
- *  of all resources. It should replace the linked list of GrGpuObjects that
+ *  of all resources. It should replace the linked list of GrGpuResources that
  *  GrGpu uses to call abandon/release.
  */
 class GrResourceCache {
@@ -246,8 +246,8 @@ public:
      *  For a resource to be completely exclusive to a caller both kNoOtherOwners
      *  and kHide must be specified.
      */
-    GrCacheable* find(const GrResourceKey& key,
-                      uint32_t ownershipFlags = 0);
+    GrGpuResource* find(const GrResourceKey& key,
+                        uint32_t ownershipFlags = 0);
 
     /**
      *  Add the new resource to the cache (by creating a new cache entry based
@@ -261,7 +261,7 @@ public:
      *  is called.
      */
     void addResource(const GrResourceKey& key,
-                     GrCacheable* resource,
+                     GrGpuResource* resource,
                      uint32_t ownershipFlags = 0);
 
     /**
@@ -334,7 +334,7 @@ private:
 
     void removeInvalidResource(GrResourceCacheEntry* entry);
 
-    GrTMultiMap<GrResourceCacheEntry, GrResourceKey> fCache;
+    SkTMultiMap<GrResourceCacheEntry, GrResourceKey> fCache;
 
     // We're an internal doubly linked list
     typedef SkTInternalLList<GrResourceCacheEntry> EntryList;