Changeset 127623 in webkit
- Timestamp:
- Sep 5, 2012 12:04:08 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 10 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/Platform/ChangeLog
r127612 r127623 1 2012-09-05 Mark Pilgrim <pilgrim@chromium.org> 2 3 [Chromium] Remove getRenderStyleForStrike from PlatformSupport 4 https://bugs.webkit.org/show_bug.cgi?id=95363 5 6 Reviewed by Adam Barth. 7 8 Part of a refactoring series. See tracking bug 82948. 9 10 * Platform.gypi: 11 * chromium/public/linux/WebFontInfo.h: Added. 12 (WebKit): 13 (WebFontInfo): 14 * chromium/public/linux/WebFontRenderStyle.h: Added. 15 (WebKit): 16 1 17 2012-09-05 Tommy Widenflycht <tommyw@google.com> 2 18 -
trunk/Source/Platform/Platform.gypi
r127612 r127623 150 150 'chromium/public/android/WebSandboxSupport.h', 151 151 'chromium/public/android/WebThemeEngine.h', 152 'chromium/public/linux/WebFontInfo.h', 153 'chromium/public/linux/WebFontRenderStyle.h', 152 154 'chromium/public/linux/WebSandboxSupport.h', 153 155 'chromium/public/linux/WebThemeEngine.h', -
trunk/Source/Platform/chromium/public/linux/WebFontInfo.h
r127620 r127623 32 32 #define WebFontInfo_h 33 33 34 #include "../ linux/WebFontRenderStyle.h"35 #include " ../platform/WebCString.h"36 #include " ../platform/linux/WebFontFamily.h"34 #include "../WebCString.h" 35 #include "WebFontFamily.h" 36 #include "WebFontRenderStyle.h" 37 37 38 38 #include <string.h> -
trunk/Source/Platform/chromium/public/linux/WebFontRenderStyle.h
r127620 r127623 32 32 #define WebFontRenderStyle_h 33 33 34 #include "../ platform/WebCommon.h"34 #include "../WebCommon.h" 35 35 36 36 namespace WebCore { struct FontRenderStyle; } -
trunk/Source/WebCore/ChangeLog
r127620 r127623 1 2012-09-05 Mark Pilgrim <pilgrim@chromium.org> 2 3 [Chromium] Remove getRenderStyleForStrike from PlatformSupport 4 https://bugs.webkit.org/show_bug.cgi?id=95363 5 6 Reviewed by Adam Barth. 7 8 Part of a refactoring series. See tracking bug 82948. 9 10 * platform/chromium/PlatformSupport.h: 11 (PlatformSupport): 12 * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp: 13 (WebCore::FontPlatformData::operator==): 14 (WebCore::FontPlatformData::getRenderStyleForStrike): 15 (WebCore): 16 (WebCore::FontPlatformData::querySystemForRenderStyle): 17 * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h: 18 (FontPlatformData): 19 1 20 2012-09-05 Sami Kyostila <skyostil@google.com> 2 21 -
trunk/Source/WebCore/platform/chromium/PlatformSupport.h
r127535 r127623 104 104 static bool loadFont(NSFont* srcFont, CGFontRef*, uint32_t* fontID); 105 105 #elif OS(UNIX) 106 static void getRenderStyleForStrike(const char* family, int sizeAndStyle, FontRenderStyle* result);107 106 struct FontFamily { 108 107 String name; -
trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp
r123586 r127623 1 1 /* 2 2 * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. 3 * 3 * 4 4 * Redistribution and use in source and binary forms, with or without 5 5 * modification, are permitted provided that the following conditions are 6 6 * met: 7 * 7 * 8 8 * * Redistributions of source code must retain the above copyright 9 9 * notice, this list of conditions and the following disclaimer. … … 15 15 * contributors may be used to endorse or promote products derived from 16 16 * this software without specific prior written permission. 17 * 17 * 18 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 30 30 31 31 #include "config.h" 32 #include "FontPlatformData .h"32 #include "FontPlatformDataHarfBuzz.h" 33 33 34 34 #include "NotImplemented.h" 35 35 #include "PlatformString.h" 36 #include "PlatformSupport.h"37 38 36 #include "SkAdvancedTypefaceMetrics.h" 39 37 #include "SkFontHost.h" … … 41 39 #include "SkTypeface.h" 42 40 43 #include <wtf/text/StringImpl.h>44 45 41 #if USE(HARFBUZZ_NG) 46 42 #include "HarfBuzzNGFace.h" … … 48 44 #include "HarfBuzzSkia.h" 49 45 #endif 46 47 #include <public/linux/WebFontInfo.h> 48 #include <public/linux/WebFontRenderStyle.h> 49 #include <public/linux/WebSandboxSupport.h> 50 #include <public/Platform.h> 51 #include <wtf/text/StringImpl.h> 50 52 51 53 namespace WebCore { … … 249 251 typefacesEqual = SkTypeface::Equal(m_typeface, a.m_typeface); 250 252 251 return typefacesEqual 253 return typefacesEqual 252 254 && m_textSize == a.m_textSize 253 255 && m_fakeBold == a.m_fakeBold … … 297 299 #endif 298 300 301 void FontPlatformData::getRenderStyleForStrike(const char* font, int sizeAndStyle) 302 { 303 WebKit::WebFontRenderStyle style; 304 305 #if OS(ANDROID) 306 style.setDefaults(); 307 #else 308 if (!font || !*font) 309 style.setDefaults(); // It's probably a webfont. Take the system defaults. 310 else if (WebKit::Platform::current()->sandboxSupport()) 311 WebKit::Platform::current()->sandboxSupport()->getRenderStyleForStrike(font, sizeAndStyle, &style); 312 else 313 WebKit::WebFontInfo::renderStyleForStrike(font, sizeAndStyle, &style); 314 #endif 315 316 style.toFontRenderStyle(&m_style); 317 } 318 299 319 void FontPlatformData::querySystemForRenderStyle() 300 320 { 301 PlatformSupport::getRenderStyleForStrike(m_family.data(), (((int)m_textSize) << 2) | (m_typeface->style() & 3), &m_style);321 getRenderStyleForStrike(m_family.data(), (((int)m_textSize) << 2) | (m_typeface->style() & 3)); 302 322 303 323 // Fix FontRenderStyle::NoPreference to actual styles. -
trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h
r123586 r127623 1 1 /* 2 2 * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. 3 * 3 * 4 4 * Redistribution and use in source and binary forms, with or without 5 5 * modification, are permitted provided that the following conditions are 6 6 * met: 7 * 7 * 8 8 * * Redistributions of source code must retain the above copyright 9 9 * notice, this list of conditions and the following disclaimer. … … 15 15 * contributors may be used to endorse or promote products derived from 16 16 * this software without specific prior written permission. 17 * 17 * 18 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 127 127 128 128 private: 129 void getRenderStyleForStrike(const char*, int); 129 130 void querySystemForRenderStyle(); 130 131 -
trunk/Source/WebKit/chromium/ChangeLog
r127617 r127623 1 2012-09-05 Mark Pilgrim <pilgrim@chromium.org> 2 3 [Chromium] Remove getRenderStyleForStrike from PlatformSupport 4 https://bugs.webkit.org/show_bug.cgi?id=95363 5 6 Reviewed by Adam Barth. 7 8 Part of a refactoring series. See tracking bug 82948. 9 10 * public/linux/WebFontInfo.h: 11 * public/linux/WebFontRenderStyle.h: 12 * src/PlatformSupport.cpp: 13 (WebCore): 14 1 15 2012-09-05 Ilya Tikhonovsky <loislo@chromium.org> 2 16 -
trunk/Source/WebKit/chromium/public/linux/WebFontInfo.h
r120363 r127623 29 29 */ 30 30 31 #ifndef WebFontInfo_h 32 #define WebFontInfo_h 33 34 #include "../linux/WebFontRenderStyle.h" 35 #include "../platform/WebCString.h" 36 #include "../platform/linux/WebFontFamily.h" 37 38 #include <string.h> 39 #include <unistd.h> 40 41 namespace WebKit { 42 43 class WebFontInfo { 44 public: 45 // Set a global preference describing whether renderStyleForStrike() should 46 // enable subpixel positioning or not. FontConfig doesn't currently provide 47 // a parameter for controlling this. 48 WEBKIT_EXPORT static void setSubpixelPositioning(bool); 49 50 // Return a font family which provides glyphs for the Unicode code points 51 // specified by |utf16| 52 // characters: a native-endian UTF16 string 53 // numCharacters: the number of 16-bit words in |utf16| 54 // preferredLocale: preferred locale identifier for the |characters| 55 // (e.g. "en", "ja", "zh-CN") 56 // 57 // Returns: the font family or an empty string if the request could not be 58 // satisfied. 59 // Returns: the font family instance. The instance has an empty font name if the request could not be satisfied. 60 WEBKIT_EXPORT static void familyForChars(const WebUChar* characters, size_t numCharacters, const char* preferredLocale, WebFontFamily*); 61 62 // Fill out the given WebFontRenderStyle with the user's preferences for 63 // rendering the given font at the given size (in pixels). 64 // family: i.e. "Times New Roman" 65 // sizeAndStyle: 66 // 3322222222221111111111 67 // 10987654321098765432109876543210 68 // +--------------------------------+ 69 // |..............Size............IB| 70 // +--------------------------------+ 71 // I: italic flag 72 // B: bold flag 73 WEBKIT_EXPORT static void renderStyleForStrike(const char* family, int sizeAndStyle, WebFontRenderStyle* result); 74 }; 75 76 } // namespace WebKit 77 78 #endif 31 #include "../../../../Platform/chromium/public/linux/WebFontInfo.h" -
trunk/Source/WebKit/chromium/public/linux/WebFontRenderStyle.h
r121264 r127623 29 29 */ 30 30 31 #ifndef WebFontRenderStyle_h 32 #define WebFontRenderStyle_h 33 34 #include "../platform/WebCommon.h" 35 36 namespace WebCore { struct FontRenderStyle; } 37 38 namespace WebKit { 39 40 struct WEBKIT_EXPORT WebFontRenderStyle { 41 // Each of the use* members below can take one of three values: 42 // 0: off 43 // 1: on 44 // 2: no preference expressed 45 char useBitmaps; // use embedded bitmap strike if possible 46 char useAutoHint; // use 'auto' hinting (FreeType specific) 47 char useHinting; // hint glyphs to the pixel grid 48 char hintStyle; // level of hinting, 0..3 49 char useAntiAlias; // antialias glyph shapes 50 char useSubpixelRendering; // use subpixel rendering (partially-filled pixels) 51 char useSubpixelPositioning; // use subpixel positioning (fractional X positions for glyphs) 52 53 #if WEBKIT_IMPLEMENTATION 54 // Translates the members of this struct to a FontRenderStyle 55 void toFontRenderStyle(WebCore::FontRenderStyle*); 56 #endif 57 58 void setDefaults(); 59 }; 60 61 } // namespace WebKit 62 63 #endif // WebFontRenderStyle_h 31 #include "../../../../Platform/chromium/public/linux/WebFontRenderStyle.h" -
trunk/Source/WebKit/chromium/src/PlatformSupport.cpp
r127535 r127623 254 254 } 255 255 256 void PlatformSupport::getRenderStyleForStrike(const char* font, int sizeAndStyle, FontRenderStyle* result)257 {258 WebFontRenderStyle style;259 260 #if OS(ANDROID)261 style.setDefaults();262 #else263 if (!font || !*font)264 style.setDefaults(); // It's probably a webfont. Take the system defaults.265 else if (WebKit::Platform::current()->sandboxSupport())266 WebKit::Platform::current()->sandboxSupport()->getRenderStyleForStrike(font, sizeAndStyle, &style);267 else268 WebFontInfo::renderStyleForStrike(font, sizeAndStyle, &style);269 #endif270 271 style.toFontRenderStyle(result);272 }273 256 #endif 274 257
Note: See TracChangeset
for help on using the changeset viewer.