GrResourceCache2 manages scratch texture.

BUG=skia:2889

Review URL: https://codereview.chromium.org/608883003
diff --git a/include/gpu/GrGpuResourceRef.h b/include/gpu/GrGpuResourceRef.h
index 3320dc0..0223f18 100644
--- a/include/gpu/GrGpuResourceRef.h
+++ b/include/gpu/GrGpuResourceRef.h
@@ -52,11 +52,11 @@
 
     /** Adopts a ref from the caller. ioType expresses what type of IO operations will be marked as
         pending on the resource when markPendingIO is called. */
-    GrGpuResourceRef(GrGpuResource*, GrIORef::IOType);
+    GrGpuResourceRef(GrGpuResource*, GrIOType);
 
     /** Adopts a ref from the caller. ioType expresses what type of IO operations will be marked as
         pending on the resource when markPendingIO is called. */
-    void setResource(GrGpuResource*, GrIORef::IOType);
+    void setResource(GrGpuResource*, GrIOType);
 
 private:
     /** Called by owning GrProgramElement when the program element is first scheduled for
@@ -79,10 +79,10 @@
     friend class GrOptDrawState;
     friend class GrProgramElement;
 
-    GrGpuResource*      fResource;
-    mutable bool        fOwnRef;
-    mutable bool        fPendingIO;
-    GrIORef::IOType     fIOType;
+    GrGpuResource*  fResource;
+    mutable bool    fOwnRef;
+    mutable bool    fPendingIO;
+    GrIOType        fIOType;
 
     typedef SkNoncopyable INHERITED;
 };
@@ -96,13 +96,13 @@
 
     /** Adopts a ref from the caller. ioType expresses what type of IO operations will be marked as
         pending on the resource when markPendingIO is called. */
-    GrTGpuResourceRef(T* resource, GrIORef::IOType ioType) : INHERITED(resource, ioType) {}
+    GrTGpuResourceRef(T* resource, GrIOType ioType) : INHERITED(resource, ioType) {}
 
     T* get() const { return static_cast<T*>(this->getResource()); }
 
     /** Adopts a ref from the caller. ioType expresses what type of IO operations will be marked as
         pending on the resource when markPendingIO is called. */
-    void set(T* resource, GrIORef::IOType ioType) { this->setResource(resource, ioType); }
+    void set(T* resource, GrIOType ioType) { this->setResource(resource, ioType); }
 
 private:
     typedef GrGpuResourceRef INHERITED;
@@ -112,18 +112,18 @@
  * This is similar to GrTGpuResourceRef but can only be in the pending IO state. It never owns a
  * ref.
  */
-template <typename T, GrIORef::IOType IO_TYPE> class GrPendingIOResource : SkNoncopyable {
+template <typename T, GrIOType IO_TYPE> class GrPendingIOResource : SkNoncopyable {
 public:
     GrPendingIOResource(T* resource) : fResource(resource) {
         if (NULL != fResource) {
             switch (IO_TYPE) {
-                case GrIORef::kRead_IOType:
+                case kRead_GrIOType:
                     fResource->addPendingRead();
                     break;
-                case GrIORef::kWrite_IOType:
+                case kWrite_GrIOType:
                     fResource->addPendingWrite();
                     break;
-                case GrIORef::kRW_IOType:
+                case kRW_GrIOType:
                     fResource->addPendingRead();
                     fResource->addPendingWrite();
                     break;
@@ -134,13 +134,13 @@
     ~GrPendingIOResource() {
         if (NULL != fResource) {
             switch (IO_TYPE) {
-                case GrIORef::kRead_IOType:
+                case kRead_GrIOType:
                     fResource->completedRead();
                     break;
-                case GrIORef::kWrite_IOType:
+                case kWrite_GrIOType:
                     fResource->completedWrite();
                     break;
-                case GrIORef::kRW_IOType:
+                case kRW_GrIOType:
                     fResource->completedRead();
                     fResource->completedWrite();
                     break;
@@ -151,6 +151,6 @@
     T* get() const { return fResource; }
 
 private:
-    T*      fResource;
+    T* fResource;
 };
 #endif