Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Brent Fulgham | 2 * Copyright (C) 2011 Brent Fulgham |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 #if !OS(WIN) | 42 #if !OS(WIN) |
| 43 , m_family(CString()) | 43 , m_family(CString()) |
| 44 #endif | 44 #endif |
| 45 , m_textSize(0) | 45 , m_textSize(0) |
| 46 , m_syntheticBold(false) | 46 , m_syntheticBold(false) |
| 47 , m_syntheticItalic(false) | 47 , m_syntheticItalic(false) |
| 48 , m_orientation(Horizontal) | 48 , m_orientation(Horizontal) |
| 49 #if OS(MACOSX) | 49 #if OS(MACOSX) |
| 50 , m_isColorBitmapFont(false) | 50 , m_isColorBitmapFont(false) |
| 51 , m_isCompositeFontReference(false) | 51 , m_isCompositeFontReference(false) |
| 52 #endif | |
| 53 , m_widthVariant(RegularWidth) | |
| 54 #if OS(MACOSX) | |
| 55 , m_font(nullptr) | 52 , m_font(nullptr) |
| 56 #else | 53 #else |
| 57 , m_style(FontRenderStyle()) | 54 , m_style(FontRenderStyle()) |
| 58 #endif | 55 #endif |
| 59 , m_isHashTableDeletedValue(true) | 56 , m_isHashTableDeletedValue(true) |
| 60 #if OS(WIN) | 57 #if OS(WIN) |
| 61 , m_paintTextFlags(0) | 58 , m_paintTextFlags(0) |
| 62 , m_useSubpixelPositioning(false) | 59 , m_useSubpixelPositioning(false) |
| 63 , m_minSizeForAntiAlias(0) | 60 , m_minSizeForAntiAlias(0) |
| 64 , m_minSizeForSubpixel(0) | 61 , m_minSizeForSubpixel(0) |
| 65 #endif | 62 #endif |
| 66 { | 63 { |
| 67 } | 64 } |
| 68 | 65 |
| 69 FontPlatformData::FontPlatformData() | 66 FontPlatformData::FontPlatformData() |
| 70 : m_typeface(nullptr) | 67 : m_typeface(nullptr) |
| 71 #if !OS(WIN) | 68 #if !OS(WIN) |
| 72 , m_family(CString()) | 69 , m_family(CString()) |
| 73 #endif | 70 #endif |
| 74 , m_textSize(0) | 71 , m_textSize(0) |
| 75 , m_syntheticBold(false) | 72 , m_syntheticBold(false) |
| 76 , m_syntheticItalic(false) | 73 , m_syntheticItalic(false) |
| 77 , m_orientation(Horizontal) | 74 , m_orientation(Horizontal) |
| 78 #if OS(MACOSX) | 75 #if OS(MACOSX) |
| 79 , m_isColorBitmapFont(false) | 76 , m_isColorBitmapFont(false) |
| 80 , m_isCompositeFontReference(false) | 77 , m_isCompositeFontReference(false) |
| 81 #endif | |
| 82 , m_widthVariant(RegularWidth) | |
| 83 #if OS(MACOSX) | |
| 84 , m_font(nullptr) | 78 , m_font(nullptr) |
| 85 #else | 79 #else |
| 86 , m_style(FontRenderStyle()) | 80 , m_style(FontRenderStyle()) |
| 87 #endif | 81 #endif |
| 88 , m_isHashTableDeletedValue(false) | 82 , m_isHashTableDeletedValue(false) |
| 89 #if OS(WIN) | 83 #if OS(WIN) |
| 90 , m_paintTextFlags(0) | 84 , m_paintTextFlags(0) |
| 91 , m_useSubpixelPositioning(false) | 85 , m_useSubpixelPositioning(false) |
| 92 , m_minSizeForAntiAlias(0) | 86 , m_minSizeForAntiAlias(0) |
| 93 , m_minSizeForSubpixel(0) | 87 , m_minSizeForSubpixel(0) |
| 94 #endif | 88 #endif |
| 95 { | 89 { |
| 96 } | 90 } |
| 97 | 91 |
| 98 FontPlatformData::FontPlatformData(float size, bool syntheticBold, bool syntheti cItalic, FontOrientation orientation, FontWidthVariant widthVariant) | 92 FontPlatformData::FontPlatformData(float size, bool syntheticBold, bool syntheti cItalic, FontOrientation orientation) |
| 99 : m_typeface(nullptr) | 93 : m_typeface(nullptr) |
| 100 #if !OS(WIN) | 94 #if !OS(WIN) |
| 101 , m_family(CString()) | 95 , m_family(CString()) |
| 102 #endif | 96 #endif |
| 103 , m_textSize(size) | 97 , m_textSize(size) |
| 104 , m_syntheticBold(syntheticBold) | 98 , m_syntheticBold(syntheticBold) |
| 105 , m_syntheticItalic(syntheticItalic) | 99 , m_syntheticItalic(syntheticItalic) |
| 106 , m_orientation(orientation) | 100 , m_orientation(orientation) |
| 107 #if OS(MACOSX) | 101 #if OS(MACOSX) |
| 108 , m_isColorBitmapFont(false) | 102 , m_isColorBitmapFont(false) |
| 109 , m_isCompositeFontReference(false) | 103 , m_isCompositeFontReference(false) |
| 110 #endif | |
| 111 , m_widthVariant(widthVariant) | |
| 112 #if OS(MACOSX) | |
| 113 , m_font(nullptr) | 104 , m_font(nullptr) |
| 114 #else | 105 #else |
| 115 , m_style(FontRenderStyle()) | 106 , m_style(FontRenderStyle()) |
| 116 #endif | 107 #endif |
| 117 , m_isHashTableDeletedValue(false) | 108 , m_isHashTableDeletedValue(false) |
| 118 #if OS(WIN) | 109 #if OS(WIN) |
| 119 , m_paintTextFlags(0) | 110 , m_paintTextFlags(0) |
| 120 , m_useSubpixelPositioning(false) | 111 , m_useSubpixelPositioning(false) |
| 121 , m_minSizeForAntiAlias(0) | 112 , m_minSizeForAntiAlias(0) |
| 122 , m_minSizeForSubpixel(0) | 113 , m_minSizeForSubpixel(0) |
| 123 #endif | 114 #endif |
| 124 { | 115 { |
| 125 } | 116 } |
| 126 | 117 |
| 127 FontPlatformData::FontPlatformData(const FontPlatformData& source) | 118 FontPlatformData::FontPlatformData(const FontPlatformData& source) |
| 128 : m_typeface(source.m_typeface) | 119 : m_typeface(source.m_typeface) |
| 129 #if !OS(WIN) | 120 #if !OS(WIN) |
| 130 , m_family(source.m_family) | 121 , m_family(source.m_family) |
| 131 #endif | 122 #endif |
| 132 , m_textSize(source.m_textSize) | 123 , m_textSize(source.m_textSize) |
| 133 , m_syntheticBold(source.m_syntheticBold) | 124 , m_syntheticBold(source.m_syntheticBold) |
| 134 , m_syntheticItalic(source.m_syntheticItalic) | 125 , m_syntheticItalic(source.m_syntheticItalic) |
| 135 , m_orientation(source.m_orientation) | 126 , m_orientation(source.m_orientation) |
| 136 #if OS(MACOSX) | 127 #if OS(MACOSX) |
| 137 , m_isColorBitmapFont(source.m_isColorBitmapFont) | 128 , m_isColorBitmapFont(source.m_isColorBitmapFont) |
| 138 , m_isCompositeFontReference(source.m_isCompositeFontReference) | 129 , m_isCompositeFontReference(source.m_isCompositeFontReference) |
| 139 #endif | 130 #endif |
| 140 , m_widthVariant(source.m_widthVariant) | |
| 141 #if !OS(MACOSX) | 131 #if !OS(MACOSX) |
| 142 , m_style(source.m_style) | 132 , m_style(source.m_style) |
| 143 #endif | 133 #endif |
| 144 , m_harfBuzzFace(nullptr) | 134 , m_harfBuzzFace(nullptr) |
| 145 , m_isHashTableDeletedValue(false) | 135 , m_isHashTableDeletedValue(false) |
| 146 #if OS(WIN) | 136 #if OS(WIN) |
| 147 , m_paintTextFlags(source.m_paintTextFlags) | 137 , m_paintTextFlags(source.m_paintTextFlags) |
| 148 , m_useSubpixelPositioning(source.m_useSubpixelPositioning) | 138 , m_useSubpixelPositioning(source.m_useSubpixelPositioning) |
| 149 , m_minSizeForAntiAlias(source.m_minSizeForAntiAlias) | 139 , m_minSizeForAntiAlias(source.m_minSizeForAntiAlias) |
| 150 , m_minSizeForSubpixel(source.m_minSizeForSubpixel) | 140 , m_minSizeForSubpixel(source.m_minSizeForSubpixel) |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 161 , m_family(src.m_family) | 151 , m_family(src.m_family) |
| 162 #endif | 152 #endif |
| 163 , m_textSize(textSize) | 153 , m_textSize(textSize) |
| 164 , m_syntheticBold(src.m_syntheticBold) | 154 , m_syntheticBold(src.m_syntheticBold) |
| 165 , m_syntheticItalic(src.m_syntheticItalic) | 155 , m_syntheticItalic(src.m_syntheticItalic) |
| 166 , m_orientation(src.m_orientation) | 156 , m_orientation(src.m_orientation) |
| 167 #if OS(MACOSX) | 157 #if OS(MACOSX) |
| 168 , m_isColorBitmapFont(src.m_isColorBitmapFont) | 158 , m_isColorBitmapFont(src.m_isColorBitmapFont) |
| 169 , m_isCompositeFontReference(src.m_isCompositeFontReference) | 159 , m_isCompositeFontReference(src.m_isCompositeFontReference) |
| 170 #endif | 160 #endif |
| 171 , m_widthVariant(RegularWidth) | |
| 172 #if !OS(MACOSX) | 161 #if !OS(MACOSX) |
| 173 , m_style(src.m_style) | 162 , m_style(src.m_style) |
| 174 #endif | 163 #endif |
| 175 , m_harfBuzzFace(nullptr) | 164 , m_harfBuzzFace(nullptr) |
| 176 , m_isHashTableDeletedValue(false) | 165 , m_isHashTableDeletedValue(false) |
| 177 #if OS(WIN) | 166 #if OS(WIN) |
| 178 , m_paintTextFlags(src.m_paintTextFlags) | 167 , m_paintTextFlags(src.m_paintTextFlags) |
| 179 , m_useSubpixelPositioning(src.m_useSubpixelPositioning) | 168 , m_useSubpixelPositioning(src.m_useSubpixelPositioning) |
| 180 , m_minSizeForAntiAlias(src.m_minSizeForAntiAlias) | 169 , m_minSizeForAntiAlias(src.m_minSizeForAntiAlias) |
| 181 , m_minSizeForSubpixel(src.m_minSizeForSubpixel) | 170 , m_minSizeForSubpixel(src.m_minSizeForSubpixel) |
| 182 #endif | 171 #endif |
| 183 { | 172 { |
| 184 #if OS(MACOSX) | 173 #if OS(MACOSX) |
| 185 platformDataInit(src); | 174 platformDataInit(src); |
| 186 #else | 175 #else |
| 187 querySystemForRenderStyle(FontDescription::subpixelPositioning()); | 176 querySystemForRenderStyle(FontDescription::subpixelPositioning()); |
| 188 #endif | 177 #endif |
| 189 } | 178 } |
| 190 | 179 |
| 191 #if OS(MACOSX) | 180 #if OS(MACOSX) |
| 192 FontPlatformData::FontPlatformData(CGFontRef cgFont, PassRefPtr<SkTypeface> tf, float size, bool syntheticBold, bool syntheticItalic, FontOrientation orientatio n, FontWidthVariant widthVariant) | 181 FontPlatformData::FontPlatformData(CGFontRef cgFont, PassRefPtr<SkTypeface> tf, float size, bool syntheticBold, bool syntheticItalic, FontOrientation orientatio n) |
| 193 : m_typeface(tf) | 182 : m_typeface(tf) |
| 194 , m_family(CString()) | 183 , m_family(CString()) |
| 195 , m_textSize(size) | 184 , m_textSize(size) |
| 196 , m_syntheticBold(syntheticBold) | 185 , m_syntheticBold(syntheticBold) |
| 197 , m_syntheticItalic(syntheticItalic) | 186 , m_syntheticItalic(syntheticItalic) |
| 198 , m_orientation(orientation) | 187 , m_orientation(orientation) |
| 199 , m_isColorBitmapFont(false) | 188 , m_isColorBitmapFont(false) |
| 200 , m_isCompositeFontReference(false) | 189 , m_isCompositeFontReference(false) |
| 201 , m_widthVariant(widthVariant) | |
| 202 , m_font(nullptr) | 190 , m_font(nullptr) |
| 203 , m_cgFont(cgFont) | 191 , m_cgFont(cgFont) |
| 204 , m_isHashTableDeletedValue(false) | 192 , m_isHashTableDeletedValue(false) |
| 205 { | 193 { |
| 206 } | 194 } |
| 207 | 195 |
| 208 #else | 196 #else |
| 209 | 197 |
| 210 FontPlatformData::FontPlatformData(PassRefPtr<SkTypeface> tf, const char* family , float textSize, bool syntheticBold, bool syntheticItalic, FontOrientation orie ntation, bool subpixelTextPosition) | 198 FontPlatformData::FontPlatformData(PassRefPtr<SkTypeface> tf, const char* family , float textSize, bool syntheticBold, bool syntheticItalic, FontOrientation orie ntation, bool subpixelTextPosition) |
| 211 : m_typeface(tf) | 199 : m_typeface(tf) |
| 212 #if !OS(WIN) | 200 #if !OS(WIN) |
| 213 , m_family(family) | 201 , m_family(family) |
| 214 #endif | 202 #endif |
| 215 , m_textSize(textSize) | 203 , m_textSize(textSize) |
| 216 , m_syntheticBold(syntheticBold) | 204 , m_syntheticBold(syntheticBold) |
| 217 , m_syntheticItalic(syntheticItalic) | 205 , m_syntheticItalic(syntheticItalic) |
| 218 , m_orientation(orientation) | 206 , m_orientation(orientation) |
| 219 , m_widthVariant(RegularWidth) | |
| 220 , m_isHashTableDeletedValue(false) | 207 , m_isHashTableDeletedValue(false) |
| 221 #if OS(WIN) | 208 #if OS(WIN) |
| 222 , m_paintTextFlags(0) | 209 , m_paintTextFlags(0) |
| 223 , m_useSubpixelPositioning(subpixelTextPosition) | 210 , m_useSubpixelPositioning(subpixelTextPosition) |
| 224 , m_minSizeForAntiAlias(0) | 211 , m_minSizeForAntiAlias(0) |
| 225 , m_minSizeForSubpixel(0) | 212 , m_minSizeForSubpixel(0) |
| 226 #endif | 213 #endif |
| 227 { | 214 { |
| 228 querySystemForRenderStyle(subpixelTextPosition); | 215 querySystemForRenderStyle(subpixelTextPosition); |
| 229 } | 216 } |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 246 | 233 |
| 247 m_typeface = other.m_typeface; | 234 m_typeface = other.m_typeface; |
| 248 #if !OS(WIN) | 235 #if !OS(WIN) |
| 249 m_family = other.m_family; | 236 m_family = other.m_family; |
| 250 #endif | 237 #endif |
| 251 m_textSize = other.m_textSize; | 238 m_textSize = other.m_textSize; |
| 252 m_syntheticBold = other.m_syntheticBold; | 239 m_syntheticBold = other.m_syntheticBold; |
| 253 m_syntheticItalic = other.m_syntheticItalic; | 240 m_syntheticItalic = other.m_syntheticItalic; |
| 254 m_harfBuzzFace = nullptr; | 241 m_harfBuzzFace = nullptr; |
| 255 m_orientation = other.m_orientation; | 242 m_orientation = other.m_orientation; |
| 256 m_widthVariant = other.m_widthVariant; | |
| 257 #if OS(MACOSX) | 243 #if OS(MACOSX) |
| 258 m_isColorBitmapFont = other.m_isColorBitmapFont; | 244 m_isColorBitmapFont = other.m_isColorBitmapFont; |
| 259 m_isCompositeFontReference = other.m_isCompositeFontReference; | 245 m_isCompositeFontReference = other.m_isCompositeFontReference; |
| 260 #else | 246 #else |
| 261 m_style = other.m_style; | 247 m_style = other.m_style; |
| 262 #endif | 248 #endif |
| 263 m_widthVariant = other.m_widthVariant; | |
| 264 | 249 |
| 265 #if OS(WIN) | 250 #if OS(WIN) |
| 266 m_paintTextFlags = 0; | 251 m_paintTextFlags = 0; |
| 267 m_minSizeForAntiAlias = other.m_minSizeForAntiAlias; | 252 m_minSizeForAntiAlias = other.m_minSizeForAntiAlias; |
| 268 m_minSizeForSubpixel = other.m_minSizeForSubpixel; | 253 m_minSizeForSubpixel = other.m_minSizeForSubpixel; |
| 269 m_useSubpixelPositioning = other.m_useSubpixelPositioning; | 254 m_useSubpixelPositioning = other.m_useSubpixelPositioning; |
| 270 #endif | 255 #endif |
| 271 | 256 |
| 272 #if OS(MACOSX) | 257 #if OS(MACOSX) |
| 273 return platformDataAssign(other); | 258 return platformDataAssign(other); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 293 typefacesEqual = m_cgFont == a.m_cgFont; | 278 typefacesEqual = m_cgFont == a.m_cgFont; |
| 294 #endif | 279 #endif |
| 295 | 280 |
| 296 return typefacesEqual | 281 return typefacesEqual |
| 297 && m_textSize == a.m_textSize | 282 && m_textSize == a.m_textSize |
| 298 && m_isHashTableDeletedValue == a.m_isHashTableDeletedValue | 283 && m_isHashTableDeletedValue == a.m_isHashTableDeletedValue |
| 299 && m_syntheticBold == a.m_syntheticBold | 284 && m_syntheticBold == a.m_syntheticBold |
| 300 && m_syntheticItalic == a.m_syntheticItalic | 285 && m_syntheticItalic == a.m_syntheticItalic |
| 301 && m_orientation == a.m_orientation | 286 && m_orientation == a.m_orientation |
| 302 #if !OS(MACOSX) | 287 #if !OS(MACOSX) |
| 303 && m_style == a.m_style | 288 && m_style == a.m_style |
|
Dominik Röttsches
2014/11/13 13:42:22
I'd put semicolons here and...
bungeman-chromium
2014/11/13 17:49:43
Done.
| |
| 304 #else | 289 #else |
| 305 && m_isColorBitmapFont == a.m_isColorBitmapFont | 290 && m_isColorBitmapFont == a.m_isColorBitmapFont |
| 306 && m_isCompositeFontReference == a.m_isCompositeFontReference | 291 && m_isCompositeFontReference == a.m_isCompositeFontReference |
|
Dominik Röttsches
2014/11/13 13:42:22
here.
bungeman-chromium
2014/11/13 17:49:43
Done.
| |
| 307 #endif | 292 #endif |
| 308 && m_widthVariant == a.m_widthVariant; | 293 && true; |
|
Dominik Röttsches
2014/11/13 13:42:22
instead of this tail end.
bungeman-chromium
2014/11/13 17:49:43
Done.
| |
| 309 } | 294 } |
| 310 | 295 |
| 311 SkFontID FontPlatformData::uniqueID() const | 296 SkFontID FontPlatformData::uniqueID() const |
| 312 { | 297 { |
| 313 return typeface()->uniqueID(); | 298 return typeface()->uniqueID(); |
| 314 } | 299 } |
| 315 | 300 |
| 316 String FontPlatformData::fontFamilyName() const | 301 String FontPlatformData::fontFamilyName() const |
| 317 { | 302 { |
| 318 ASSERT(this->typeface()); | 303 ASSERT(this->typeface()); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 389 if (tableSize) { | 374 if (tableSize) { |
| 390 Vector<char> tableBuffer(tableSize); | 375 Vector<char> tableBuffer(tableSize); |
| 391 m_typeface->getTableData(tag, 0, tableSize, &tableBuffer[0]); | 376 m_typeface->getTableData(tag, 0, tableSize, &tableBuffer[0]); |
| 392 buffer = SharedBuffer::adoptVector(tableBuffer); | 377 buffer = SharedBuffer::adoptVector(tableBuffer); |
| 393 } | 378 } |
| 394 return buffer.release(); | 379 return buffer.release(); |
| 395 } | 380 } |
| 396 #endif | 381 #endif |
| 397 | 382 |
| 398 } // namespace blink | 383 } // namespace blink |
| OLD | NEW |