Changeset 93724 in webkit


Ignore:
Timestamp:
Aug 24, 2011, 1:04:44 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

Crash when restoring NSGraphicsContext when running the Chromium GPU layout tests on Mac
https://bugs.webkit.org/show_bug.cgi?id=66875

Patch by Avi Drissman <avi@google.com> on 2011-08-24
Reviewed by James Robinson.

  • DumpRenderTree/chromium/WebThemeEngineDRTMac.mm:

(WebThemeEngineDRTMac::paintNSScrollerScrollbarThumb):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r93691 r93724  
     12011-08-24  Avi Drissman  <avi@google.com>
     2
     3        Crash when restoring NSGraphicsContext when running the Chromium GPU layout tests on Mac
     4        https://bugs.webkit.org/show_bug.cgi?id=66875
     5
     6        Reviewed by James Robinson.
     7
     8        * DumpRenderTree/chromium/WebThemeEngineDRTMac.mm:
     9        (WebThemeEngineDRTMac::paintNSScrollerScrollbarThumb):
     10
    1112011-08-23  Dimitri Glazkov  <dglazkov@chromium.org>
    212
  • trunk/Tools/DumpRenderTree/chromium/WebThemeEngineDRTMac.mm

    r93653 r93724  
    161161    const WebThemeEngine::ScrollbarInfo& scrollbarInfo)
    162162{
     163    [NSGraphicsContext saveGraphicsState];
    163164    NSScroller* scroller = [[NSScroller alloc] initWithFrame:NSMakeRect(rect.x, rect.y, rect.width, rect.height)];
    164165    [scroller setEnabled:state != WebThemeEngine::StateDisabled];
     
    176177    [scroller setKnobProportion: knobProportion];
    177178
    178     NSGraphicsContext* previousGraphicsContext = [NSGraphicsContext currentContext];
    179179#if WEBKIT_USING_SKIA
    180180    gfx::SkiaBitLocker bitLocker(canvas);
     
    189189    // Force it to draw in the right location by translating the whole graphics
    190190    // context.
    191     [nsGraphicsContext saveGraphicsState];
     191    CGContextSaveGState(cgContext);
    192192    NSAffineTransform *transform = [NSAffineTransform transform];
    193193    [transform translateXBy:rect.x yBy:rect.y];
     
    195195
    196196    [scroller drawKnob];
     197    CGContextRestoreGState(cgContext);
    197198
    198199    [scroller release];
    199200
    200     [nsGraphicsContext restoreGraphicsState];
    201     [NSGraphicsContext setCurrentContext:previousGraphicsContext];
    202 }
     201    [NSGraphicsContext restoreGraphicsState];
     202}
Note: See TracChangeset for help on using the changeset viewer.