blob: a434379ee109477948a9b5d536f95453d8a91340 (
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
// Copyright 2014 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 "ui/gfx/font_render_params.h"
#include "base/logging.h"
namespace gfx {
FontRenderParams::FontRenderParams()
: antialiasing(true),
subpixel_positioning(true),
autohinter(false),
use_bitmaps(false),
hinting(HINTING_MEDIUM),
subpixel_rendering(SUBPIXEL_RENDERING_NONE) {
}
FontRenderParams::~FontRenderParams() {}
// static
SkFontHost::LCDOrder FontRenderParams::SubpixelRenderingToSkiaLCDOrder(
FontRenderParams::SubpixelRendering subpixel_rendering) {
switch (subpixel_rendering) {
case gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE:
case gfx::FontRenderParams::SUBPIXEL_RENDERING_RGB:
case gfx::FontRenderParams::SUBPIXEL_RENDERING_VRGB:
return SkFontHost::kRGB_LCDOrder;
case gfx::FontRenderParams::SUBPIXEL_RENDERING_BGR:
case gfx::FontRenderParams::SUBPIXEL_RENDERING_VBGR:
return SkFontHost::kBGR_LCDOrder;
}
NOTREACHED();
return SkFontHost::kRGB_LCDOrder;
}
// static
SkFontHost::LCDOrientation
FontRenderParams::SubpixelRenderingToSkiaLCDOrientation(
FontRenderParams::SubpixelRendering subpixel_rendering) {
switch (subpixel_rendering) {
case gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE:
case gfx::FontRenderParams::SUBPIXEL_RENDERING_RGB:
case gfx::FontRenderParams::SUBPIXEL_RENDERING_BGR:
return SkFontHost::kHorizontal_LCDOrientation;
case gfx::FontRenderParams::SUBPIXEL_RENDERING_VRGB:
case gfx::FontRenderParams::SUBPIXEL_RENDERING_VBGR:
return SkFontHost::kVertical_LCDOrientation;
}
NOTREACHED();
return SkFontHost::kHorizontal_LCDOrientation;
}
FontRenderParamsQuery::FontRenderParamsQuery()
: pixel_size(0),
point_size(0),
style(-1),
device_scale_factor(0) {
}
FontRenderParamsQuery::~FontRenderParamsQuery() {}
} // namespace gfx
|