Changeset 100283 in webkit
- Timestamp:
- Nov 15, 2011, 8:17:25 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r100282 r100283 1 2011-11-15 Cary Clark <caryclark@google.com> 2 3 [chromium-mac] Enable vertical text using Skia 4 https://bugs.webkit.org/show_bug.cgi?id=72137 5 6 Ignore vertical text tests on Skia on Mac for now. 7 8 Reviewed by Stephen White. 9 10 * platform/chromium/test_expectations.txt: 11 1 12 2011-11-15 Eric Carlson <eric.carlson@apple.com> 2 13 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r100282 r100283 3887 3887 BUGWK59552 MAC DEBUG : http/tests/security/cross-frame-access-custom.html = PASS CRASH 3888 3888 3889 // use Skia to draw vertical text directly instead of text-on-path 3890 BUG_CARYCLARK MAC CPU : editing/selection/vertical-lr-ltr-extend-line-backward-br.html = IMAGE 3891 BUG_CARYCLARK MAC CPU : editing/selection/vertical-lr-ltr-extend-line-forward-br.html = IMAGE 3892 BUG_CARYCLARK MAC CPU : editing/selection/vertical-rl-ltr-extend-line-backward-br.html = IMAGE 3893 BUG_CARYCLARK MAC CPU : editing/selection/vertical-rl-ltr-extend-line-backward-p.html = IMAGE 3894 BUG_CARYCLARK MAC CPU : editing/selection/vertical-rl-ltr-extend-line-backward-wrap.html = IMAGE 3895 BUG_CARYCLARK MAC CPU : editing/selection/vertical-rl-ltr-extend-line-forward-br.html = IMAGE 3896 BUG_CARYCLARK MAC CPU : editing/selection/vertical-rl-ltr-extend-line-forward-p.html = IMAGE 3897 BUG_CARYCLARK MAC CPU : editing/selection/vertical-rl-ltr-extend-line-forward-wrap.html = IMAGE 3898 BUG_CARYCLARK MAC CPU : fast/dynamic/text-combine.html = IMAGE 3899 BUG_CARYCLARK MAC CPU : fast/repaint/japanese-rl-selection-clear.html = IMAGE 3900 BUG_CARYCLARK MAC CPU : fast/repaint/japanese-rl-selection-repaint-in-regions.html = IMAGE 3901 BUG_CARYCLARK MAC CPU : fast/repaint/japanese-rl-selection-repaint.html = IMAGE 3902 BUG_CARYCLARK MAC CPU : fast/repaint/repaint-across-writing-mode-boundary.html = IMAGE 3903 BUG_CARYCLARK SNOWLEOPARD LION CPU : fast/text/international/vertical-text-glyph-test.html = IMAGE 3904 BUG_CARYCLARK SNOWLEOPARD LION CPU : fast/text/justify-ideograph-vertical.html = IMAGE 3905 BUG_CARYCLARK MAC CPU : fast/writing-mode/Kusa-Makura-background-canvas.html = IMAGE 3906 BUG_CARYCLARK MAC CPU : fast/writing-mode/border-vertical-lr.html = IMAGE 3907 BUG_CARYCLARK MAC CPU : fast/writing-mode/broken-ideographic-font.html = IMAGE 3908 BUG_CARYCLARK MAC CPU : fast/writing-mode/fallback-orientation.html = IMAGE 3909 BUG_CARYCLARK MAC CPU : fast/writing-mode/japanese-lr-text.html = IMAGE 3910 BUG_CARYCLARK LION CPU : fast/writing-mode/japanese-rl-text-with-broken-font.html = IMAGE 3911 BUG_CARYCLARK SNOWLEOPARD CPU RELEASE : fast/writing-mode/japanese-rl-text-with-broken-font.html = IMAGE 3912 BUG_CARYCLARK MAC CPU : fast/writing-mode/japanese-rl-text.html = IMAGE 3913 BUG_CARYCLARK MAC CPU : fast/writing-mode/japanese-ruby-vertical-lr.html = IMAGE 3914 BUG_CARYCLARK MAC CPU : fast/writing-mode/japanese-ruby-vertical-rl.html = IMAGE 3915 BUG_CARYCLARK SNOWLEOPARD LION CPU : fast/writing-mode/text-orientation-basic.html = IMAGE 3916 BUG_CARYCLARK MAC CPU : fast/writing-mode/vertical-align-table-baseline.html = IMAGE 3917 BUG_CARYCLARK MAC CPU : fast/writing-mode/vertical-baseline-alignment.html = IMAGE 3918 BUG_CARYCLARK MAC CPU : fast/writing-mode/vertical-font-fallback.html = IMAGE 3919 3889 3920 BUGWK72271 MAC DEBUG : fast/loader/javascript-url-in-embed.html = PASS CRASH 3890 3921 -
trunk/Source/WebCore/ChangeLog
r100280 r100283 1 2011-11-15 Cary Clark <caryclark@google.com> 2 3 [chromium-mac] Enable vertical text using Skia 4 https://bugs.webkit.org/show_bug.cgi?id=72137 5 6 Use Skia to draw vertical text. This is much 7 faster and has higher fidelity than the old method 8 of drawing text on a path. 9 10 The graphics context passed to Skia has been 11 rotated 90 degrees but the character advances 12 have not, so it is necessary to unrotate the canvas, 13 and re-rotate the positions. 14 15 This generates correct output (or, at least, 16 consistent with Chromium CG on Mac) for all vertical 17 text tests, one of which is mentioned below. 18 19 Reviewed by Stephen White. 20 21 Test: fast/writing-mode/text-orientation-basic.html 22 23 * platform/graphics/skia/FontSkia.cpp: 24 (WebCore::setupPaint): 25 (WebCore::Font::drawGlyphs): 26 1 27 2011-11-15 Philip Rogers <pdr@google.com> 2 28 -
trunk/Source/WebCore/platform/graphics/skia/FontSkia.cpp
r97058 r100283 80 80 paint->setEmbeddedBitmapText(false); 81 81 paint->setTextSize(SkFloatToScalar(textSize)); 82 paint->setVerticalText(platformData.orientation() == Vertical); 82 83 SkTypeface* typeface = SkCreateTypefaceFromCTFont(platformData.ctFont()); 83 84 SkAutoUnref autoUnref(typeface); … … 123 124 SkScalar y = SkFloatToScalar(point.y()); 124 125 126 if (font->platformData().orientation() == Vertical) 127 y += SkFloatToScalar(font->fontMetrics().floatAscent(IdeographicBaseline) - font->fontMetrics().floatAscent()); 125 128 // FIXME: text rendering speed: 126 129 // Android has code in their WebCore fork to special case when the … … 130 133 // here. 131 134 const GlyphBufferAdvance* adv = glyphBuffer.advances(from); 132 SkAutoSTMalloc<32, SkPoint> storage(numGlyphs) , storage2(numGlyphs), storage3(numGlyphs);135 SkAutoSTMalloc<32, SkPoint> storage(numGlyphs); 133 136 SkPoint* pos = storage.get(); 134 SkPoint* vPosBegin = storage2.get();135 SkPoint* vPosEnd = storage3.get();136 137 137 bool isVertical = font->platformData().orientation() == Vertical;138 138 for (int i = 0; i < numGlyphs; i++) { 139 SkScalar myWidth = SkFloatToScalar(adv[i].width);140 139 pos[i].set(x, y); 141 if (isVertical) { 142 vPosBegin[i].set(x + myWidth, y); 143 vPosEnd[i].set(x + myWidth, y - myWidth); 144 } 145 x += myWidth; 140 x += SkFloatToScalar(adv[i].width); 146 141 y += SkFloatToScalar(adv[i].height); 147 142 } 148 143 149 144 SkCanvas* canvas = gc->platformContext()->canvas(); 145 if (font->platformData().orientation() == Vertical) { 146 canvas->save(); 147 canvas->rotate(-90); 148 SkMatrix rotator; 149 rotator.reset(); 150 rotator.setRotate(90); 151 rotator.mapPoints(pos, numGlyphs); 152 } 150 153 TextDrawingModeFlags textMode = gc->platformContext()->getTextDrawingMode(); 151 154 … … 159 162 paint.setColor(gc->fillColor().rgb()); 160 163 161 if (isVertical) { 162 SkPath path; 163 for (int i = 0; i < numGlyphs; ++i) { 164 path.reset(); 165 path.moveTo(vPosBegin[i]); 166 path.lineTo(vPosEnd[i]); 167 canvas->drawTextOnPath(glyphs + i, sizeof(uint16_t), path, 0, paint); 168 } 169 } else 170 canvas->drawPosText(glyphs, numGlyphs * sizeof(uint16_t), pos, paint); 164 canvas->drawPosText(glyphs, numGlyphs * sizeof(uint16_t), pos, paint); 171 165 } 172 166 … … 188 182 } 189 183 190 if (isVertical) { 191 SkPath path; 192 for (int i = 0; i < numGlyphs; ++i) { 193 path.reset(); 194 path.moveTo(vPosBegin[i]); 195 path.lineTo(vPosEnd[i]); 196 canvas->drawTextOnPath(glyphs + i, sizeof(uint16_t), path, 0, paint); 197 } 198 } else 199 canvas->drawPosText(glyphs, numGlyphs * sizeof(uint16_t), pos, paint); 184 canvas->drawPosText(glyphs, numGlyphs * sizeof(uint16_t), pos, paint); 200 185 } 186 if (font->platformData().orientation() == Vertical) 187 canvas->restore(); 201 188 } 202 189
Note:
See TracChangeset
for help on using the changeset viewer.