Revert "Revert "Add Atlas Text interface for rendering SDF glyphs.""

This reverts commit 9c2202ffc22b4293b48a4edeafa1b5d2bab8bb83.

Bug: skia:
Change-Id: I482ddf74f8e40d3d0908c840ba5c6ff981ccefbd
Reviewed-on: https://skia-review.googlesource.com/73345
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/include/atlastext/SkAtlasTextContext.h b/include/atlastext/SkAtlasTextContext.h
new file mode 100644
index 0000000..bb5de52
--- /dev/null
+++ b/include/atlastext/SkAtlasTextContext.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2017 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkAtlasTextContext_DEFINED
+#define SkAtlasTextContext_DEFINED
+
+#include "SkRefCnt.h"
+
+class SkAtlasTextRenderer;
+class SkInternalAtlasTextContext;
+
+SkAtlasTextRenderer* SkGetAtlasTextRendererFromInternalContext(class SkInternalAtlasTextContext&);
+
+/**
+ * Class that Atlas Text client uses to register their SkAtlasTextRenderer implementation and
+ * to create one or more SkAtlasTextTargets (destination surfaces for text rendering).
+ */
+class SK_API SkAtlasTextContext : public SkRefCnt {
+public:
+    static sk_sp<SkAtlasTextContext> Make(sk_sp<SkAtlasTextRenderer>);
+
+    SkAtlasTextRenderer* renderer() const {
+        return SkGetAtlasTextRendererFromInternalContext(*fInternalContext);
+    }
+
+    SkInternalAtlasTextContext& internal() { return *fInternalContext; }
+
+private:
+    SkAtlasTextContext() = delete;
+    SkAtlasTextContext(const SkAtlasTextContext&) = delete;
+    SkAtlasTextContext& operator=(const SkAtlasTextContext&) = delete;
+
+    SkAtlasTextContext(sk_sp<SkAtlasTextRenderer>);
+
+    std::unique_ptr<SkInternalAtlasTextContext> fInternalContext;
+};
+
+#endif