[Cronet] Delay StartNetLog and StopNetLog until native request context is initialized
[chromium-blink-merge.git] / ui / gfx / font_render_params.cc
blob44c6bcf123715eaacd131387f20d52143267934d
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(bool for_web_contents)
58 : for_web_contents(for_web_contents),
59 pixel_size(0),
60 point_size(0),
61 style(-1),
62 device_scale_factor(0) {
65 FontRenderParamsQuery::~FontRenderParamsQuery() {}
67 } // namespace gfx