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/src/gpu/GrTextureAccess.cpp b/src/gpu/GrTextureAccess.cpp
new file mode 100644
index 0000000..155f682
--- /dev/null
+++ b/src/gpu/GrTextureAccess.cpp
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2012 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "GrTextureAccess.h"
+#include "SkString.h"
+
+GrTextureAccess::GrTextureAccess(const GrTexture* texture, const SkString& swizzle)
+ : fTexture(texture) {
+ GrAssert(swizzle.size() <= 4);
+ for (unsigned int offset = 0; offset < swizzle.size(); ++offset) {
+ fSwizzle[offset] = swizzle[offset];
+ }
+ if (swizzle.size() < 4) {
+ fSwizzle[swizzle.size()] = 0;
+ }
+}
+