Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: third_party/WebKit/Source/platform/fonts/FontDescription.h

Issue 2797423005: Always use original ascent/descent for FontMetrics::floatAscent|floatDescent (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights
6 * reserved. 6 * reserved.
7 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 7 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 294
295 TypesettingFeatures getTypesettingFeatures() const { 295 TypesettingFeatures getTypesettingFeatures() const {
296 return static_cast<TypesettingFeatures>(m_fields.m_typesettingFeatures); 296 return static_cast<TypesettingFeatures>(m_fields.m_typesettingFeatures);
297 } 297 }
298 298
299 static void setSubpixelPositioning(bool b) { 299 static void setSubpixelPositioning(bool b) {
300 s_useSubpixelTextPositioning = b; 300 s_useSubpixelTextPositioning = b;
301 } 301 }
302 static bool subpixelPositioning() { return s_useSubpixelTextPositioning; } 302 static bool subpixelPositioning() { return s_useSubpixelTextPositioning; }
303 303
304 void setSubpixelAscentDescent(bool sp) const {
305 m_fields.m_subpixelAscentDescent = sp;
306 }
307
308 bool subpixelAscentDescent() const {
309 return m_fields.m_subpixelAscentDescent;
310 }
311
312 static void setDefaultTypesettingFeatures(TypesettingFeatures); 304 static void setDefaultTypesettingFeatures(TypesettingFeatures);
313 static TypesettingFeatures defaultTypesettingFeatures(); 305 static TypesettingFeatures defaultTypesettingFeatures();
314 306
315 unsigned styleHashWithoutFamilyList() const; 307 unsigned styleHashWithoutFamilyList() const;
316 // TODO(drott): We should not expose internal structure here, but rather 308 // TODO(drott): We should not expose internal structure here, but rather
317 // introduce a hash function here. 309 // introduce a hash function here.
318 unsigned bitmapFields() const { return m_fieldsAsUnsigned.parts[0]; } 310 unsigned bitmapFields() const { return m_fieldsAsUnsigned.parts[0]; }
319 unsigned auxiliaryBitmapFields() const { return m_fieldsAsUnsigned.parts[1]; } 311 unsigned auxiliaryBitmapFields() const { return m_fieldsAsUnsigned.parts[1]; }
320 312
321 SkFontStyle skiaFontStyle() const; 313 SkFontStyle skiaFontStyle() const;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 // values for <font>). 366 // values for <font>).
375 unsigned m_keywordSize : 4; 367 unsigned m_keywordSize : 4;
376 368
377 unsigned m_fontSmoothing : 2; // FontSmoothingMode 369 unsigned m_fontSmoothing : 2; // FontSmoothingMode
378 unsigned m_textRendering : 2; // TextRenderingMode 370 unsigned m_textRendering : 2; // TextRenderingMode
379 unsigned m_syntheticBold : 1; 371 unsigned m_syntheticBold : 1;
380 unsigned m_syntheticItalic : 1; 372 unsigned m_syntheticItalic : 1;
381 unsigned m_subpixelTextPosition : 1; 373 unsigned m_subpixelTextPosition : 1;
382 unsigned m_typesettingFeatures : 3; 374 unsigned m_typesettingFeatures : 3;
383 unsigned m_variantNumeric : 8; 375 unsigned m_variantNumeric : 8;
384 mutable unsigned m_subpixelAscentDescent : 1;
385 }; 376 };
386 377
387 static_assert(sizeof(BitFields) == sizeof(FieldsAsUnsignedType), 378 static_assert(sizeof(BitFields) == sizeof(FieldsAsUnsignedType),
388 "Mapped bitfield datatypes must have identical size."); 379 "Mapped bitfield datatypes must have identical size.");
389 union { 380 union {
390 BitFields m_fields; 381 BitFields m_fields;
391 FieldsAsUnsignedType m_fieldsAsUnsigned; 382 FieldsAsUnsignedType m_fieldsAsUnsigned;
392 }; 383 };
393 384
394 static TypesettingFeatures s_defaultTypesettingFeatures; 385 static TypesettingFeatures s_defaultTypesettingFeatures;
395 386
396 static bool s_useSubpixelTextPositioning; 387 static bool s_useSubpixelTextPositioning;
397 }; 388 };
398 389
399 } // namespace blink 390 } // namespace blink
400 391
401 #endif 392 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698