skia2/include/atlastext/SkAtlasTextContext.h
Brian Salomon cbcb0a12ad Revert "Revert "Add Atlas Text interface for rendering SDF glyphs.""
This reverts commit 9c2202ffc2.

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>
2017-11-19 18:55:18 +00:00

43 lines
1.2 KiB
C++

/*
* 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