Changeset 126312 in webkit
- Timestamp:
- Aug 22, 2012 9:53:51 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r126309 r126312 1 2012-08-22 Koji Ishii <kojiishi@gmail.com> 2 3 FontMetrics.unitsPerEm(), FontPlatformData.orientation(), SimpleFontData::platformBoundsForGlyph are not implemented on Chromium Windows 4 https://bugs.webkit.org/show_bug.cgi?id=83512 5 6 Reviewed by Tony Chang. 7 8 Chromium Windows does not implement following 3 functions that are required for bug 51450. 9 1. FontMetrics.unitsPerEm() always returns the default value (gDefaultUnitsPerEm = 1000). 10 This change requires rebaseline of fast/repaint/stacked-diacritics and fast/text/emphasis-overlap. 11 2. FontPlatformData.orientation() always returns Horizontal. This has no effect as of this patch. 12 3. SimpleFontData::platformBoundsForGlyph() always returns FloatRect(). 13 This change improves rendering of text-emphasis and 3 existing tests pass now. 14 Tony suggested in bug 51450 review to split code that is not behind 15 #if ENABLE(OPENTYPE_VERTICAL) to a separate patch. 16 17 * platform/chromium-win/fast/repaint/stacked-diacritics-expected.png: 18 * platform/chromium-win/fast/text/emphasis-overlap-expected.txt: Added due to metrics change. 19 * platform/chromium/TestExpectations: Enabled 3 tests for Chromium Win. 20 1 21 2012-08-22 Dominic Mazzoni <dmazzoni@google.com> 2 22 -
trunk/LayoutTests/platform/chromium/TestExpectations
r126288 r126312 2193 2193 BUGCR67416 LINUX ANDROID WIN : fast/text/emphasis.html = IMAGE+TEXT 2194 2194 BUGCR67416 : fast/text/emphasis-vertical.html = IMAGE IMAGE+TEXT 2195 BUGCR67540 LINUX ANDROID WIN: fast/text/emphasis-overlap.html = IMAGE+TEXT2196 BUGCR67540 LINUX ANDROID WIN: fast/text/emphasis-avoid-ruby.html = IMAGE2195 BUGCR67540 LINUX ANDROID : fast/text/emphasis-overlap.html = IMAGE+TEXT 2196 BUGCR67540 LINUX ANDROID : fast/text/emphasis-avoid-ruby.html = IMAGE 2197 2197 BUGCR67540 LINUX ANDROID WIN SNOWLEOPARD : fast/repaint/text-emphasis-h.html = IMAGE 2198 BUGCR67540 LINUX ANDROID WIN: fast/repaint/text-emphasis-v.html = IMAGE2198 BUGCR67540 LINUX ANDROID : fast/repaint/text-emphasis-v.html = IMAGE 2199 2199 2200 2200 BUGCR67442 LINUX WIN : fast/canvas/fillText-shadow.html = TEXT -
trunk/Source/WebCore/ChangeLog
r126310 r126312 1 2012-08-22 Koji Ishii <kojiishi@gmail.com> 2 3 FontMetrics.unitsPerEm(), FontPlatformData.orientation(), SimpleFontData::platformBoundsForGlyph are not implemented on Chromium Windows 4 https://bugs.webkit.org/show_bug.cgi?id=83512 5 6 Reviewed by Tony Chang. 7 8 Chromium Windows does not implement following 3 functions that are required for bug 51450. 9 1. FontMetrics.unitsPerEm() always returns the default value (gDefaultUnitsPerEm = 1000). 10 2. FontPlatformData.orientation() always returns Horizontal. 11 3. SimpleFontData::platformBoundsForGlyph() always returns FloatRect(). 12 Tony suggested in bug 51450 review to split code that is not behind 13 #if ENABLE(OPENTYPE_VERTICAL) to a separate patch. 14 15 Test: Following 3 existing but skipped tests are now enabled and pass. 16 fast/text/emphasis-overlap.html 17 fast/text/emphasis-avoid-ruby.html 18 fast/repaint/text-emphasis-v.html 19 20 * platform/graphics/chromium/FontCacheChromiumWin.cpp: 21 (WebCore::FontCache::createFontPlatformData): Add orientation. 22 * platform/graphics/chromium/FontPlatformDataChromiumWin.cpp: 23 (WebCore::FontPlatformData::FontPlatformData): Add orientation. 24 (WebCore::FontPlatformData::operator=): Add orientation. 25 * platform/graphics/chromium/FontPlatformDataChromiumWin.h: 26 (FontPlatformData): 27 (WebCore::FontPlatformData::orientation): Add orientation. 28 (WebCore::FontPlatformData::setOrientation): Add orientation. 29 (WebCore::FontPlatformData::operator==): Add orientation. 30 * platform/graphics/chromium/SimpleFontDataChromiumWin.cpp: 31 (WebCore::SimpleFontData::platformInit): Set FontMetrics.unitsPerEm. 32 (WebCore::SimpleFontData::createScaledFontData): Add orientation. 33 (WebCore::SimpleFontData::platformBoundsForGlyph): Implemented. 34 * platform/graphics/skia/FontCustomPlatformData.cpp: 35 (WebCore::FontCustomPlatformData::fontPlatformData): Add orientation. 36 1 37 2012-08-22 Robert Hogan <robert@webkit.org> 2 38 -
trunk/Source/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
r123424 r126312 630 630 631 631 return new FontPlatformData(hfont, 632 fontDescription.computedPixelSize()); 633 } 634 635 } 632 fontDescription.computedPixelSize(), 633 fontDescription.orientation()); 634 } 635 636 } -
trunk/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp
r111344 r126312 33 33 #include "FontPlatformData.h" 34 34 35 #include <windows.h> 36 #include <objidl.h> 37 #include <mlang.h> 38 35 #include "FontCache.h" 39 36 #include "HWndDC.h" 40 37 #include "PlatformSupport.h" 38 #include "SharedBuffer.h" 41 39 #include "SkTypeface_win.h" 42 40 #include "SkiaFontWin.h" 41 42 #include <mlang.h> 43 #include <objidl.h> 44 #include <windows.h> 43 45 #include <wtf/StdLibExtras.h> 44 46 … … 63 65 : m_font(hashTableDeletedFontValue()) 64 66 , m_size(-1) 67 , m_orientation(Horizontal) 65 68 , m_scriptCache(0) 66 69 , m_scriptFontProperties(0) … … 73 76 : m_font(0) 74 77 , m_size(0) 78 , m_orientation(Horizontal) 75 79 , m_scriptCache(0) 76 80 , m_scriptFontProperties(0) … … 80 84 } 81 85 82 FontPlatformData::FontPlatformData(HFONT font, float size )86 FontPlatformData::FontPlatformData(HFONT font, float size, FontOrientation orientation) 83 87 : m_font(RefCountedHFONT::create(font)) 84 88 , m_size(size) 89 , m_orientation(orientation) 85 90 , m_scriptCache(0) 86 91 , m_scriptFontProperties(0) … … 93 98 : m_font(0) 94 99 , m_size(size) 100 , m_orientation(Horizontal) 95 101 , m_scriptCache(0) 96 102 , m_scriptFontProperties(0) … … 103 109 : m_font(data.m_font) 104 110 , m_size(data.m_size) 111 , m_orientation(data.m_orientation) 105 112 , m_scriptCache(0) 106 113 , m_scriptFontProperties(0) … … 116 123 m_font = data.m_font; 117 124 m_size = data.m_size; 125 m_orientation = data.m_orientation; 118 126 SkRefCnt_SafeAssign(m_typeface, data.m_typeface); 119 127 m_lfQuality = data.m_lfQuality; -
trunk/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h
r103262 r126312 65 65 FontPlatformData(); 66 66 // This constructor takes ownership of the HFONT 67 FontPlatformData(HFONT, float size );67 FontPlatformData(HFONT, float size, FontOrientation); 68 68 FontPlatformData(float size, bool bold, bool oblique); 69 69 FontPlatformData(const FontPlatformData&); … … 80 80 int lfQuality() const { return m_lfQuality; } 81 81 82 FontOrientation orientation() const { return Horizontal; } // FIXME: Implement.83 void setOrientation(FontOrientation ) { } // FIXME: Implement.82 FontOrientation orientation() const { return m_orientation; } 83 void setOrientation(FontOrientation orientation) { m_orientation = orientation; } 84 84 85 85 unsigned hash() const … … 90 90 bool operator==(const FontPlatformData& other) const 91 91 { 92 return m_font == other.m_font && m_size == other.m_size ;92 return m_font == other.m_font && m_size == other.m_size && m_orientation == other.m_orientation; 93 93 } 94 94 … … 138 138 RefPtr<RefCountedHFONT> m_font; 139 139 float m_size; // Point size of the font in pixels. 140 FontOrientation m_orientation; 140 141 141 142 SkTypeface* m_typeface; // cached from m_font -
trunk/Source/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
r105654 r126312 82 82 OUTLINETEXTMETRIC outlineTextMetric; 83 83 if (GetOutlineTextMetrics(dc, sizeof(outlineTextMetric), &outlineTextMetric) > 0) { 84 m_fontMetrics.setUnitsPerEm(outlineTextMetric.otmEMSquare); 85 84 86 // This is a TrueType font. We might be able to get an accurate xHeight. 85 87 GLYPHMETRICS glyphMetrics = {0}; … … 115 117 winFont.lfHeight = -lroundf(scaledSize); 116 118 HFONT hfont = CreateFontIndirect(&winFont); 117 return adoptPtr(new SimpleFontData(FontPlatformData(hfont, scaledSize ), isCustomFont(), false));119 return adoptPtr(new SimpleFontData(FontPlatformData(hfont, scaledSize, m_platformData.orientation()), isCustomFont(), false)); 118 120 } 119 121 … … 169 171 } 170 172 171 FloatRect SimpleFontData::platformBoundsForGlyph(Glyph) const 172 { 173 return FloatRect(); 173 FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const 174 { 175 HWndDC hdc(0); 176 SetGraphicsMode(hdc, GM_ADVANCED); 177 HGDIOBJ oldFont = SelectObject(hdc, m_platformData.hfont()); 178 179 GLYPHMETRICS gdiMetrics; 180 static const MAT2 identity = { 0, 1, 0, 0, 0, 0, 0, 1 }; 181 if (GetGlyphOutline(hdc, glyph, GGO_METRICS | GGO_GLYPH_INDEX, &gdiMetrics, 0, 0, &identity) == -1) { 182 if (PlatformSupport::ensureFontLoaded(m_platformData.hfont())) { 183 // Retry GetTextMetrics. 184 // FIXME: Handle gracefully the error if this call also fails. 185 // See http://crbug.com/6401. 186 if (GetGlyphOutline(hdc, glyph, GGO_METRICS | GGO_GLYPH_INDEX, &gdiMetrics, 0, 0, &identity) == -1) 187 LOG_ERROR("Unable to get the glyph metrics after second attempt"); 188 } 189 } 190 191 SelectObject(hdc, oldFont); 192 193 return FloatRect(gdiMetrics.gmptGlyphOrigin.x, -gdiMetrics.gmptGlyphOrigin.y, 194 gdiMetrics.gmBlackBoxX, gdiMetrics.gmBlackBoxY); 174 195 } 175 196 -
trunk/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp
r123424 r126312 101 101 102 102 HFONT hfont = CreateFontIndirect(&logFont); 103 return FontPlatformData(hfont, size );103 return FontPlatformData(hfont, size, orientation); 104 104 #elif OS(UNIX) 105 105 ASSERT(m_fontReference);
Note: See TracChangeset
for help on using the changeset viewer.