Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / src / gpu / GrResourceCache2.h
index e05efd7..a365a5a 100644 (file)
@@ -24,23 +24,29 @@ public:
     GrResourceCache2() : fCount(0) {};
     ~GrResourceCache2();
 
-    void insertResource(GrGpuResource* resource);
+    void insertResource(GrGpuResource*);
 
-    void removeResource(GrGpuResource* resource);
+    void removeResource(GrGpuResource*);
 
     void abandonAll();
 
     void releaseAll();
 
+    enum {
+        /** Preferentially returns scratch resources with no pending IO. */
+        kPreferNoPendingIO_ScratchFlag = 0x1,
+        /** Will not return any resources that match but have pending IO. */
+        kRequireNoPendingIO_ScratchFlag = 0x2,
+    };
+    GrGpuResource* findAndRefScratchResource(const GrResourceKey& scratchKey, uint32_t flags = 0);
+
 private:
 #ifdef SK_DEBUG
-    bool isInCache(const GrGpuResource* r) const {
-        return fResources.isInList(r);
-    }
+    bool isInCache(const GrGpuResource* r) const { return fResources.isInList(r); }
 #endif
 
+    class AvailableForScratchUse;
 
-    void removeScratch(const GrGpuResource* resource);
     struct ScratchMapTraits {
         static const GrResourceKey& GetKey(const GrGpuResource& r) {
             return r.getScratchKey();