Changeset 82549 in webkit


Ignore:
Timestamp:
Mar 30, 2011 11:04:10 PM (13 years ago)
Author:
bfulgham@webkit.org
Message:

Unreviewed build correction after r82496. (Part 3)

Revise DragImageCairoWin to address new PlatformGraphicsContext
and object lifecycle.

  • platform/win/DragImageCairoWin.cpp:

(WebCore::deallocContext):
(WebCore::allocImage):
(WebCore::scaleDragImage):
(WebCore::createDragImageFromImage):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r82548 r82549  
     12011-03-30  Brent Fulgham  <bfulgham@webkit.org>
     2
     3        Unreviewed build correction after r82496. (Part 3)
     4
     5        Revise DragImageCairoWin to address new PlatformGraphicsContext
     6        and object lifecycle.
     7
     8        * platform/win/DragImageCairoWin.cpp:
     9        (WebCore::deallocContext):
     10        (WebCore::allocImage):
     11        (WebCore::scaleDragImage):
     12        (WebCore::createDragImageFromImage):
     13
    1142011-03-30  Brent Fulgham  <bfulgham@webkit.org>
    215
  • trunk/Source/WebCore/platform/win/DragImageCairoWin.cpp

    r82548 r82549  
    4747{
    4848    if (target)
    49         delete *target;
     49        delete target;
    5050}
    5151
     
    8585    cairo_matrix_t matrix;
    8686    cairo_matrix_init(&matrix, 1.0, 0.0, 0.0, -1.0, 0.0, size.height());
    87     cairo_set_matrix(*targetRef, &matrix);
     87    cairo_set_matrix((*targetRef)->cr(), &matrix);
    8888
    8989    return hbmp;
     
    123123        goto exit;
    124124
    125     CairoContextRef targetContext;
     125    PlatformContextCairo* targetContext = 0;
    126126    hbmp = allocImage(dstDC, dstSize, &targetContext);
    127127    if (!hbmp)
    128128        goto exit;
     129
     130    if (!targetContext) {
     131        ::DeleteObject(hbmp);
     132        hbmp = 0;
     133        goto exit;
     134    }
    129135
    130136    cairo_surface_t* srcImage = createCairoContextFromBitmap(image);
     
    133139    // so that when we set the srcImage as the surface it will draw
    134140    // right-side-up.
    135     cairo_translate(targetContext, 0, dstSize.height());
    136     cairo_scale(targetContext, scale.width(), -scale.height());
    137     cairo_set_source_surface (targetContext, srcImage, 0.0, 0.0);
     141    cairo_translate(targetContext->cr(), 0, dstSize.height());
     142    cairo_scale(targetContext->cr(), scale.width(), -scale.height());
     143    cairo_set_source_surface (targetContext->cr(), srcImage, 0.0, 0.0);
    138144
    139145    // Now we can paint and get the correct result
    140     cairo_paint(targetContext);
     146    cairo_paint(targetContext->cr());
    141147
    142148    cairo_surface_destroy (srcImage);
    143     cairo_destroy(targetContext);
     149    delete targetContext;
    144150    ::DeleteObject(image);
    145151    image = 0;
     
    162168        goto exit;
    163169
    164     CairoContextRef drawContext = 0;
     170    PlatformGraphicsContext* drawContext = 0;
    165171    hbmp = allocImage(workingDC, img->size(), &drawContext);
    166172    if (!hbmp)
     
    172178    }
    173179
    174     cairo_set_source_rgb (drawContext, 1.0, 0.0, 1.0);
    175     cairo_fill_preserve (drawContext);
     180    cairo_set_source_rgb (drawContext->cr(), 1.0, 0.0, 1.0);
     181    cairo_fill_preserve (drawContext->cr());
    176182
    177183    cairo_surface_t* srcImage = img->nativeImageForCurrentFrame();
    178184
    179185    // Draw the image.
    180     cairo_set_source_surface(drawContext, srcImage, 0.0, 0.0);
    181     cairo_paint(drawContext);
     186    cairo_set_source_surface(drawContext->cr(), srcImage, 0.0, 0.0);
     187    cairo_paint(drawContext->cr());
    182188
    183     cairo_destroy (drawContext);
     189    delete drawContext;
    184190
    185191exit:
Note: See TracChangeset for help on using the changeset viewer.