| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/gfx/font_render_params_linux.h" | 5 #include "ui/gfx/font_render_params.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "ui/gfx/switches.h" | 9 #include "ui/gfx/switches.h" |
| 10 | 10 |
| 11 #include <fontconfig/fontconfig.h> | 11 #include <fontconfig/fontconfig.h> |
| 12 | 12 |
| 13 #if defined(OS_LINUX) && defined(USE_AURA) && !defined(OS_CHROMEOS) | 13 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 14 #include "ui/gfx/linux_font_delegate.h" | 14 #include "ui/gfx/linux_font_delegate.h" |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 namespace gfx { | 17 namespace gfx { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 bool SubpixelPositioningRequested(bool renderer) { | 21 bool SubpixelPositioningRequested(bool renderer) { |
| 22 return CommandLine::ForCurrentProcess()->HasSwitch( | 22 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 23 renderer ? switches::kEnableWebkitTextSubpixelPositioning | 23 renderer ? switches::kEnableWebkitTextSubpixelPositioning |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 case FC_RGBA_VRGB: | 55 case FC_RGBA_VRGB: |
| 56 params->subpixel_rendering = FontRenderParams::SUBPIXEL_RENDERING_VRGB; | 56 params->subpixel_rendering = FontRenderParams::SUBPIXEL_RENDERING_VRGB; |
| 57 break; | 57 break; |
| 58 case FC_RGBA_VBGR: | 58 case FC_RGBA_VBGR: |
| 59 params->subpixel_rendering = FontRenderParams::SUBPIXEL_RENDERING_VBGR; | 59 params->subpixel_rendering = FontRenderParams::SUBPIXEL_RENDERING_VBGR; |
| 60 break; | 60 break; |
| 61 default: | 61 default: |
| 62 params->subpixel_rendering = FontRenderParams::SUBPIXEL_RENDERING_NONE; | 62 params->subpixel_rendering = FontRenderParams::SUBPIXEL_RENDERING_NONE; |
| 63 } | 63 } |
| 64 | 64 |
| 65 #if defined(OS_LINUX) && defined(USE_AURA) && !defined(OS_CHROMEOS) | 65 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 66 const LinuxFontDelegate* delegate = LinuxFontDelegate::instance(); | 66 const LinuxFontDelegate* delegate = LinuxFontDelegate::instance(); |
| 67 if (delegate) { | 67 if (delegate) { |
| 68 params->antialiasing = delegate->UseAntialiasing(); | 68 params->antialiasing = delegate->UseAntialiasing(); |
| 69 params->hinting = delegate->GetHintingStyle(); | 69 params->hinting = delegate->GetHintingStyle(); |
| 70 params->subpixel_rendering = delegate->GetSubpixelRenderingStyle(); | 70 params->subpixel_rendering = delegate->GetSubpixelRenderingStyle(); |
| 71 } | 71 } |
| 72 #endif | 72 #endif |
| 73 | 73 |
| 74 params->subpixel_positioning = SubpixelPositioningRequested(renderer); | 74 params->subpixel_positioning = SubpixelPositioningRequested(renderer); |
| 75 | 75 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 96 LoadDefaults(&default_params, /* renderer */ true); | 96 LoadDefaults(&default_params, /* renderer */ true); |
| 97 loaded_defaults = true; | 97 loaded_defaults = true; |
| 98 return default_params; | 98 return default_params; |
| 99 } | 99 } |
| 100 | 100 |
| 101 bool GetDefaultWebkitSubpixelPositioning() { | 101 bool GetDefaultWebkitSubpixelPositioning() { |
| 102 return SubpixelPositioningRequested(true); | 102 return SubpixelPositioningRequested(true); |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace gfx | 105 } // namespace gfx |
| OLD | NEW |