| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. | 2 * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 FontPlatformData::FontPlatformData(const FontPlatformData& src) | 110 FontPlatformData::FontPlatformData(const FontPlatformData& src) |
| 111 : m_typeface(src.m_typeface) | 111 : m_typeface(src.m_typeface) |
| 112 , m_family(src.m_family) | 112 , m_family(src.m_family) |
| 113 , m_textSize(src.m_textSize) | 113 , m_textSize(src.m_textSize) |
| 114 , m_emSizeInFontUnits(src.m_emSizeInFontUnits) | 114 , m_emSizeInFontUnits(src.m_emSizeInFontUnits) |
| 115 , m_syntheticBold(src.m_syntheticBold) | 115 , m_syntheticBold(src.m_syntheticBold) |
| 116 , m_syntheticItalic(src.m_syntheticItalic) | 116 , m_syntheticItalic(src.m_syntheticItalic) |
| 117 , m_orientation(src.m_orientation) | 117 , m_orientation(src.m_orientation) |
| 118 , m_style(src.m_style) | 118 , m_style(src.m_style) |
| 119 , m_harfBuzzFace(0) | 119 , m_harfBuzzFace(nullptr) |
| 120 , m_isHashTableDeletedValue(false) | 120 , m_isHashTableDeletedValue(false) |
| 121 { | 121 { |
| 122 } | 122 } |
| 123 | 123 |
| 124 FontPlatformData::FontPlatformData(PassRefPtr<SkTypeface> tf, const char* family
, float textSize, bool syntheticBold, bool syntheticItalic, FontOrientation orie
ntation, bool subpixelTextPosition) | 124 FontPlatformData::FontPlatformData(PassRefPtr<SkTypeface> tf, const char* family
, float textSize, bool syntheticBold, bool syntheticItalic, FontOrientation orie
ntation, bool subpixelTextPosition) |
| 125 : m_typeface(tf) | 125 : m_typeface(tf) |
| 126 , m_family(family) | 126 , m_family(family) |
| 127 , m_textSize(textSize) | 127 , m_textSize(textSize) |
| 128 , m_emSizeInFontUnits(0) | 128 , m_emSizeInFontUnits(0) |
| 129 , m_syntheticBold(syntheticBold) | 129 , m_syntheticBold(syntheticBold) |
| 130 , m_syntheticItalic(syntheticItalic) | 130 , m_syntheticItalic(syntheticItalic) |
| 131 , m_orientation(orientation) | 131 , m_orientation(orientation) |
| 132 , m_isHashTableDeletedValue(false) | 132 , m_isHashTableDeletedValue(false) |
| 133 { | 133 { |
| 134 querySystemForRenderStyle(subpixelTextPosition); | 134 querySystemForRenderStyle(subpixelTextPosition); |
| 135 } | 135 } |
| 136 | 136 |
| 137 FontPlatformData::FontPlatformData(const FontPlatformData& src, float textSize) | 137 FontPlatformData::FontPlatformData(const FontPlatformData& src, float textSize) |
| 138 : m_typeface(src.m_typeface) | 138 : m_typeface(src.m_typeface) |
| 139 , m_family(src.m_family) | 139 , m_family(src.m_family) |
| 140 , m_textSize(textSize) | 140 , m_textSize(textSize) |
| 141 , m_emSizeInFontUnits(src.m_emSizeInFontUnits) | 141 , m_emSizeInFontUnits(src.m_emSizeInFontUnits) |
| 142 , m_syntheticBold(src.m_syntheticBold) | 142 , m_syntheticBold(src.m_syntheticBold) |
| 143 , m_syntheticItalic(src.m_syntheticItalic) | 143 , m_syntheticItalic(src.m_syntheticItalic) |
| 144 , m_orientation(src.m_orientation) | 144 , m_orientation(src.m_orientation) |
| 145 , m_harfBuzzFace(0) | 145 , m_harfBuzzFace(nullptr) |
| 146 , m_isHashTableDeletedValue(false) | 146 , m_isHashTableDeletedValue(false) |
| 147 { | 147 { |
| 148 querySystemForRenderStyle(FontDescription::subpixelPositioning()); | 148 querySystemForRenderStyle(FontDescription::subpixelPositioning()); |
| 149 } | 149 } |
| 150 | 150 |
| 151 FontPlatformData::~FontPlatformData() | 151 FontPlatformData::~FontPlatformData() |
| 152 { | 152 { |
| 153 } | 153 } |
| 154 | 154 |
| 155 int FontPlatformData::emSizeInFontUnits() const | 155 int FontPlatformData::emSizeInFontUnits() const |
| 156 { | 156 { |
| 157 if (m_emSizeInFontUnits) | 157 if (m_emSizeInFontUnits) |
| 158 return m_emSizeInFontUnits; | 158 return m_emSizeInFontUnits; |
| 159 | 159 |
| 160 m_emSizeInFontUnits = m_typeface->getUnitsPerEm(); | 160 m_emSizeInFontUnits = m_typeface->getUnitsPerEm(); |
| 161 return m_emSizeInFontUnits; | 161 return m_emSizeInFontUnits; |
| 162 } | 162 } |
| 163 | 163 |
| 164 FontPlatformData& FontPlatformData::operator=(const FontPlatformData& src) | 164 FontPlatformData& FontPlatformData::operator=(const FontPlatformData& src) |
| 165 { | 165 { |
| 166 m_typeface = src.m_typeface; | 166 m_typeface = src.m_typeface; |
| 167 m_family = src.m_family; | 167 m_family = src.m_family; |
| 168 m_textSize = src.m_textSize; | 168 m_textSize = src.m_textSize; |
| 169 m_syntheticBold = src.m_syntheticBold; | 169 m_syntheticBold = src.m_syntheticBold; |
| 170 m_syntheticItalic = src.m_syntheticItalic; | 170 m_syntheticItalic = src.m_syntheticItalic; |
| 171 m_harfBuzzFace = 0; | 171 m_harfBuzzFace = nullptr; |
| 172 m_orientation = src.m_orientation; | 172 m_orientation = src.m_orientation; |
| 173 m_style = src.m_style; | 173 m_style = src.m_style; |
| 174 m_emSizeInFontUnits = src.m_emSizeInFontUnits; | 174 m_emSizeInFontUnits = src.m_emSizeInFontUnits; |
| 175 | 175 |
| 176 return *this; | 176 return *this; |
| 177 } | 177 } |
| 178 | 178 |
| 179 #ifndef NDEBUG | 179 #ifndef NDEBUG |
| 180 String FontPlatformData::description() const | 180 String FontPlatformData::description() const |
| 181 { | 181 { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 if (m_style.useSubpixelRendering == FontRenderStyle::NoPreference) | 295 if (m_style.useSubpixelRendering == FontRenderStyle::NoPreference) |
| 296 m_style.useSubpixelRendering = useSkiaSubpixelRendering; | 296 m_style.useSubpixelRendering = useSkiaSubpixelRendering; |
| 297 | 297 |
| 298 // TestRunner specifically toggles the subpixel positioning flag. | 298 // TestRunner specifically toggles the subpixel positioning flag. |
| 299 if (m_style.useSubpixelPositioning == FontRenderStyle::NoPreference | 299 if (m_style.useSubpixelPositioning == FontRenderStyle::NoPreference |
| 300 || isRunningLayoutTest()) | 300 || isRunningLayoutTest()) |
| 301 m_style.useSubpixelPositioning = useSkiaSubpixelPositioning; | 301 m_style.useSubpixelPositioning = useSkiaSubpixelPositioning; |
| 302 } | 302 } |
| 303 | 303 |
| 304 } // namespace WebCore | 304 } // namespace WebCore |
| OLD | NEW |