chromium/components/paint_preview/common/glyph_usage.h

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_PAINT_PREVIEW_COMMON_GLYPH_USAGE_H_
#define COMPONENTS_PAINT_PREVIEW_COMMON_GLYPH_USAGE_H_

#include <stdint.h>

#include <vector>

#include "base/containers/flat_set.h"
#include "base/functional/callback_forward.h"

namespace paint_preview {

// Base class for tracking glyph usage.
class GlyphUsage {};

// An implementation of GlyphUsage that works well for densely set glyphs.
// Usecases:
// - Primary language
// - Pre-subsetted fonts
class DenseGlyphUsage : public GlyphUsage {};

// An implementation of GlyphUsage that works well for sparsely set glyphs.
// Usecases:
// - Non-subsetted CJK fonts
// - Emoji
// - Large glyph counts fonts with low glyph usage
// - Non-primary language
class SparseGlyphUsage : public GlyphUsage {};

}  // namespace paint_preview

#endif  // COMPONENTS_PAINT_PREVIEW_COMMON_GLYPH_USAGE_H_