summaryrefslogtreecommitdiffstats
path: root/skia/ext/skia_sandbox_support_win.cc
blob: 13efb80fdb9fcbc127681a57740b97604cc56c9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "skia_sandbox_support_win.h"
#include "SkFontHost.h"
#include "SkTypeface_win.h"

static SkiaEnsureTypefaceAccessible g_skia_ensure_typeface_accessible = NULL;

SK_API void SetSkiaEnsureTypefaceAccessible(SkiaEnsureTypefaceAccessible func) {
  // This function is supposed to be called once in process life time.
  SkASSERT(g_skia_ensure_typeface_accessible == NULL);
  g_skia_ensure_typeface_accessible = func;
}

// static
void SkFontHost::EnsureTypefaceAccessible(const SkTypeface& typeface) {
  if (g_skia_ensure_typeface_accessible) {
    LOGFONT lf;
    SkLOGFONTFromTypeface(&typeface, &lf);
    g_skia_ensure_typeface_accessible(lf);
  }
}