Changeset 83451 in webkit


Ignore:
Timestamp:
Apr 11, 2011 10:45:16 AM (13 years ago)
Author:
mitz@apple.com
Message:

Assertion failure in CanvasRenderingContext2D::State::fontsNeedUpdate when invalidating the font cache after opening canvas/philip/tests/initial.reset.2dstate.html (occurs on Qt debug test bot)
https://bugs.webkit.org/show_bug.cgi?id=58229

Reviewed by Alexey Proskuryakov.

  • html/canvas/CanvasRenderingContext2D.cpp:

(WebCore::CanvasRenderingContext2D::State::State): Added copy constructor, to register the copy with
the font selector if needed.
(WebCore::CanvasRenderingContext2D::State::operator=): Added assignment constructor, to handle
registration with the font selector as needed.

  • html/canvas/CanvasRenderingContext2D.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r83450 r83451  
     12011-04-11  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        Assertion failure in CanvasRenderingContext2D::State::fontsNeedUpdate when invalidating the font cache after opening canvas/philip/tests/initial.reset.2dstate.html (occurs on Qt debug test bot)
     6        https://bugs.webkit.org/show_bug.cgi?id=58229
     7
     8        * html/canvas/CanvasRenderingContext2D.cpp:
     9        (WebCore::CanvasRenderingContext2D::State::State): Added copy constructor, to register the copy with
     10        the font selector if needed.
     11        (WebCore::CanvasRenderingContext2D::State::operator=): Added assignment constructor, to handle
     12        registration with the font selector as needed.
     13        * html/canvas/CanvasRenderingContext2D.h:
     14
    1152011-04-11  Mario Sanchez Prada  <msanchez@igalia.com>
    216
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r83396 r83451  
    214214}
    215215
     216CanvasRenderingContext2D::State::State(const State& other)
     217{
     218    m_unparsedStrokeColor = other.m_unparsedStrokeColor;
     219    m_unparsedFillColor = other.m_unparsedFillColor;
     220    m_strokeStyle = other.m_strokeStyle;
     221    m_fillStyle = other.m_fillStyle;
     222    m_lineWidth = other.m_lineWidth;
     223    m_lineCap = other.m_lineCap;
     224    m_lineJoin = other.m_lineJoin;
     225    m_miterLimit = other.m_miterLimit;
     226    m_shadowOffset = other.m_shadowOffset;
     227    m_shadowBlur = other.m_shadowBlur;
     228    m_shadowColor = other.m_shadowColor;
     229    m_globalAlpha = other.m_globalAlpha;
     230    m_globalComposite = other.m_globalComposite;
     231    m_transform = other.m_transform;
     232    m_invertibleCTM = other.m_invertibleCTM;
     233    m_textAlign = other.m_textAlign;
     234    m_textBaseline = other.m_textBaseline;
     235    m_unparsedFont = other.m_unparsedFont;
     236    m_font = other.m_font;
     237    m_realizedFont = other.m_realizedFont;
     238
     239    if (m_realizedFont)
     240        m_font.fontSelector()->registerForInvalidationCallbacks(this);
     241}
     242
     243CanvasRenderingContext2D::State& CanvasRenderingContext2D::State::operator=(const State& other)
     244{
     245    if (this == &other)
     246        return *this;
     247
     248    if (m_realizedFont)
     249        m_font.fontSelector()->unregisterForInvalidationCallbacks(this);
     250
     251    m_unparsedStrokeColor = other.m_unparsedStrokeColor;
     252    m_unparsedFillColor = other.m_unparsedFillColor;
     253    m_strokeStyle = other.m_strokeStyle;
     254    m_fillStyle = other.m_fillStyle;
     255    m_lineWidth = other.m_lineWidth;
     256    m_lineCap = other.m_lineCap;
     257    m_lineJoin = other.m_lineJoin;
     258    m_miterLimit = other.m_miterLimit;
     259    m_shadowOffset = other.m_shadowOffset;
     260    m_shadowBlur = other.m_shadowBlur;
     261    m_shadowColor = other.m_shadowColor;
     262    m_globalAlpha = other.m_globalAlpha;
     263    m_globalComposite = other.m_globalComposite;
     264    m_transform = other.m_transform;
     265    m_invertibleCTM = other.m_invertibleCTM;
     266    m_textAlign = other.m_textAlign;
     267    m_textBaseline = other.m_textBaseline;
     268    m_unparsedFont = other.m_unparsedFont;
     269    m_font = other.m_font;
     270    m_realizedFont = other.m_realizedFont;
     271
     272    if (m_realizedFont)
     273        m_font.fontSelector()->registerForInvalidationCallbacks(this);
     274
     275    return *this;
     276}
     277
    216278CanvasRenderingContext2D::State::~State()
    217279{
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h

    r83396 r83451  
    232232        virtual ~State();
    233233
     234        State(const State&);
     235        State& operator=(const State&);
     236
    234237        virtual void fontsNeedUpdate(FontSelector*);
    235238
Note: See TracChangeset for help on using the changeset viewer.