Changeset 88015 in webkit


Ignore:
Timestamp:
Jun 3, 2011 7:39:52 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-03 Cary Clark <caryclark@google.com>

Reviewed by Eric Seidel.

Draw DRT scroll bar thumb with CG when WebKit renders with Skia
https://bugs.webkit.org/show_bug.cgi?id=61534

Skia on Mac uses Skia to render WebKit, and CG
to render UI elements. The CG elements need a
transcribed graphics context that preserves the
canvas matrix, and the canvas clip.

The SkiaBitLocker utility class sets up a CGContext
from the SkCanvas, locks the bitmap's bits, and
releases the lock when the class goes out of scope.

The SkiaBitLocker implementation is described by
this patch:
http://codereview.chromium.org/7031006/

When WebKit uses Skia for rendering, the WebCanvas
is an SkCanvas. Create an equivalent CGContext to
draw the scrollbar thumb.

As the Chrome Mac port does not yet use Skia, this
patch has no effect and requires no tests.

  • DumpRenderTree/chromium/WebThemeEngineDRTMac.mm: (WebThemeEngineDRTMac::paintHIThemeScrollbarThumb):
Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r88013 r88015  
     12011-06-03  Cary Clark  <caryclark@google.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Draw DRT scroll bar thumb with CG when WebKit renders with Skia
     6        https://bugs.webkit.org/show_bug.cgi?id=61534
     7
     8        Skia on Mac uses Skia to render WebKit, and CG
     9        to render UI elements. The CG elements need a
     10        transcribed graphics context that preserves the
     11        canvas matrix, and the canvas clip.
     12
     13        The SkiaBitLocker utility class sets up a CGContext
     14        from the SkCanvas, locks the bitmap's bits, and
     15        releases the lock when the class goes out of scope.
     16
     17        The SkiaBitLocker implementation is described by
     18        this patch:
     19        http://codereview.chromium.org/7031006/
     20
     21        When WebKit uses Skia for rendering, the WebCanvas
     22        is an SkCanvas. Create an equivalent CGContext to
     23        draw the scrollbar thumb.
     24
     25        As the Chrome Mac port does not yet use Skia, this
     26        patch has no effect and requires no tests.
     27
     28        * DumpRenderTree/chromium/WebThemeEngineDRTMac.mm:
     29        (WebThemeEngineDRTMac::paintHIThemeScrollbarThumb):
     30
    1312011-06-03  Andras Becsi  <abecsi@webkit.org>
    232
  • trunk/Tools/DumpRenderTree/chromium/WebThemeEngineDRTMac.mm

    r75918 r88015  
    3838#import <AppKit/NSWindow.h>
    3939#include <Carbon/Carbon.h>
     40
     41#if WEBKIT_USING_SKIA
     42#include "skia/ext/skia_utils_mac.h"
     43#endif
    4044
    4145using WebKit::WebCanvas;
     
    141145        state == WebThemeEngine::StatePressed ? kThemeThumbPressed : 0;
    142146    trackInfo.attributes |= (kThemeTrackShowThumb | kThemeTrackHideTrack);
    143     HIThemeDrawTrack(&trackInfo, 0, canvas, kHIThemeOrientationNormal);
     147#if WEBKIT_USING_SKIA
     148    gfx::SkiaBitLocker bitLocker(canvas);
     149    CGContextRef cgContext = bitLocker.cgContext();
     150#else
     151    CGContextRef cgContext = canvas;
     152#endif
     153    HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal);
    144154}
    145155
Note: See TracChangeset for help on using the changeset viewer.