Move GrTextureAccess decl/defn to separate files

Review URL: https://codereview.appspot.com/6500104/



git-svn-id: http://skia.googlecode.com/svn/trunk@5482 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/gpu/GrTextureAccess.h b/include/gpu/GrTextureAccess.h
new file mode 100644
index 0000000..55c0a02
--- /dev/null
+++ b/include/gpu/GrTextureAccess.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2012 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrTextureAccess_DEFINED
+#define GrTextureAccess_DEFINED
+
+#include "GrTypes.h"
+
+class GrTexture;
+class SkString;
+
+/** A class representing the swizzle access pattern for a texture.
+ */
+class GrTextureAccess {
+public:
+    typedef char Swizzle[4];
+
+    GrTextureAccess(const GrTexture* texture, const SkString& swizzle);
+
+    const GrTexture* getTexture() const { return fTexture; }
+    const Swizzle& getSwizzle() const { return fSwizzle; }
+
+    bool referencesAlpha() const {
+        return fSwizzle[0] == 'a' || fSwizzle[1] == 'a' || fSwizzle[2] == 'a' || fSwizzle[3] == 'a';
+    }
+
+private:
+    const GrTexture* fTexture;
+    Swizzle fSwizzle;
+};
+
+#endif