Changeset 73997 in webkit


Ignore:
Timestamp:
Dec 13, 2010 8:47:34 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2010-12-13 Noel Gordon <noel.gordon@gmail.com>

Reviewed by David Levin.

[chromium] Upstream skia/ImageBuffer.cpp routine mulDiv255Ceil()
https://bugs.webkit.org/show_bug.cgi?id=50545

Skia has rolled, replace uses of mulDiv255Ceil with SkMulDiv255Ceiling.

No new tests, no change in behaviour.

  • platform/graphics/skia/ImageBufferSkia.cpp: (WebCore::putImageData):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r73996 r73997  
     12010-12-13  Noel Gordon  <noel.gordon@gmail.com>
     2
     3        Reviewed by David Levin.
     4
     5        [chromium] Upstream skia/ImageBuffer.cpp routine mulDiv255Ceil()
     6        https://bugs.webkit.org/show_bug.cgi?id=50545
     7
     8        Skia has rolled, replace uses of mulDiv255Ceil with SkMulDiv255Ceiling.
     9
     10        No new tests, no change in behaviour.
     11
     12        * platform/graphics/skia/ImageBufferSkia.cpp:
     13        (WebCore::putImageData):
     14
    1152010-12-13  Gavin Peters  <gavinp@chromium.org>
    216
  • trunk/WebCore/platform/graphics/skia/ImageBufferSkia.cpp

    r73949 r73997  
    247247}
    248248
    249 // This function does the equivalent of (a * b + 254) / 255, without an integer divide.
    250 // Valid for a, b in the range [0..255].
    251 unsigned mulDiv255Ceil(unsigned a, unsigned b)
    252 {
    253     unsigned value = a * b + 255;
    254     return (value + (value >> 8)) >> 8;
    255 }
    256 
    257249template <Multiply multiplied>
    258250void putImageData(ImageData*& source, const IntRect& sourceRect, const IntPoint& destPoint,
     
    298290            if (multiplied == Unmultiplied) {
    299291                unsigned char alpha = srcPixel[3];
    300                 unsigned char r = mulDiv255Ceil(srcPixel[0], alpha);
    301                 unsigned char g = mulDiv255Ceil(srcPixel[1], alpha);
    302                 unsigned char b = mulDiv255Ceil(srcPixel[2], alpha);
     292                unsigned char r = SkMulDiv255Ceiling(srcPixel[0], alpha);
     293                unsigned char g = SkMulDiv255Ceiling(srcPixel[1], alpha);
     294                unsigned char b = SkMulDiv255Ceiling(srcPixel[2], alpha);
    303295                destRow[x] = SkPackARGB32(alpha, r, g, b);
    304296            } else
Note: See TracChangeset for help on using the changeset viewer.