Changeset 85989 in webkit


Ignore:
Timestamp:
May 6, 2011 5:47:24 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

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

Reviewed by Eric Seidel.

Add utility for converting SkCanvas to CGContext
https://bugs.webkit.org/show_bug.cgi?id=59808

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 BitLockerSkia 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.

Each time the CGContext is retrieved, it is rebuilt.
This permits the caller to modify the same canvas
between calls.

This change adds utilities but does not modify any
existing code. For now, there are no callers to these
utilities, so there is no functional change.

No new tests.

  • platform/graphics/skia/BitLockerSkia.cpp: Added. (WebCore::SkMatrixToCGAffineTransform): Conversion utility. (WebCore::BitLockerSkia::BitLockerSkia): Takes SkCanvas. (WebCore::BitLockerSkia::~BitLockerSkia): Unlocks, cleans up. (WebCore::BitLockerSkia::release): Internal private helper. (WebCore::BitLockerSkia::cgContext): Returns CGContextRef.
  • platform/graphics/skia/BitLockerSkia.h: Added.
Location:
trunk/Source/WebCore
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r85987 r85989  
     12011-05-06  Cary Clark  <caryclark@google.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Add utility for converting SkCanvas to CGContext
     6        https://bugs.webkit.org/show_bug.cgi?id=59808
     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 BitLockerSkia 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        Each time the CGContext is retrieved, it is rebuilt.
     18        This permits the caller to modify the same canvas
     19        between calls.
     20
     21        This change adds utilities but does not modify any
     22        existing code. For now, there are no callers to these
     23        utilities, so there is no functional change.
     24
     25        No new tests.
     26
     27        * platform/graphics/skia/BitLockerSkia.cpp: Added.
     28        (WebCore::SkMatrixToCGAffineTransform): Conversion utility.
     29        (WebCore::BitLockerSkia::BitLockerSkia): Takes SkCanvas.
     30        (WebCore::BitLockerSkia::~BitLockerSkia): Unlocks, cleans up.
     31        (WebCore::BitLockerSkia::release): Internal private helper.
     32        (WebCore::BitLockerSkia::cgContext): Returns CGContextRef.
     33        * platform/graphics/skia/BitLockerSkia.h: Added.
     34
    1352011-05-06  Martin Robinson  <mrobinson@igalia.com>
    236
Note: See TracChangeset for help on using the changeset viewer.