Changeset 71034 in webkit


Ignore:
Timestamp:
Nov 1, 2010 10:35:56 AM (13 years ago)
Author:
zmo@google.com
Message:

2010-10-28 Zhenyao Mo <zmo@google.com>

Reviewed by Kenneth Russell.

Fix enum naming style violation in GraphicsContext3D
https://bugs.webkit.org/show_bug.cgi?id=48441

  • platform/graphics/GraphicsContext3D.cpp: (WebCore::GraphicsContext3D::extractImageData): (WebCore::GraphicsContext3D::extractTextureData): (WebCore::doPacking): (WebCore::GraphicsContext3D::packPixels):
  • platform/graphics/GraphicsContext3D.h:
  • platform/graphics/cg/GraphicsContext3DCG.cpp: (WebCore::getSourceDataFormat): (WebCore::GraphicsContext3D::getImageData):
  • platform/graphics/skia/GraphicsContext3DSkia.cpp: (WebCore::GraphicsContext3D::getImageData):
Location:
trunk/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r71031 r71034  
     12010-10-28  Zhenyao Mo  <zmo@google.com>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        Fix enum naming style violation in GraphicsContext3D
     6        https://bugs.webkit.org/show_bug.cgi?id=48441
     7
     8        * platform/graphics/GraphicsContext3D.cpp:
     9        (WebCore::GraphicsContext3D::extractImageData):
     10        (WebCore::GraphicsContext3D::extractTextureData):
     11        (WebCore::doPacking):
     12        (WebCore::GraphicsContext3D::packPixels):
     13        * platform/graphics/GraphicsContext3D.h:
     14        * platform/graphics/cg/GraphicsContext3DCG.cpp:
     15        (WebCore::getSourceDataFormat):
     16        (WebCore::GraphicsContext3D::getImageData):
     17        * platform/graphics/skia/GraphicsContext3DSkia.cpp:
     18        (WebCore::GraphicsContext3D::getImageData):
     19
    1202010-11-01  Martin Robinson  <mrobinson@igalia.com>
    221
  • trunk/WebCore/platform/graphics/GraphicsContext3D.cpp

    r70706 r71034  
    133133    data.resize(dataBytes);
    134134    if (!packPixels(imageData->data()->data()->data(),
    135                     kSourceFormatRGBA8,
     135                    SourceFormatRGBA8,
    136136                    width,
    137137                    height,
     
    139139                    format,
    140140                    type,
    141                     premultiplyAlpha ? kAlphaDoPremultiply : kAlphaDoNothing,
     141                    premultiplyAlpha ? AlphaDoPremultiply : AlphaDoNothing,
    142142                    data.data()))
    143143        return false;
     
    165165{
    166166    // Assumes format, type, etc. have already been validated.
    167     SourceDataFormat sourceDataFormat = kSourceFormatRGBA8;
     167    SourceDataFormat sourceDataFormat = SourceFormatRGBA8;
    168168    switch (type) {
    169169    case UNSIGNED_BYTE:
    170170        switch (format) {
    171171        case RGBA:
    172             sourceDataFormat = kSourceFormatRGBA8;
     172            sourceDataFormat = SourceFormatRGBA8;
    173173            break;
    174174        case RGB:
    175             sourceDataFormat = kSourceFormatRGB8;
     175            sourceDataFormat = SourceFormatRGB8;
    176176            break;
    177177        case ALPHA:
    178             sourceDataFormat = kSourceFormatA8;
     178            sourceDataFormat = SourceFormatA8;
    179179            break;
    180180        case LUMINANCE:
    181             sourceDataFormat = kSourceFormatR8;
     181            sourceDataFormat = SourceFormatR8;
    182182            break;
    183183        case LUMINANCE_ALPHA:
    184             sourceDataFormat = kSourceFormatRA8;
     184            sourceDataFormat = SourceFormatRA8;
    185185            break;
    186186        default:
     
    189189        break;
    190190    case UNSIGNED_SHORT_5_5_5_1:
    191         sourceDataFormat = kSourceFormatRGBA5551;
     191        sourceDataFormat = SourceFormatRGBA5551;
    192192        break;
    193193    case UNSIGNED_SHORT_4_4_4_4:
    194         sourceDataFormat = kSourceFormatRGBA4444;
     194        sourceDataFormat = SourceFormatRGBA4444;
    195195        break;
    196196    case UNSIGNED_SHORT_5_6_5:
    197         sourceDataFormat = kSourceFormatRGB565;
     197        sourceDataFormat = SourceFormatRGB565;
    198198        break;
    199199    default:
     
    214214                    width, height, unpackAlignment,
    215215                    format, type,
    216                     (premultiplyAlpha ? kAlphaDoPremultiply : kAlphaDoNothing),
     216                    (premultiplyAlpha ? AlphaDoPremultiply : AlphaDoNothing),
    217217                    data.data()))
    218218        return false;
     
    567567}
    568568
    569 // This is only used when the source format is different than kSourceFormatRGBA8.
     569// This is only used when the source format is different than SourceFormatRGBA8.
    570570void packRGBA8ToRGBA8(const uint8_t* source, uint8_t* destination)
    571571{
     
    773773{
    774774    switch (sourceDataFormat) {
    775     case GraphicsContext3D::kSourceFormatRGBA8: {
     775    case GraphicsContext3D::SourceFormatRGBA8: {
    776776        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    777777        computeIncrementParameters<uint8_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    790790        break;
    791791    }
    792     case GraphicsContext3D::kSourceFormatRGBA16Little: {
     792    case GraphicsContext3D::SourceFormatRGBA16Little: {
    793793        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    794794        computeIncrementParameters<uint16_t>(width, 8, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    796796        break;
    797797    }
    798     case GraphicsContext3D::kSourceFormatRGBA16Big: {
     798    case GraphicsContext3D::SourceFormatRGBA16Big: {
    799799        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    800800        computeIncrementParameters<uint16_t>(width, 8, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    802802        break;
    803803    }
    804     case GraphicsContext3D::kSourceFormatRGB8: {
     804    case GraphicsContext3D::SourceFormatRGB8: {
    805805        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    806806        computeIncrementParameters<uint8_t>(width, 3, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    808808        break;
    809809    }
    810     case GraphicsContext3D::kSourceFormatRGB16Little: {
     810    case GraphicsContext3D::SourceFormatRGB16Little: {
    811811        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    812812        computeIncrementParameters<uint16_t>(width, 6, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    814814        break;
    815815    }
    816     case GraphicsContext3D::kSourceFormatRGB16Big: {
     816    case GraphicsContext3D::SourceFormatRGB16Big: {
    817817        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    818818        computeIncrementParameters<uint16_t>(width, 6, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    820820        break;
    821821    }
    822     case GraphicsContext3D::kSourceFormatARGB8: {
     822    case GraphicsContext3D::SourceFormatARGB8: {
    823823        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    824824        computeIncrementParameters<uint8_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    826826        break;
    827827    }
    828     case GraphicsContext3D::kSourceFormatARGB16Little: {
     828    case GraphicsContext3D::SourceFormatARGB16Little: {
    829829        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    830830        computeIncrementParameters<uint16_t>(width, 8, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    832832        break;
    833833    }
    834     case GraphicsContext3D::kSourceFormatARGB16Big: {
     834    case GraphicsContext3D::SourceFormatARGB16Big: {
    835835        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    836836        computeIncrementParameters<uint16_t>(width, 8, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    838838        break;
    839839    }
    840     case GraphicsContext3D::kSourceFormatBGRA8: {
     840    case GraphicsContext3D::SourceFormatBGRA8: {
    841841        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    842842        computeIncrementParameters<uint8_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    844844        break;
    845845    }
    846     case GraphicsContext3D::kSourceFormatBGRA16Little: {
     846    case GraphicsContext3D::SourceFormatBGRA16Little: {
    847847        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    848848        computeIncrementParameters<uint16_t>(width, 8, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    850850        break;
    851851    }
    852     case GraphicsContext3D::kSourceFormatBGRA16Big: {
     852    case GraphicsContext3D::SourceFormatBGRA16Big: {
    853853        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    854854        computeIncrementParameters<uint16_t>(width, 8, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    856856        break;
    857857    }
    858     case GraphicsContext3D::kSourceFormatRGBA5551: {
     858    case GraphicsContext3D::SourceFormatRGBA5551: {
    859859        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    860860        computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    862862        break;
    863863    }
    864     case GraphicsContext3D::kSourceFormatRGBA4444: {
     864    case GraphicsContext3D::SourceFormatRGBA4444: {
    865865        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    866866        computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    868868        break;
    869869    }
    870     case GraphicsContext3D::kSourceFormatRGB565: {
     870    case GraphicsContext3D::SourceFormatRGB565: {
    871871        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    872872        computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    874874        break;
    875875    }
    876     case GraphicsContext3D::kSourceFormatR8: {
     876    case GraphicsContext3D::SourceFormatR8: {
    877877        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    878878        computeIncrementParameters<uint8_t>(width, 1, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    880880        break;
    881881    }
    882     case GraphicsContext3D::kSourceFormatR16Little: {
     882    case GraphicsContext3D::SourceFormatR16Little: {
    883883        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    884884        computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    886886        break;
    887887    }
    888     case GraphicsContext3D::kSourceFormatR16Big: {
     888    case GraphicsContext3D::SourceFormatR16Big: {
    889889        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    890890        computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    892892        break;
    893893    }
    894     case GraphicsContext3D::kSourceFormatRA8: {
     894    case GraphicsContext3D::SourceFormatRA8: {
    895895        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    896896        computeIncrementParameters<uint8_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    898898        break;
    899899    }
    900     case GraphicsContext3D::kSourceFormatRA16Little: {
     900    case GraphicsContext3D::SourceFormatRA16Little: {
    901901        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    902902        computeIncrementParameters<uint16_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    904904        break;
    905905    }
    906     case GraphicsContext3D::kSourceFormatRA16Big: {
     906    case GraphicsContext3D::SourceFormatRA16Big: {
    907907        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    908908        computeIncrementParameters<uint16_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    910910        break;
    911911    }
    912     case GraphicsContext3D::kSourceFormatAR8: {
     912    case GraphicsContext3D::SourceFormatAR8: {
    913913        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    914914        computeIncrementParameters<uint8_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    916916        break;
    917917    }
    918     case GraphicsContext3D::kSourceFormatAR16Little: {
     918    case GraphicsContext3D::SourceFormatAR16Little: {
    919919        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    920920        computeIncrementParameters<uint16_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    922922        break;
    923923    }
    924     case GraphicsContext3D::kSourceFormatAR16Big: {
     924    case GraphicsContext3D::SourceFormatAR16Big: {
    925925        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    926926        computeIncrementParameters<uint16_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    928928        break;
    929929    }
    930     case GraphicsContext3D::kSourceFormatA8: {
     930    case GraphicsContext3D::SourceFormatA8: {
    931931        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    932932        computeIncrementParameters<uint8_t>(width, 1, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    934934        break;
    935935    }
    936     case GraphicsContext3D::kSourceFormatA16Little: {
     936    case GraphicsContext3D::SourceFormatA16Little: {
    937937        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    938938        computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    940940        break;
    941941    }
    942     case GraphicsContext3D::kSourceFormatA16Big: {
     942    case GraphicsContext3D::SourceFormatA16Big: {
    943943        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
    944944        computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
     
    964964    case UNSIGNED_BYTE: {
    965965        uint8_t* destination = static_cast<uint8_t*>(destinationData);
    966         if (sourceDataFormat == kSourceFormatRGBA8 && destinationFormat == RGBA && sourceUnpackAlignment <= 4 && alphaOp == kAlphaDoNothing) {
     966        if (sourceDataFormat == SourceFormatRGBA8 && destinationFormat == RGBA && sourceUnpackAlignment <= 4 && alphaOp == AlphaDoNothing) {
    967967            // No conversion necessary.
    968968            memcpy(destinationData, sourceData, width * height * 4);
     
    972972        case RGB:
    973973            switch (alphaOp) {
    974             case kAlphaDoNothing:
     974            case AlphaDoNothing:
    975975                doPacking<uint8_t, packRGBA8ToRGB8>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 3);
    976976                break;
    977             case kAlphaDoPremultiply:
     977            case AlphaDoPremultiply:
    978978                doPacking<uint8_t, packRGBA8ToRGB8Premultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 3);
    979979                break;
    980             case kAlphaDoUnmultiply:
     980            case AlphaDoUnmultiply:
    981981                doPacking<uint8_t, packRGBA8ToRGB8Unmultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 3);
    982982                break;
     
    985985        case RGBA:
    986986            switch (alphaOp) {
    987             case kAlphaDoNothing:
    988                 ASSERT(sourceDataFormat != kSourceFormatRGBA8 || sourceUnpackAlignment > 4); // Handled above with fast case.
     987            case AlphaDoNothing:
     988                ASSERT(sourceDataFormat != SourceFormatRGBA8 || sourceUnpackAlignment > 4); // Handled above with fast case.
    989989                doPacking<uint8_t, packRGBA8ToRGBA8>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 4);
    990990                break;
    991             case kAlphaDoPremultiply:
     991            case AlphaDoPremultiply:
    992992                doPacking<uint8_t, packRGBA8ToRGBA8Premultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 4);
    993993                break;
    994             case kAlphaDoUnmultiply:
     994            case AlphaDoUnmultiply:
    995995                doPacking<uint8_t, packRGBA8ToRGBA8Unmultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 4);
    996996                break;
     
    10101010            // from the RGBA data.
    10111011            switch (alphaOp) {
    1012             case kAlphaDoNothing:
     1012            case AlphaDoNothing:
    10131013                doPacking<uint8_t, packRGBA8ToR8>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
    10141014                break;
    1015             case kAlphaDoPremultiply:
     1015            case AlphaDoPremultiply:
    10161016                doPacking<uint8_t, packRGBA8ToR8Premultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
    10171017                break;
    1018             case kAlphaDoUnmultiply:
     1018            case AlphaDoUnmultiply:
    10191019                doPacking<uint8_t, packRGBA8ToR8Unmultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
    10201020                break;
     
    10261026            // are chosen from the RGBA data.
    10271027            switch (alphaOp) {
    1028             case kAlphaDoNothing:
     1028            case AlphaDoNothing:
    10291029                doPacking<uint8_t, packRGBA8ToRA8>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 2);
    10301030                break;
    1031             case kAlphaDoPremultiply:
     1031            case AlphaDoPremultiply:
    10321032                doPacking<uint8_t, packRGBA8ToRA8Premultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 2);
    10331033                break;
    1034             case kAlphaDoUnmultiply:
     1034            case AlphaDoUnmultiply:
    10351035                doPacking<uint8_t, packRGBA8ToRA8Unmultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 2);
    10361036                break;
     
    10431043        uint16_t* destination = static_cast<uint16_t*>(destinationData);
    10441044        switch (alphaOp) {
    1045         case kAlphaDoNothing:
     1045        case AlphaDoNothing:
    10461046            doPacking<uint16_t, packRGBA8ToUnsignedShort4444>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
    10471047            break;
    1048         case kAlphaDoPremultiply:
     1048        case AlphaDoPremultiply:
    10491049            doPacking<uint16_t, packRGBA8ToUnsignedShort4444Premultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
    10501050            break;
    1051         case kAlphaDoUnmultiply:
     1051        case AlphaDoUnmultiply:
    10521052            doPacking<uint16_t, packRGBA8ToUnsignedShort4444Unmultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
    10531053            break;
     
    10581058        uint16_t* destination = static_cast<uint16_t*>(destinationData);
    10591059        switch (alphaOp) {
    1060         case kAlphaDoNothing:
     1060        case AlphaDoNothing:
    10611061            doPacking<uint16_t, packRGBA8ToUnsignedShort5551>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
    10621062            break;
    1063         case kAlphaDoPremultiply:
     1063        case AlphaDoPremultiply:
    10641064            doPacking<uint16_t, packRGBA8ToUnsignedShort5551Premultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
    10651065            break;
    1066         case kAlphaDoUnmultiply:
     1066        case AlphaDoUnmultiply:
    10671067            doPacking<uint16_t, packRGBA8ToUnsignedShort5551Unmultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
    10681068            break;
     
    10731073        uint16_t* destination = static_cast<uint16_t*>(destinationData);
    10741074        switch (alphaOp) {
    1075         case kAlphaDoNothing:
     1075        case AlphaDoNothing:
    10761076            doPacking<uint16_t, packRGBA8ToUnsignedShort565>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
    10771077            break;
    1078         case kAlphaDoPremultiply:
     1078        case AlphaDoPremultiply:
    10791079            doPacking<uint16_t, packRGBA8ToUnsignedShort565Premultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
    10801080            break;
    1081         case kAlphaDoUnmultiply:
     1081        case AlphaDoUnmultiply:
    10821082            doPacking<uint16_t, packRGBA8ToUnsignedShort565Unmultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
    10831083            break;
  • trunk/WebCore/platform/graphics/GraphicsContext3D.h

    r70706 r71034  
    541541    // by non-member functions.
    542542    enum SourceDataFormat {
    543         kSourceFormatRGBA8 = 0,
    544         kSourceFormatRGBA16Little,
    545         kSourceFormatRGBA16Big,
    546         kSourceFormatRGB8,
    547         kSourceFormatRGB16Little,
    548         kSourceFormatRGB16Big,
    549         kSourceFormatBGRA8,
    550         kSourceFormatBGRA16Little,
    551         kSourceFormatBGRA16Big,
    552         kSourceFormatARGB8,
    553         kSourceFormatARGB16Little,
    554         kSourceFormatARGB16Big,
    555         kSourceFormatRGBA5551,
    556         kSourceFormatRGBA4444,
    557         kSourceFormatRGB565,
    558         kSourceFormatR8,
    559         kSourceFormatR16Little,
    560         kSourceFormatR16Big,
    561         kSourceFormatRA8,
    562         kSourceFormatRA16Little,
    563         kSourceFormatRA16Big,
    564         kSourceFormatAR8,
    565         kSourceFormatAR16Little,
    566         kSourceFormatAR16Big,
    567         kSourceFormatA8,
    568         kSourceFormatA16Little,
    569         kSourceFormatA16Big,
    570         kSourceFormatNumFormats
     543        SourceFormatRGBA8 = 0,
     544        SourceFormatRGBA16Little,
     545        SourceFormatRGBA16Big,
     546        SourceFormatRGB8,
     547        SourceFormatRGB16Little,
     548        SourceFormatRGB16Big,
     549        SourceFormatBGRA8,
     550        SourceFormatBGRA16Little,
     551        SourceFormatBGRA16Big,
     552        SourceFormatARGB8,
     553        SourceFormatARGB16Little,
     554        SourceFormatARGB16Big,
     555        SourceFormatRGBA5551,
     556        SourceFormatRGBA4444,
     557        SourceFormatRGB565,
     558        SourceFormatR8,
     559        SourceFormatR16Little,
     560        SourceFormatR16Big,
     561        SourceFormatRA8,
     562        SourceFormatRA16Little,
     563        SourceFormatRA16Big,
     564        SourceFormatAR8,
     565        SourceFormatAR16Little,
     566        SourceFormatAR16Big,
     567        SourceFormatA8,
     568        SourceFormatA16Little,
     569        SourceFormatA16Big,
     570        SourceFormatNumFormats
    571571    };
    572572
     
    833833    // be removed.
    834834    enum AlphaOp {
    835         kAlphaDoNothing = 0,
    836         kAlphaDoPremultiply = 1,
    837         kAlphaDoUnmultiply = 2
     835        AlphaDoNothing = 0,
     836        AlphaDoPremultiply = 1,
     837        AlphaDoUnmultiply = 2
    838838    };
    839839
  • trunk/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp

    r70706 r71034  
    6060};
    6161
    62 // This returns kSourceFormatNumFormats if the combination of input parameters is unsupported.
     62// This returns SourceFormatNumFormats if the combination of input parameters is unsupported.
    6363static GraphicsContext3D::SourceDataFormat getSourceDataFormat(unsigned int componentsPerPixel, AlphaFormat alphaFormat, bool is16BitFormat, bool bigEndian)
    6464{
     
    7171    };
    7272    const static GraphicsContext3D::SourceDataFormat formatTable[SourceFormatBaseNumFormats][3] = { // SourceDataFormatBase x bitsPerComponentAndEndian
    73         // 8bits                                 16bits, little endian                         16bits, big endian
    74         { GraphicsContext3D::kSourceFormatR8,    GraphicsContext3D::kSourceFormatR16Little,    GraphicsContext3D::kSourceFormatR16Big },
    75         { GraphicsContext3D::kSourceFormatA8,    GraphicsContext3D::kSourceFormatA16Little,    GraphicsContext3D::kSourceFormatA16Big },
    76         { GraphicsContext3D::kSourceFormatRA8,   GraphicsContext3D::kSourceFormatRA16Little,   GraphicsContext3D::kSourceFormatRA16Big },
    77         { GraphicsContext3D::kSourceFormatAR8,   GraphicsContext3D::kSourceFormatAR16Little,   GraphicsContext3D::kSourceFormatAR16Big },
    78         { GraphicsContext3D::kSourceFormatRGB8,  GraphicsContext3D::kSourceFormatRGB16Little,  GraphicsContext3D::kSourceFormatRGB16Big },
    79         { GraphicsContext3D::kSourceFormatRGBA8, GraphicsContext3D::kSourceFormatRGBA16Little, GraphicsContext3D::kSourceFormatRGBA16Big },
    80         { GraphicsContext3D::kSourceFormatARGB8, GraphicsContext3D::kSourceFormatARGB16Little, GraphicsContext3D::kSourceFormatARGB16Big }
     73        // 8bits                                16bits, little endian                        16bits, big endian
     74        { GraphicsContext3D::SourceFormatR8,    GraphicsContext3D::SourceFormatR16Little,    GraphicsContext3D::SourceFormatR16Big },
     75        { GraphicsContext3D::SourceFormatA8,    GraphicsContext3D::SourceFormatA16Little,    GraphicsContext3D::SourceFormatA16Big },
     76        { GraphicsContext3D::SourceFormatRA8,   GraphicsContext3D::SourceFormatRA16Little,   GraphicsContext3D::SourceFormatRA16Big },
     77        { GraphicsContext3D::SourceFormatAR8,   GraphicsContext3D::SourceFormatAR16Little,   GraphicsContext3D::SourceFormatAR16Big },
     78        { GraphicsContext3D::SourceFormatRGB8,  GraphicsContext3D::SourceFormatRGB16Little,  GraphicsContext3D::SourceFormatRGB16Big },
     79        { GraphicsContext3D::SourceFormatRGBA8, GraphicsContext3D::SourceFormatRGBA16Little, GraphicsContext3D::SourceFormatRGBA16Big },
     80        { GraphicsContext3D::SourceFormatARGB8, GraphicsContext3D::SourceFormatARGB16Little, GraphicsContext3D::SourceFormatARGB16Big }
    8181    };
    8282
     
    8484    SourceDataFormatBase formatBase = formatTableBase[componentsPerPixel - 1][alphaFormat];
    8585    if (formatBase == SourceFormatBaseNumFormats)
    86         return GraphicsContext3D::kSourceFormatNumFormats;
     86        return GraphicsContext3D::SourceFormatNumFormats;
    8787    if (!is16BitFormat)
    8888        return formatTable[formatBase][0];
     
    147147    }
    148148
    149     AlphaOp neededAlphaOp = kAlphaDoNothing;
     149    AlphaOp neededAlphaOp = AlphaDoNothing;
    150150    AlphaFormat alphaFormat = AlphaFormatNone;
    151151    switch (CGImageGetAlphaInfo(cgImage)) {
     
    156156        ASSERT(!image->data());
    157157        if (!premultiplyAlpha)
    158             neededAlphaOp = kAlphaDoUnmultiply;
     158            neededAlphaOp = AlphaDoUnmultiply;
    159159        alphaFormat = AlphaFormatFirst;
    160160        break;
     
    162162        // This path is only accessible for MacOS earlier than 10.6.4.
    163163        if (premultiplyAlpha)
    164             neededAlphaOp = kAlphaDoPremultiply;
     164            neededAlphaOp = AlphaDoPremultiply;
    165165        alphaFormat = AlphaFormatFirst;
    166166        break;
     
    174174        ASSERT(!image->data());
    175175        if (!premultiplyAlpha)
    176             neededAlphaOp = kAlphaDoUnmultiply;
     176            neededAlphaOp = AlphaDoUnmultiply;
    177177        alphaFormat = AlphaFormatLast;
    178178        break;
    179179    case kCGImageAlphaLast:
    180180        if (premultiplyAlpha)
    181             neededAlphaOp = kAlphaDoPremultiply;
     181            neededAlphaOp = AlphaDoPremultiply;
    182182        alphaFormat = AlphaFormatLast;
    183183        break;
     
    192192    }
    193193    SourceDataFormat srcDataFormat = getSourceDataFormat(componentsPerPixel, alphaFormat, bitsPerComponent == 16, srcByteOrder16Big);
    194     if (srcDataFormat == kSourceFormatNumFormats)
     194    if (srcDataFormat == SourceFormatNumFormats)
    195195        return false;
    196196
  • trunk/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp

    r66288 r71034  
    4949    OwnPtr<NativeImageSkia> pixels;
    5050    NativeImageSkia* skiaImage = 0;
    51     AlphaOp neededAlphaOp = kAlphaDoNothing;
     51    AlphaOp neededAlphaOp = AlphaDoNothing;
    5252    if (image->data()) {
    5353        ImageSource decoder(false);
     
    6464        skiaImage = pixels.get();
    6565        if (hasAlpha && premultiplyAlpha)
    66             neededAlphaOp = kAlphaDoPremultiply;
     66            neededAlphaOp = AlphaDoPremultiply;
    6767    } else {
    6868        // This is a special case for texImage2D with HTMLCanvasElement input.
    6969        skiaImage = image->nativeImageForCurrentFrame();
    7070        if (!premultiplyAlpha)
    71             neededAlphaOp = kAlphaDoUnmultiply;
     71            neededAlphaOp = AlphaDoUnmultiply;
    7272    }
    7373    if (!skiaImage)
     
    7878    outputVector.resize(skiaImage->rowBytes() * skiaImage->height());
    7979    return packPixels(reinterpret_cast<const uint8_t*>(skiaImage->getPixels()),
    80                       kSourceFormatBGRA8, skiaImage->width(), skiaImage->height(), 0,
     80                      SourceFormatBGRA8, skiaImage->width(), skiaImage->height(), 0,
    8181                      format, type, neededAlphaOp, outputVector.data());
    8282}
Note: See TracChangeset for help on using the changeset viewer.