| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #include "core/CSSValueKeywords.h" | 28 #include "core/CSSValueKeywords.h" |
| 29 #include "platform/fonts/FontCache.h" | 29 #include "platform/fonts/FontCache.h" |
| 30 #include "platform/fonts/FontDescription.h" | 30 #include "platform/fonts/FontDescription.h" |
| 31 #include "wtf/text/WTFString.h" | 31 #include "wtf/text/WTFString.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 // Converts |points| to pixels. One point is 1/72 of an inch. | 35 // Converts |points| to pixels. One point is 1/72 of an inch. |
| 36 static float pointsToPixels(float points) { | 36 static float pointsToPixels(float points) { |
| 37 float pixelsPerInch = 96.0f * FontCache::deviceScaleFactor(); | 37 const float pixelsPerInch = 96.0f; |
| 38 static const float pointsPerInch = 72.0f; | 38 const float pointsPerInch = 72.0f; |
| 39 return points / pointsPerInch * pixelsPerInch; | 39 return points / pointsPerInch * pixelsPerInch; |
| 40 } | 40 } |
| 41 | 41 |
| 42 // static | 42 // static |
| 43 void LayoutThemeFontProvider::systemFont(CSSValueID systemFontID, | 43 void LayoutThemeFontProvider::systemFont(CSSValueID systemFontID, |
| 44 FontStyle& fontStyle, | 44 FontStyle& fontStyle, |
| 45 FontWeight& fontWeight, | 45 FontWeight& fontWeight, |
| 46 float& fontSize, | 46 float& fontSize, |
| 47 AtomicString& fontFamily) { | 47 AtomicString& fontFamily) { |
| 48 fontStyle = FontStyleNormal; | 48 fontStyle = FontStyleNormal; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 76 break; | 76 break; |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 | 79 |
| 80 // static | 80 // static |
| 81 void LayoutThemeFontProvider::setDefaultFontSize(int fontSize) { | 81 void LayoutThemeFontProvider::setDefaultFontSize(int fontSize) { |
| 82 s_defaultFontSize = static_cast<float>(fontSize); | 82 s_defaultFontSize = static_cast<float>(fontSize); |
| 83 } | 83 } |
| 84 | 84 |
| 85 } // namespace blink | 85 } // namespace blink |
| OLD | NEW |