Move DistanceAdjustTable to its own file
BUG=skia:
Review URL: https://codereview.chromium.org/1512823004
diff --git a/src/gpu/GrDistanceFieldAdjustTable.h b/src/gpu/GrDistanceFieldAdjustTable.h
new file mode 100644
index 0000000..f7d8bee
--- /dev/null
+++ b/src/gpu/GrDistanceFieldAdjustTable.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrDistanceFieldAdjustTable_DEFINED
+#define GrDistanceFieldAdjustTable_DEFINED
+
+#include "SkRefCnt.h"
+#include "SkScalar.h"
+
+// Distance field text needs this table to compute a value for use in the fragment shader.
+// Because the GrAtlasTextContext can go out of scope before the final flush, this needs to be
+// refcnted and malloced
+struct GrDistanceFieldAdjustTable : public SkNVRefCnt<GrDistanceFieldAdjustTable> {
+ GrDistanceFieldAdjustTable() { this->buildDistanceAdjustTable(); }
+ ~GrDistanceFieldAdjustTable() { delete[] fTable; }
+
+ const SkScalar& operator[] (int i) const {
+ return fTable[i];
+ }
+
+private:
+ void buildDistanceAdjustTable();
+
+ SkScalar* fTable;
+};
+
+#endif