chromium/ui/gfx/font_render_params_linux.cc

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

#include "ui/gfx/font_render_params.h"

#include <fontconfig/fontconfig.h>
#include <stddef.h>
#include <stdint.h>

#include <memory>

#include "base/command_line.h"
#include "base/containers/lru_cache.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/synchronization/lock.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "ui/gfx/font.h"
#include "ui/gfx/font_render_params_linux.h"
#include "ui/gfx/linux/fontconfig_util.h"
#include "ui/gfx/switches.h"

#if BUILDFLAG(IS_LINUX)
#include "ui/linux/linux_ui.h"
#endif

namespace gfx {

namespace {

int FontWeightToFCWeight(Font::Weight weight) {}

// A device scale factor used to determine if subpixel positioning
// should be used.
float device_scale_factor_ =;

// Number of recent GetFontRenderParams() results to cache.
const size_t kCacheSize =;

// Cached result from a call to GetFontRenderParams().
struct QueryResult {};

// Keyed by hashes of FontRenderParamQuery structs from
// HashFontRenderParamsQuery().
Cache;

// A cache and the lock that must be held while accessing it.
// GetFontRenderParams() is called by both the UI thread and the sandbox IPC
// thread.
struct SynchronizedCache {};

base::LazyInstance<SynchronizedCache>::Leaky g_synchronized_cache =;

// Serialize |query| into a string value suitable for use as a cache key.
std::string GetFontRenderParamsQueryKey(const FontRenderParamsQuery& query) {}

}  // namespace

bool QueryFontconfig(const FontRenderParamsQuery& query,
                     FontRenderParams* params_out,
                     std::string* family_out) {}

FontRenderParams GetFontRenderParams(const FontRenderParamsQuery& query,
                                     std::string* family_out) {}

void ClearFontRenderParamsCacheForTest() {}

float GetFontRenderParamsDeviceScaleFactor() {}

void SetFontRenderParamsDeviceScaleFactor(float device_scale_factor) {}

}  // namespace gfx