chromium/third_party/skia/modules/skshaper/include/SkShaper.h

/*
 * Copyright 2016 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkShaper_DEFINED
#define SkShaper_DEFINED

#include "include/core/SkFont.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkScalar.h"
#include "include/core/SkString.h"
#include "include/core/SkTextBlob.h"
#include "include/core/SkTypes.h"

#include <cstddef>
#include <cstdint>
#include <memory>
#include <type_traits>

class SkFontStyle;

#if defined(SK_DISABLE_LEGACY_SKSHAPER_FUNCTIONS)
class SkFontMgr;
#else
#include "include/core/SkFontMgr.h"
#endif

#if !defined(SKSHAPER_IMPLEMENTATION)
    #define SKSHAPER_IMPLEMENTATION
#endif

#if !defined(SKSHAPER_API)
    #if defined(SKSHAPER_DLL)
        #if defined(_MSC_VER)
            #if SKSHAPER_IMPLEMENTATION
                #define SKSHAPER_API
            #else
                #define SKSHAPER_API
            #endif
        #else
            #define SKSHAPER_API
        #endif
    #else
        #define SKSHAPER_API
    #endif
#endif

class SKSHAPER_API SkShaper {};

/**
 * Helper for shaping text directly into a SkTextBlob.
 */
class SKSHAPER_API SkTextBlobBuilderRunHandler final : public SkShaper::RunHandler {};

namespace SkShapers::Primitive {
SKSHAPER_API std::unique_ptr<SkShaper> PrimitiveText();

SKSHAPER_API std::unique_ptr<SkShaper::BiDiRunIterator> TrivialBiDiRunIterator
                                              (size_t utf8Bytes,  uint8_t bidiLevel);
SKSHAPER_API std::unique_ptr<SkShaper::ScriptRunIterator> TrivialScriptRunIterator
                                              (size_t utf8Bytes, SkFourByteTag scriptTag);
}  // namespace SkShapers

#endif  // SkShaper_DEFINED