[Android WebView] Put AndroidStreamReaderURLRequestJob into a namespace
[chromium-blink-merge.git] / ui / gfx / font_render_params.cc
bloba434379ee109477948a9b5d536f95453d8a91340
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ui/gfx/font_render_params.h"
7 #include "base/logging.h"
9 namespace gfx {
11 FontRenderParams::FontRenderParams()
12 : antialiasing(true),
13 subpixel_positioning(true),
14 autohinter(false),
15 use_bitmaps(false),
16 hinting(HINTING_MEDIUM),
17 subpixel_rendering(SUBPIXEL_RENDERING_NONE) {
20 FontRenderParams::~FontRenderParams() {}
22 // static
23 SkFontHost::LCDOrder FontRenderParams::SubpixelRenderingToSkiaLCDOrder(
24 FontRenderParams::SubpixelRendering subpixel_rendering) {
25 switch (subpixel_rendering) {
26 case gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE:
27 case gfx::FontRenderParams::SUBPIXEL_RENDERING_RGB:
28 case gfx::FontRenderParams::SUBPIXEL_RENDERING_VRGB:
29 return SkFontHost::kRGB_LCDOrder;
30 case gfx::FontRenderParams::SUBPIXEL_RENDERING_BGR:
31 case gfx::FontRenderParams::SUBPIXEL_RENDERING_VBGR:
32 return SkFontHost::kBGR_LCDOrder;
35 NOTREACHED();
36 return SkFontHost::kRGB_LCDOrder;
39 // static
40 SkFontHost::LCDOrientation
41 FontRenderParams::SubpixelRenderingToSkiaLCDOrientation(
42 FontRenderParams::SubpixelRendering subpixel_rendering) {
43 switch (subpixel_rendering) {
44 case gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE:
45 case gfx::FontRenderParams::SUBPIXEL_RENDERING_RGB:
46 case gfx::FontRenderParams::SUBPIXEL_RENDERING_BGR:
47 return SkFontHost::kHorizontal_LCDOrientation;
48 case gfx::FontRenderParams::SUBPIXEL_RENDERING_VRGB:
49 case gfx::FontRenderParams::SUBPIXEL_RENDERING_VBGR:
50 return SkFontHost::kVertical_LCDOrientation;
53 NOTREACHED();
54 return SkFontHost::kHorizontal_LCDOrientation;
57 FontRenderParamsQuery::FontRenderParamsQuery()
58 : pixel_size(0),
59 point_size(0),
60 style(-1),
61 device_scale_factor(0) {
64 FontRenderParamsQuery::~FontRenderParamsQuery() {}
66 } // namespace gfx