Changeset 91069 in webkit


Ignore:
Timestamp:
Jul 15, 2011 8:27:30 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

[skia] remove legacy draw-text-as-paths code, as skia now draws all text as text
https://bugs.webkit.org/show_bug.cgi?id=64368

Patch by Mike Reed <reed@google.com> on 2011-07-15
Reviewed by James Robinson.

Source/WebCore:

  • platform/graphics/chromium/FontChromiumWin.cpp:

(WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::drawGlyphs):

  • platform/graphics/chromium/FontPlatformDataChromiumWin.cpp:

(WebCore::FontPlatformData::RefCountedHFONT::~RefCountedHFONT):

  • platform/graphics/chromium/UniscribeHelper.cpp:

(WebCore::UniscribeHelper::draw):

  • platform/graphics/skia/SkiaFontWin.cpp:

(WebCore::skiaDrawText):
(WebCore::setupPaintForFont):
(WebCore::paintSkiaText):

  • platform/graphics/skia/SkiaFontWin.h:

LayoutTests:

  • platform/chromium/test_expectations.txt:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r91067 r91069  
     12011-07-15  Mike Reed  <reed@google.com>
     2
     3        [skia] remove legacy draw-text-as-paths code, as skia now draws all text as text
     4        https://bugs.webkit.org/show_bug.cgi?id=64368
     5
     6        Reviewed by James Robinson.
     7
     8        * platform/chromium/test_expectations.txt:
     9
    1102011-07-15  Gabor Loki  <loki@webkit.org>
    211
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r91055 r91069  
    33823382BUGWK60125 : fast/files/create-blob-url-crash.html = CRASH PASS
    33833383
     3384// Need rebaselining
     3385BUGWK64368 WIN : editing/selection/vertical-rl-rtl-extend-line-forward-br.html = IMAGE
     3386BUGWK64368 WIN : editing/selection/vertical-rl-ltr-extend-line-backward-p.html = IMAGE
     3387BUGWK64368 WIN : fast/backgrounds/repeat/negative-offset-repeat-transformed.html = IMAGE
     3388BUGWK64368 WIN : fast/block/lineboxcontain/inline-box-vertical.html = IMAGE
     3389BUGWK64368 WIN : fast/block/positioning/auto/vertical-lr/002.html = IMAGE
     3390BUGWK64368 WIN : editing/selection/vertical-lr-ltr-extend-line-backward-br.html = IMAGE
     3391BUGWK64368 WIN : http/tests/loading/simple-subframe.html = IMAGE
     3392BUGWK64368 WIN : fast/block/positioning/auto/vertical-rl/004.html = IMAGE
     3393BUGWK64368 WIN : fast/block/positioning/vertical-rl/fixed-positioning.html = IMAGE
     3394BUGWK64368 WIN : editing/selection/vertical-rl-rtl-extend-line-forward-p.html = IMAGE
     3395BUGWK64368 WIN : fast/block/positioning/vertical-lr/001.html = IMAGE
     3396BUGWK64368 WIN : fast/block/positioning/auto/vertical-rl/002.html = IMAGE
     3397BUGWK64368 WIN : fast/block/positioning/auto/vertical-lr/001.html = IMAGE
     3398BUGWK64368 WIN : fast/backgrounds/svg-as-background-5.html = IMAGE
     3399BUGWK64368 WIN : fast/blockflow/box-shadow-vertical-lr.html = IMAGE
     3400BUGWK64368 WIN : fast/block/positioning/vertical-rl/001.html = IMAGE
     3401BUGWK64368 WIN : editing/selection/vertical-rl-ltr-extend-line-forward-wrap.html = IMAGE
     3402BUGWK64368 WIN : fast/block/positioning/auto/vertical-lr/003.html = IMAGE
     3403BUGWK64368 WIN : fast/block/positioning/vertical-lr/002.html = IMAGE
     3404BUGWK64368 WIN : fast/block/positioning/auto/vertical-rl/001.html = IMAGE
     3405BUGWK64368 WIN : fast/canvas/canvas-text-alignment.html = IMAGE
     3406BUGWK64368 WIN : fast/block/positioning/vertical-rl/002.html = IMAGE
     3407BUGWK64368 WIN : editing/selection/vertical-rl-ltr-extend-line-backward-wrap.html = IMAGE
     3408BUGWK64368 WIN : fast/blockflow/vertical-lr-replaced-selection.html = IMAGE
     3409BUGWK64368 WIN : fast/block/positioning/auto/vertical-lr/004.html = IMAGE
     3410BUGWK64368 WIN : fast/block/positioning/auto/vertical-rl/003.html = IMAGE
     3411BUGWK64368 WIN : fast/css/h1-in-section-elements.html = IMAGE
     3412BUGWK64368 WIN : fast/forms/placeholder-position.html = IMAGE
     3413BUGWK64368 WIN : fast/dom/scroll-reveal-top-overflow.html = IMAGE
     3414BUGWK64368 WIN : editing/selection/vertical-lr-ltr-extend-line-forward-br.html = IMAGE
     3415BUGWK64368 WIN : fast/blockflow/english-rl-text.html = IMAGE
     3416BUGWK64368 WIN : fast/lists/003-vertical.html = IMAGE
     3417BUGWK64368 WIN : fast/html/details-writing-mode.html = IMAGE
     3418BUGWK64368 WIN : fast/multicol/vertical-lr/float-multicol.html = IMAGE
     3419BUGWK64368 WIN : editing/selection/vertical-rl-ltr-extend-line-forward-p.html = IMAGE
     3420BUGWK64368 WIN : fast/overflow/overflow-rtl-vertical.html = IMAGE
     3421BUGWK64368 WIN : fast/multicol/vertical-rl/column-break-with-balancing.html = IMAGE
     3422BUGWK64368 WIN : fast/blockflow/vertical-align-table-baseline.html = IMAGE
     3423BUGWK64368 WIN : http/tests/misc/location-replace-crossdomain.html = IMAGE
     3424BUGWK64368 WIN : fast/lists/002-vertical.html = IMAGE
     3425BUGWK64368 WIN : editing/selection/vertical-rl-ltr-extend-line-forward-br.html = IMAGE
     3426BUGWK64368 WIN : fast/replaced/vertical-lr/absolute-position-percentage-width.html = IMAGE
     3427BUGWK64368 WIN : fast/blockflow/border-radius-clipping-vertical-lr.html = IMAGE
     3428BUGWK64368 WIN : fast/multicol/vertical-rl/float-avoidance.html = IMAGE
     3429BUGWK64368 WIN : fast/multicol/vertical-lr/float-avoidance.html = IMAGE
     3430BUGWK64368 WIN : fast/repaint/shadow-multiple-strict-vertical.html = IMAGE
     3431BUGWK64368 WIN : fast/lists/007-vertical.html = IMAGE
     3432BUGWK64368 WIN : fast/replaced/vertical-lr/absolute-position-with-auto-height-and-top-and-bottom.html = IMAGE
     3433BUGWK64368 WIN : fast/blockflow/vertical-rl-replaced-selection.html = IMAGE
     3434BUGWK64368 WIN : http/tests/misc/acid2-pixel.html = IMAGE
     3435BUGWK64368 WIN : editing/selection/vertical-rl-ltr-extend-line-backward-br.html = IMAGE
     3436BUGWK64368 WIN : fast/multicol/vertical-rl/float-multicol.html = IMAGE
     3437BUGWK64368 WIN : fast/multicol/vertical-lr/column-rules.html = IMAGE
     3438BUGWK64368 WIN : fast/repaint/selection-rl.html = IMAGE
     3439BUGWK64368 WIN : fast/lists/005-vertical.html = IMAGE
     3440BUGWK64368 WIN : fast/replaced/vertical-lr/absolute-position-with-auto-width-and-left-and-right.html = IMAGE
     3441BUGWK64368 WIN : fast/blockflow/box-shadow-vertical-rl.html = IMAGE
     3442BUGWK64368 WIN : editing/selection/vertical-rl-rtl-extend-line-backward-br.html = IMAGE
     3443BUGWK64368 WIN : fast/multicol/vertical-rl/unsplittable-inline-block.html = IMAGE
     3444BUGWK64368 WIN : fast/multicol/vertical-lr/nested-columns.html = IMAGE
     3445BUGWK64368 WIN : fast/lists/008-vertical.html = IMAGE
     3446BUGWK64368 WIN : fast/replaced/vertical-rl/absolute-position-with-auto-height-and-top-and-bottom.html = IMAGE
     3447BUGWK64368 WIN : editing/selection/vertical-rl-rtl-extend-line-backward-p.html = IMAGE
     3448BUGWK64368 WIN : http/tests/misc/iframe404.html = IMAGE
     3449BUGWK64368 WIN : fast/multicol/vertical-rl/column-count-with-rules.html = IMAGE
     3450BUGWK64368 WIN : fast/blockflow/japanese-rl-text-with-broken-font.html = IMAGE
     3451BUGWK64368 WIN : fast/multicol/vertical-lr/unsplittable-inline-block.html = IMAGE
     3452BUGWK64368 WIN : fast/repaint/shadow-multiple-strict-horizontal.html = IMAGE
     3453BUGWK64368 WIN : fast/replaced/vertical-rl/absolute-position-with-auto-width-and-left-and-right.html = IMAGE
     3454BUGWK64368 WIN : fast/lists/001-vertical.html = IMAGE
     3455BUGWK64368 WIN : fast/ruby/overhang-vertical.html = IMAGE
     3456BUGWK64368 WIN : fast/table/table-display-types-vertical.html = IMAGE
     3457BUGWK64368 WIN : fast/multicol/vertical-rl/nested-columns.html = IMAGE
     3458BUGWK64368 WIN : fast/multicol/vertical-lr/border-padding-pagination.html = IMAGE
     3459BUGWK64368 WIN : fast/replaced/vertical-rl/absolute-position-percentage-width.html = IMAGE
     3460BUGWK64368 WIN : fast/lists/009-vertical.html = IMAGE
     3461BUGWK64368 WIN : fast/repaint/shadow-multiple-vertical.html = IMAGE
     3462BUGWK64368 WIN : fast/table/border-collapsing/rtl-border-collapsing-vertical.html = IMAGE
     3463BUGWK64368 WIN : fast/table/038-vertical.html = IMAGE
     3464BUGWK64368 WIN : fast/multicol/vertical-rl/column-rules.html = IMAGE
     3465BUGWK64368 WIN : fast/transforms/transform-table-row.html = IMAGE
     3466BUGWK64368 WIN : fast/multicol/vertical-lr/column-break-with-balancing.html = IMAGE
     3467BUGWK64368 WIN : fast/lists/006-vertical.html = IMAGE
     3468BUGWK64368 WIN : fast/table/border-collapsing/004-vertical.html = IMAGE
     3469BUGWK64368 WIN : http/tests/multipart/invalid-image-data-standalone.html = IMAGE
     3470BUGWK64368 WIN : fast/table/auto-with-percent-height-vertical.html = IMAGE
     3471BUGWK64368 WIN : fast/multicol/vertical-rl/border-padding-pagination.html = IMAGE
     3472BUGWK64368 WIN : fast/repaint/shadow-multiple-horizontal.html = IMAGE
     3473BUGWK64368 WIN : fast/transforms/shadows.html = IMAGE
     3474BUGWK64368 WIN : fast/multicol/vertical-lr/column-count-with-rules.html = IMAGE
     3475BUGWK64368 WIN : fast/table/border-collapsing/border-collapsing-head-foot-vertical.html = IMAGE
     3476BUGWK64368 WIN : media/audio-repaint.html = IMAGE
     3477BUGWK64368 WIN : fast/table/rowspan-paint-order-vertical.html = IMAGE
     3478BUGWK64368 WIN : fast/multicol/vertical-rl/float-paginate-complex.html = IMAGE
     3479BUGWK64368 WIN : platform/chromium/fast/text/text-stroke-with-border.html = IMAGE
     3480BUGWK64368 WIN : fast/transforms/transformed-document-element.html = IMAGE
     3481BUGWK64368 WIN : fast/table/border-collapsing/003-vertical.html = IMAGE
     3482BUGWK64368 WIN : fast/multicol/vertical-lr/float-paginate.html = IMAGE
     3483BUGWK64368 WIN : fast/table/027-vertical.html = IMAGE
     3484BUGWK64368 WIN : svg/W3C-I18N/tspan-dirRTL-ubEmbed-in-default-context.svg = IMAGE
     3485BUGWK64368 WIN : fast/multicol/vertical-rl/float-paginate.html = IMAGE
     3486BUGWK64368 WIN : svg/W3C-SVG-1.1/struct-group-03-t.svg = IMAGE
     3487BUGWK64368 WIN : fast/transforms/transform-on-inline.html = IMAGE
     3488BUGWK64368 WIN : http/tests/navigation/javascriptlink-frames.html = IMAGE
     3489BUGWK64368 WIN : fast/table/border-collapsing/001-vertical.html = IMAGE
     3490BUGWK64368 WIN : svg/W3C-SVG-1.1/fonts-kern-01-t.svg = IMAGE
     3491BUGWK64368 WIN : fast/table/035-vertical.html = IMAGE
     3492BUGWK64368 WIN : fast/multicol/vertical-lr/float-paginate-complex.html = IMAGE
     3493BUGWK64368 WIN : svg/W3C-I18N/tspan-direction-ltr.svg = IMAGE
     3494BUGWK64368 WIN : svg/W3C-SVG-1.1-SE/struct-use-14-f.svg = IMAGE
     3495BUGWK64368 WIN : svg/W3C-SVG-1.1/pservers-pattern-01-b.svg = IMAGE
     3496BUGWK64368 WIN : svg/W3C-SVG-1.1-SE/svgdom-over-01-f.svg = IMAGE
     3497BUGWK64368 WIN : svg/W3C-SVG-1.1-SE/text-tspan-02-b.svg = IMAGE
     3498BUGWK64368 WIN : svg/hixie/error/017.xml = IMAGE
     3499BUGWK64368 WIN : svg/carto.net/selectionlist.svg = IMAGE
     3500BUGWK64368 WIN : svg/carto.net/combobox.svg = IMAGE
     3501BUGWK64368 WIN : svg/css/group-with-shadow.svg = IMAGE
     3502BUGWK64368 WIN : svg/css/text-gradient-shadow.svg = IMAGE
     3503BUGWK64368 WIN : svg/css/text-shadow-multiple.xhtml = IMAGE
     3504BUGWK64368 WIN : svg/carto.net/colourpicker.svg = IMAGE
     3505BUGWK64368 WIN : svg/W3C-SVG-1.1/text-deco-01-b.svg = IMAGE
     3506BUGWK64368 WIN : svg/W3C-SVG-1.1/animate-elem-39-t.svg = IMAGE
     3507BUGWK64368 WIN : svg/transforms/text-with-pattern-with-svg-transform.svg = IMAGE
     3508BUGWK64368 WIN : svg/W3C-I18N/tspan-dirRTL-ubNone-in-default-context.svg = IMAGE
     3509BUGWK64368 WIN : svg/wicd/test-scalable-background-image2.xhtml = IMAGE
     3510BUGWK64368 WIN : svg/batik/paints/patternPreserveAspectRatioA.svg = IMAGE
     3511BUGWK64368 WIN : svg/text/text-path-middle-align.svg = IMAGE
     3512BUGWK64368 WIN : fast/table/028-vertical.html = IMAGE
     3513BUGWK64368 WIN : svg/W3C-I18N/tspan-dirRTL-ubOverride-in-ltr-context.svg = IMAGE
     3514BUGWK64368 WIN : svg/carto.net/window.svg = IMAGE
     3515BUGWK64368 WIN : svg/text/selection-styles.xhtml = IMAGE
     3516BUGWK64368 WIN : svg/W3C-I18N/tspan-dirRTL-ubEmbed-in-ltr-context.svg = IMAGE
     3517BUGWK64368 WIN : svg/dynamic-updates/SVGFEMorphologyElement-dom-in-attr.html = IMAGE
     3518BUGWK64368 WIN : svg/custom/use-on-disallowed-foreign-object-6.svg = IMAGE
     3519BUGWK64368 WIN : svg/W3C-I18N/tspan-dirRTL-ubOverride-in-default-context.svg = IMAGE
     3520BUGWK64368 WIN : transforms/2d/transform-origin-borderbox.html = IMAGE
     3521BUGWK64368 WIN : svg/W3C-SVG-1.1/text-text-08-b.svg = IMAGE
     3522BUGWK64368 WIN : svg/custom/text-rotation.svg = IMAGE
     3523BUGWK64368 WIN : svg/W3C-I18N/tspan-dirNone-ubOverride-in-rtl-context.svg = IMAGE
     3524BUGWK64368 WIN : svg/W3C-SVG-1.1/filters-example-01-b.svg = IMAGE
     3525BUGWK64368 WIN : svg/text/text-path-01-b.svg = IMAGE
     3526BUGWK64368 WIN : svg/text/selection-background-color.xhtml = IMAGE
     3527BUGWK64368 WIN : transforms/2d/compound-transforms-vs-containers.html = IMAGE
     3528BUGWK64368 WIN : svg/custom/use-on-disallowed-foreign-object-4.svg = IMAGE
     3529BUGWK64368 WIN : svg/batik/text/textOnPathSpaces.svg = IMAGE
     3530BUGWK64368 WIN : svg/W3C-SVG-1.1/types-basicDOM-01-b.svg = IMAGE
     3531BUGWK64368 WIN : svg/text/text-text-07-t.svg = IMAGE
     3532BUGWK64368 WIN : svg/W3C-I18N/tspan-dirRTL-ubNone-in-ltr-context.svg = IMAGE
     3533BUGWK64368 WIN : svg/W3C-SVG-1.1/pservers-grad-11-b.svg = IMAGE
     3534BUGWK64368 WIN : svg/custom/text-repaint-including-stroke.svg = IMAGE
     3535BUGWK64368 WIN : svg/text/text-gradient-positioning.svg = IMAGE
     3536BUGWK64368 WIN : svg/custom/text-rotated-gradient.svg = IMAGE
     3537BUGWK64368 WIN : svg/custom/text-dom-01-f.svg = IMAGE
     3538BUGWK64368 WIN : svg/text/text-text-08-b.svg = IMAGE
     3539BUGWK64368 WIN : svg/W3C-SVG-1.1/text-path-01-b.svg = IMAGE
     3540BUGWK64368 WIN : svg/dynamic-updates/SVGFEMorphologyElement-dom-operator-attr.html = IMAGE
     3541BUGWK64368 WIN : svg/custom/js-late-gradient-creation.svg = IMAGE
     3542BUGWK64368 WIN : svg/W3C-SVG-1.1/text-text-07-t.svg = IMAGE
     3543BUGWK64368 WIN : svg/text/text-deco-01-b.svg = IMAGE
     3544BUGWK64368 WIN : svg/batik/text/textLayout2.svg = IMAGE
     3545BUGWK64368 WIN : svg/batik/text/textProperties.svg = IMAGE
     3546BUGWK64368 WIN : svg/batik/text/textOnPath3.svg = IMAGE
     3547BUGWK64368 WIN : svg/dynamic-updates/SVGFEMorphologyElement-svgdom-radius-call.html = IMAGE
     3548BUGWK64368 WIN : svg/zoom/page/zoom-foreignObject.svg = IMAGE
     3549BUGWK64368 WIN : svg/dynamic-updates/SVGTextElement-dom-rotate-attr.html = IMAGE
     3550BUGWK64368 WIN : svg/batik/text/verticalTextOnPath.svg = IMAGE
     3551BUGWK64368 WIN : svg/batik/text/textDecoration.svg = IMAGE
     3552BUGWK64368 WIN : svg/dynamic-updates/SVGFEMorphologyElement-svgdom-operator-prop.html = IMAGE
     3553BUGWK64368 WIN : svg/dynamic-updates/SVGFEMorphologyElement-svgdom-in-prop.html = IMAGE
     3554BUGWK64368 WIN : svg/dynamic-updates/SVGFEMorphologyElement-dom-radius-attr.html = IMAGE
     3555BUGWK64368 WIN : svg/batik/text/textStyles.svg = IMAGE
     3556BUGWK64368 WIN : svg/batik/text/textGlyphOrientationHorizontal.svg = IMAGE
     3557BUGWK64368 WIN : svg/batik/text/textOnPath2.svg = IMAGE
     3558BUGWK64368 WIN : svg/batik/text/textOnPath.svg = IMAGE
     3559BUGWK64368 WIN : svg/custom/pointer-events-text.svg = IMAGE
     3560BUGWK64368 WIN : svg/batik/text/textFeatures.svg = IMAGE
     3561BUGWK64368 WIN : svg/custom/text-linking.svg = IMAGE
     3562BUGWK64368 WIN : svg/custom/focus-ring.svg = IMAGE
     3563BUGWK64368 WIN : svg/custom/use-on-non-svg-namespaced-element.svg = IMAGE
     3564BUGWK64368 WIN : svg/custom/use-on-disallowed-foreign-object-2.svg = IMAGE
     3565BUGWK64368 WIN : svg/custom/struct-use-09-b.svg = IMAGE
     3566BUGWK64368 WIN : svg/custom/linking-a-03-b-viewBox-transform.svg = IMAGE
     3567BUGWK64368 WIN : svg/custom/use-on-text.svg = IMAGE
     3568BUGWK64368 WIN : svg/custom/pattern-with-transformation.svg = IMAGE
     3569BUGWK64368 WIN : svg/custom/use-on-disallowed-foreign-object-3.svg = IMAGE
     3570BUGWK64368 WIN : svg/custom/use-on-disallowed-foreign-object-1.svg = IMAGE
     3571BUGWK64368 WIN : svg/custom/foreign-object-skew.svg = IMAGE
     3572BUGWK64368 WIN : svg/custom/use-on-disallowed-foreign-object-5.svg = IMAGE
     3573BUGWK64368 WIN : svg/custom/linking-a-03-b-all.svg = IMAGE
     3574BUGWK64368 WIN : svg/custom/use-detach.svg = IMAGE
     3575BUGWK64368 WIN : svg/custom/linking-a-03-b-transform.svg = IMAGE
     3576BUGWK64368 WIN : svg/custom/js-late-pattern-creation.svg = IMAGE
     3577BUGWK64368 WIN : svg/W3C-I18N/tspan-dirNone-ubOverride-in-default-context.svg = IMAGE TEXT
     3578BUGWK64368 WIN : svg/W3C-I18N/tspan-dirNone-ubOverride-in-ltr-context.svg = IMAGE TEXT
     3579BUGWK64368 WIN : svg/W3C-I18N/tspan-dirLTR-ubOverride-in-default-context.svg = IMAGE TEXT
     3580BUGWK64368 WIN : svg/W3C-I18N/tspan-dirLTR-ubOverride-in-ltr-context.svg = IMAGE TEXT
     3581BUGWK64368 WIN : svg/text/bidi-text-query.svg = IMAGE TEXT
     3582
    33843583// flakiness
    33853584BUGDPRANKE : fast/dom/Document/document-reopen.html = TEXT PASS
     
    33953594BUGWK60115 LEOPARD : fast/text/shadow-translucent-fill.html = IMAGE
    33963595BUGWK60115 MAC : fast/transforms/shadows.html = IMAGE PASS
    3397 BUGWK60115 XP : svg/css/group-with-shadow.svg = IMAGE
     3596//BUGWK60115 XP : svg/css/group-with-shadow.svg = IMAGE
    33983597BUGWK60115 WIN : transitions/svg-text-shadow-transition.html = IMAGE
    33993598BUGWK60115 WIN : svg/css/composite-shadow-text.svg = IMAGE
  • trunk/Source/WebCore/ChangeLog

    r91067 r91069  
     12011-07-15  Mike Reed  <reed@google.com>
     2
     3        [skia] remove legacy draw-text-as-paths code, as skia now draws all text as text
     4        https://bugs.webkit.org/show_bug.cgi?id=64368
     5
     6        Reviewed by James Robinson.
     7
     8        * platform/graphics/chromium/FontChromiumWin.cpp:
     9        (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::drawGlyphs):
     10        * platform/graphics/chromium/FontPlatformDataChromiumWin.cpp:
     11        (WebCore::FontPlatformData::RefCountedHFONT::~RefCountedHFONT):
     12        * platform/graphics/chromium/UniscribeHelper.cpp:
     13        (WebCore::UniscribeHelper::draw):
     14        * platform/graphics/skia/SkiaFontWin.cpp:
     15        (WebCore::skiaDrawText):
     16        (WebCore::setupPaintForFont):
     17        (WebCore::paintSkiaText):
     18        * platform/graphics/skia/SkiaFontWin.h:
     19
    1202011-07-15  Piroska András  <Piroska.Andras@stud.u-szeged.hu>
    221
  • trunk/Source/WebCore/platform/graphics/chromium/FontChromiumWin.cpp

    r90874 r91069  
    263263        SkPoint origin = m_point;
    264264        origin.fX += SkFloatToScalar(startAdvance);
    265         return paintSkiaText(m_graphicsContext, m_font->platformData().hfont(),
    266                              numGlyphs, glyphs, advances, 0, &origin);
     265        paintSkiaText(m_graphicsContext, m_font->platformData().hfont(),
     266                      numGlyphs, glyphs, advances, 0, &origin);
     267        return true;
    267268    }
    268269
  • trunk/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp

    r79174 r91069  
    111111{
    112112    if (m_hfont != reinterpret_cast<HFONT>(-1)) {
    113         SkiaWinOutlineCache::removePathsForFont(m_hfont);
    114113        DeleteObject(m_hfont);
    115114    }
  • trunk/Source/WebCore/platform/graphics/chromium/UniscribeHelper.cpp

    r84264 r91069  
    377377                    origin.fX = curX + + innerOffset;
    378378                    origin.fY = y + m_ascent;
    379                     textOutOk = paintSkiaText(graphicsContext,
    380                                               shaping.m_hfont,
    381                                               glyphCount,
    382                                               &shaping.m_glyphs[fromGlyph],
    383                                               &shaping.m_advance[fromGlyph],
    384                                               &shaping.m_offsets[fromGlyph],
    385                                               &origin);
     379                    paintSkiaText(graphicsContext,
     380                                  shaping.m_hfont,
     381                                  glyphCount,
     382                                  &shaping.m_glyphs[fromGlyph],
     383                                  &shaping.m_advance[fromGlyph],
     384                                  &shaping.m_offsets[fromGlyph],
     385                                  &origin);
     386                    textOutOk = true;
    386387                }
    387388
  • trunk/Source/WebCore/platform/graphics/skia/SkiaFontWin.cpp

    r83541 r91069  
    4242#include "SkTypeface_win.h"
    4343
    44 #include <wtf/ListHashSet.h>
    45 #include <wtf/Vector.h>
    46 
    4744namespace WebCore {
    48 
    49 struct CachedOutlineKey {
    50     CachedOutlineKey() : font(0), glyph(0), path(0) {}
    51     CachedOutlineKey(HFONT f, WORD g) : font(f), glyph(g), path(0) {}
    52 
    53     HFONT font;
    54     WORD glyph;
    55 
    56     // The lifetime of this pointer is managed externally to this class. Be sure
    57     // to call DeleteOutline to remove items.
    58     SkPath* path;
    59 };
    60 
    61 const bool operator==(const CachedOutlineKey& a, const CachedOutlineKey& b)
    62 {
    63     return a.font == b.font && a.glyph == b.glyph;
    64 }
    65 
    66 struct CachedOutlineKeyHash {
    67     static unsigned hash(const CachedOutlineKey& key)
    68     {
    69         unsigned keyBytes;
    70         memcpy(&keyBytes, &key.font, sizeof(unsigned));
    71         return keyBytes + key.glyph;
    72     }
    73 
    74     static unsigned equal(const CachedOutlineKey& a, const CachedOutlineKey& b)
    75     {
    76         return a.font == b.font && a.glyph == b.glyph;
    77     }
    78 
    79     static const bool safeToCompareToEmptyOrDeleted = true;
    80 };
    81 
    82 // The global number of glyph outlines we'll cache.
    83 static const int outlineCacheSize = 256;
    84 
    85 typedef ListHashSet<CachedOutlineKey, outlineCacheSize+1, CachedOutlineKeyHash> OutlineCache;
    86 
    87 // FIXME: Convert from static constructor to accessor function. WebCore tries to
    88 // avoid global constructors to save on start-up time.
    89 static OutlineCache outlineCache;
    90 
    91 static SkScalar FIXEDToSkScalar(FIXED fixed)
    92 {
    93     SkFixed skFixed;
    94     memcpy(&skFixed, &fixed, sizeof(SkFixed));
    95     return SkFixedToScalar(skFixed);
    96 }
    97 
    98 // Removes the given key from the cached outlines, also deleting the path.
    99 static void deleteOutline(OutlineCache::iterator deleteMe)
    100 {
    101     delete deleteMe->path;
    102     outlineCache.remove(deleteMe);
    103 }
    104 
    105 static void addPolyCurveToPath(const TTPOLYCURVE* polyCurve, SkPath* path)
    106 {
    107     switch (polyCurve->wType) {
    108     case TT_PRIM_LINE:
    109         for (WORD i = 0; i < polyCurve->cpfx; i++) {
    110           path->lineTo(FIXEDToSkScalar(polyCurve->apfx[i].x), -FIXEDToSkScalar(polyCurve->apfx[i].y));
    111         }
    112         break;
    113 
    114     case TT_PRIM_QSPLINE:
    115         // FIXME: doesn't this duplicate points if we do the loop > once?
    116         for (WORD i = 0; i < polyCurve->cpfx - 1; i++) {
    117             SkScalar bx = FIXEDToSkScalar(polyCurve->apfx[i].x);
    118             SkScalar by = FIXEDToSkScalar(polyCurve->apfx[i].y);
    119 
    120             SkScalar cx = FIXEDToSkScalar(polyCurve->apfx[i + 1].x);
    121             SkScalar cy = FIXEDToSkScalar(polyCurve->apfx[i + 1].y);
    122             if (i < polyCurve->cpfx - 2) {
    123                 // We're not the last point, compute C.
    124                 cx = SkScalarAve(bx, cx);
    125                 cy = SkScalarAve(by, cy);
    126             }
    127 
    128             // Need to flip the y coordinates since the font's coordinate system is
    129             // flipped from ours vertically.
    130             path->quadTo(bx, -by, cx, -cy);
    131         }
    132         break;
    133 
    134     case TT_PRIM_CSPLINE:
    135         // FIXME
    136         break;
    137     }
    138 }
    139 
    140 // The size of the glyph path buffer.
    141 static const int glyphPathBufferSize = 4096;
    142 
    143 // Fills the given SkPath with the outline for the given glyph index. The font
    144 // currently selected into the given DC is used. Returns true on success.
    145 static bool getPathForGlyph(HDC dc, WORD glyph, SkPath* path)
    146 {
    147     char buffer[glyphPathBufferSize];
    148     GLYPHMETRICS gm;
    149     MAT2 mat = {{0, 1}, {0, 0}, {0, 0}, {0, 1}};  // Each one is (fract,value).
    150 
    151     DWORD totalSize = GetGlyphOutlineW(dc, glyph, GGO_GLYPH_INDEX | GGO_NATIVE,
    152                                        &gm, glyphPathBufferSize, buffer, &mat);
    153     if (totalSize == GDI_ERROR)
    154         return false;
    155 
    156     const char* curGlyph = buffer;
    157     const char* endGlyph = &buffer[totalSize];
    158     while (curGlyph < endGlyph) {
    159         const TTPOLYGONHEADER* polyHeader =
    160             reinterpret_cast<const TTPOLYGONHEADER*>(curGlyph);
    161         path->moveTo(FIXEDToSkScalar(polyHeader->pfxStart.x),
    162                      -FIXEDToSkScalar(polyHeader->pfxStart.y));
    163 
    164         const char* curPoly = curGlyph + sizeof(TTPOLYGONHEADER);
    165         const char* endPoly = curGlyph + polyHeader->cb;
    166         while (curPoly < endPoly) {
    167             const TTPOLYCURVE* polyCurve =
    168                 reinterpret_cast<const TTPOLYCURVE*>(curPoly);
    169             addPolyCurveToPath(polyCurve, path);
    170             curPoly += sizeof(WORD) * 2 + sizeof(POINTFX) * polyCurve->cpfx;
    171         }
    172         path->close();
    173         curGlyph += polyHeader->cb;
    174     }
    175 
    176     return true;
    177 }
    178 
    179 // Returns a SkPath corresponding to the give glyph in the given font. The font
    180 // should be selected into the given DC. The returned path is owned by the
    181 // hashtable. Returns 0 on error.
    182 const SkPath* SkiaWinOutlineCache::lookupOrCreatePathForGlyph(HDC hdc, HFONT font, WORD glyph)
    183 {
    184     CachedOutlineKey key(font, glyph);
    185     OutlineCache::iterator found = outlineCache.find(key);
    186     if (found != outlineCache.end()) {
    187         // Keep in MRU order by removing & reinserting the value.
    188         key = *found;
    189         outlineCache.remove(found);
    190         outlineCache.add(key);
    191         return key.path;
    192     }
    193 
    194     key.path = new SkPath;
    195     if (!getPathForGlyph(hdc, glyph, key.path))
    196       return 0;
    197 
    198     if (outlineCache.size() > outlineCacheSize)
    199         // The cache is too big, find the oldest value (first in the list).
    200         deleteOutline(outlineCache.begin());
    201 
    202     outlineCache.add(key);
    203     return key.path;
    204 }
    205 
    206 
    207 void SkiaWinOutlineCache::removePathsForFont(HFONT hfont)
    208 {
    209     // ListHashSet isn't the greatest structure for deleting stuff out of, but
    210     // removing entries will be relatively rare (we don't remove fonts much, nor
    211     // do we draw out own glyphs using these routines much either).
    212     //
    213     // We keep a list of all glyphs we're removing which we do in a separate
    214     // pass.
    215     Vector<CachedOutlineKey> outlinesToDelete;
    216     for (OutlineCache::iterator i = outlineCache.begin();
    217          i != outlineCache.end(); ++i)
    218         outlinesToDelete.append(*i);
    219 
    220     for (Vector<CachedOutlineKey>::iterator i = outlinesToDelete.begin();
    221          i != outlinesToDelete.end(); ++i)
    222         deleteOutline(outlineCache.find(*i));
    223 }
    22445
    22546bool windowsCanHandleDrawTextShadow(GraphicsContext *context)
     
    27596}
    27697
    277 // Draws the given text string using skia.  Note that gradient or
    278 // pattern may be NULL, in which case a solid colour is used.
    279 static bool skiaDrawText(HFONT hfont,
    280                          HDC dc,
    281                          PlatformContextSkia* platformContext,
     98static void skiaDrawText(SkCanvas* canvas,
    28299                         const SkPoint& point,
    283100                         SkPaint* paint,
     
    287104                         int numGlyphs)
    288105{
    289     SkCanvas* canvas = platformContext->canvas();
    290     if (!platformContext->isNativeFontRenderingAllowed()) {
    291         SkASSERT(sizeof(WORD) == sizeof(uint16_t));
    292 
    293         // Reserve space for 64 glyphs on the stack. If numGlyphs is larger, the array
    294         // will dynamically allocate it space for numGlyph glyphs.
    295         static const size_t kLocalGlyphMax = 64;
    296         SkAutoSTArray<kLocalGlyphMax, SkPoint> posStorage(numGlyphs);
    297         SkPoint* pos = posStorage.get();
    298         SkScalar x = point.fX;
    299         SkScalar y = point.fY;
    300         for (int i = 0; i < numGlyphs; i++) {
    301             pos[i].set(x + (offsets ? offsets[i].du : 0),
    302                        y + (offsets ? offsets[i].dv : 0));
    303             x += SkIntToScalar(advances[i]);
    304         }
    305         canvas->drawPosText(glyphs, numGlyphs * sizeof(uint16_t), pos, *paint);
    306     } else {
    307         float x = point.fX, y = point.fY;
    308 
    309         for (int i = 0; i < numGlyphs; i++) {
    310             const SkPath* path = SkiaWinOutlineCache::lookupOrCreatePathForGlyph(dc, hfont, glyphs[i]);
    311             if (!path)
    312                 return false;
    313 
    314             float offsetX = 0.0f, offsetY = 0.0f;
    315             if (offsets && (offsets[i].du || offsets[i].dv)) {
    316                 offsetX = offsets[i].du;
    317                 offsetY = offsets[i].dv;
    318             }
    319 
    320             SkPath newPath;
    321             newPath.addPath(*path, x + offsetX, y + offsetY);
    322             canvas->drawPath(newPath, *paint);
    323 
    324             x += advances[i];
    325         }
    326     }
    327     return true;
     106    // Reserve space for 64 glyphs on the stack. If numGlyphs is larger, the array
     107    // will dynamically allocate it space for numGlyph glyphs.
     108    static const size_t kLocalGlyphMax = 64;
     109    SkAutoSTArray<kLocalGlyphMax, SkPoint> posStorage(numGlyphs);
     110    SkPoint* pos = posStorage.get();
     111    SkScalar x = point.fX;
     112    SkScalar y = point.fY;
     113    for (int i = 0; i < numGlyphs; i++) {
     114        pos[i].set(x + (offsets ? offsets[i].du : 0),
     115                   y + (offsets ? offsets[i].dv : 0));
     116        x += SkIntToScalar(advances[i]);
     117    }
     118    canvas->drawPosText(glyphs, numGlyphs * sizeof(uint16_t), pos, *paint);
    328119}
    329120
     
    345136    paint->setTypeface(face);
    346137    SkSafeUnref(face);
    347 }
    348 
    349 bool paintSkiaText(GraphicsContext* context,
     138
     139    uint32_t flags = paint->getFlags();
     140    // our defaults
     141    flags |= SkPaint::kAntiAlias_Flag;
     142    flags |= SkPaint::kLCDRenderText_Flag;
     143    switch (info.lfQuality) {
     144    case NONANTIALIASED_QUALITY:
     145        flags &= ~SkPaint::kAntiAlias_Flag;
     146        flags &= ~SkPaint::kLCDRenderText_Flag;
     147        break;
     148    case ANTIALIASED_QUALITY:
     149        flags &= ~SkPaint::kLCDRenderText_Flag;
     150        break;
     151    default:
     152        break;
     153    }
     154    paint->setFlags(flags);
     155}
     156
     157void paintSkiaText(GraphicsContext* context,
    350158                   HFONT hfont,
    351159                   int numGlyphs,
     
    359167
    360168    PlatformContextSkia* platformContext = context->platformContext();
     169    SkCanvas* canvas = platformContext->canvas();
    361170    TextDrawingModeFlags textMode = platformContext->getTextDrawingMode();
    362171
     
    364173    SkPaint paint;
    365174    platformContext->setupPaintForFilling(&paint);
    366     paint.setFlags(SkPaint::kAntiAlias_Flag);
    367     if (!platformContext->isNativeFontRenderingAllowed()) {
    368         paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
    369         setupPaintForFont(hfont, &paint);
    370     }
     175    paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
     176    setupPaintForFont(hfont, &paint);
     177
    371178    bool didFill = false;
    372179
    373180    if ((textMode & TextModeFill) && (SkColorGetA(paint.getColor()) || paint.getLooper())) {
    374         if (!skiaDrawText(hfont, dc, platformContext, *origin, &paint,
    375                           &glyphs[0], &advances[0], &offsets[0], numGlyphs))
    376             return false;
     181        skiaDrawText(canvas, *origin, &paint, &glyphs[0], &advances[0], &offsets[0], numGlyphs);
    377182        didFill = true;
    378183    }
     
    385190        paint.reset();
    386191        platformContext->setupPaintForStroking(&paint, 0, 0);
    387         paint.setFlags(SkPaint::kAntiAlias_Flag);
    388         if (!platformContext->isNativeFontRenderingAllowed()) {
    389             paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
    390             setupPaintForFont(hfont, &paint);
    391         }
     192        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
     193        setupPaintForFont(hfont, &paint);
    392194
    393195        if (didFill) {
     
    404206        }
    405207
    406         if (!skiaDrawText(hfont, dc, platformContext, *origin, &paint,
    407                           &glyphs[0], &advances[0], &offsets[0], numGlyphs))
    408             return false;
     208        skiaDrawText(canvas, *origin, &paint, &glyphs[0], &advances[0], &offsets[0], numGlyphs);
    409209    }
    410210
    411211    SelectObject(dc, oldFont);
    412212    ReleaseDC(0, dc);
    413 
    414     return true;
    415213}
    416214
  • trunk/Source/WebCore/platform/graphics/skia/SkiaFontWin.h

    r83541 r91069  
    3535#include <usp10.h>
    3636
    37 class SkPath;
    3837class SkPoint;
    3938
     
    4241class GraphicsContext;
    4342class PlatformContextSkia;
    44 
    45 // FIXME: Rename file to SkiaWinOutlineCache
    46 class SkiaWinOutlineCache {
    47 public:
    48     static const SkPath* lookupOrCreatePathForGlyph(HDC, HFONT, WORD);
    49     // Removes any cached glyphs from the outline cache corresponding to the
    50     // given font handle.
    51     static void removePathsForFont(HFONT);
    52 
    53 private:
    54     SkiaWinOutlineCache();
    55 };
    5643
    5744// The functions below are used for more complex font drawing (effects such as
     
    8370// Note that the offsets parameter is optional.  If not NULL it represents a
    8471// per glyph offset (such as returned by ScriptPlace Windows API function).
    85 //
    86 // Returns true of the text was drawn successfully. False indicates an error
    87 // from Windows.
    88 bool paintSkiaText(GraphicsContext* graphicsContext,
    89                    HFONT hfont,
     72void paintSkiaText(GraphicsContext*,
     73                   HFONT,
    9074                   int numGlyphs,
    9175                   const WORD* glyphs,
Note: See TracChangeset for help on using the changeset viewer.