Changeset 270006 in webkit


Ignore:
Timestamp:
Nov 18, 2020 6:53:43 PM (3 years ago)
Author:
Wenson Hsieh
Message:

Rename MetaCommandSwitchTo to MetaCommandSwitchToItemBuffer
https://bugs.webkit.org/show_bug.cgi?id=219130

Reviewed by Tim Horton.

Source/WebCore:

Rename MetaCommandSwitchTo to MetaCommandSwitchToItemBuffer. The new name helps to clarify that this item is
about changing or swapping between display list item buffers, rather than image buffers.

  • platform/graphics/displaylists/DisplayList.cpp:

(WebCore::DisplayList::DisplayList::append):

  • platform/graphics/displaylists/DisplayListItemBuffer.cpp:

(WebCore::DisplayList::ItemHandle::apply):
(WebCore::DisplayList::ItemHandle::destroy):
(WebCore::DisplayList::ItemHandle::copyTo const):
(WebCore::DisplayList::ItemBuffer::swapWritableBufferIfNeeded):

  • platform/graphics/displaylists/DisplayListItemType.cpp:

(WebCore::DisplayList::sizeOfItemInBytes):
(WebCore::DisplayList::isDrawingItem):
(WebCore::DisplayList::isInlineItem):

  • platform/graphics/displaylists/DisplayListItemType.h:
  • platform/graphics/displaylists/DisplayListItems.cpp:

(WebCore::DisplayList::operator<<):

  • platform/graphics/displaylists/DisplayListItems.h:

(WebCore::DisplayList::MetaCommandSwitchToItemBuffer::MetaCommandSwitchToItemBuffer):
(WebCore::DisplayList::MetaCommandSwitchTo::MetaCommandSwitchTo): Deleted.
(WebCore::DisplayList::MetaCommandSwitchTo::identifier const): Deleted.

Source/WebKit:

  • GPUProcess/graphics/RemoteImageBuffer.h:
  • GPUProcess/graphics/RemoteRenderingBackend.cpp:

(WebKit::RemoteRenderingBackend::decodeItem):

  • WebProcess/GPU/graphics/RemoteImageBufferProxy.h:

Tools:

  • TestWebKitAPI/Tests/WebCore/DisplayListTests.cpp:

(TestWebKitAPI::TEST):

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r270002 r270006  
     12020-11-18  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Rename MetaCommandSwitchTo to MetaCommandSwitchToItemBuffer
     4        https://bugs.webkit.org/show_bug.cgi?id=219130
     5
     6        Reviewed by Tim Horton.
     7
     8        Rename MetaCommandSwitchTo to MetaCommandSwitchToItemBuffer. The new name helps to clarify that this item is
     9        about changing or swapping between display list item buffers, rather than image buffers.
     10
     11        * platform/graphics/displaylists/DisplayList.cpp:
     12        (WebCore::DisplayList::DisplayList::append):
     13        * platform/graphics/displaylists/DisplayListItemBuffer.cpp:
     14        (WebCore::DisplayList::ItemHandle::apply):
     15        (WebCore::DisplayList::ItemHandle::destroy):
     16        (WebCore::DisplayList::ItemHandle::copyTo const):
     17        (WebCore::DisplayList::ItemBuffer::swapWritableBufferIfNeeded):
     18        * platform/graphics/displaylists/DisplayListItemType.cpp:
     19        (WebCore::DisplayList::sizeOfItemInBytes):
     20        (WebCore::DisplayList::isDrawingItem):
     21        (WebCore::DisplayList::isInlineItem):
     22        * platform/graphics/displaylists/DisplayListItemType.h:
     23        * platform/graphics/displaylists/DisplayListItems.cpp:
     24        (WebCore::DisplayList::operator<<):
     25        * platform/graphics/displaylists/DisplayListItems.h:
     26        (WebCore::DisplayList::MetaCommandSwitchToItemBuffer::MetaCommandSwitchToItemBuffer):
     27        (WebCore::DisplayList::MetaCommandSwitchTo::MetaCommandSwitchTo): Deleted.
     28        (WebCore::DisplayList::MetaCommandSwitchTo::identifier const): Deleted.
     29
    1302020-11-18  Wenson Hsieh  <wenson_hsieh@apple.com>
    231
  • trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp

    r270002 r270006  
    279279    case ItemType::FlushContext:
    280280        return append<FlushContext>(item.get<FlushContext>());
    281     case ItemType::MetaCommandSwitchTo:
    282         return append<MetaCommandSwitchTo>(item.get<MetaCommandSwitchTo>());
     281    case ItemType::MetaCommandSwitchToItemBuffer:
     282        return append<MetaCommandSwitchToItemBuffer>(item.get<MetaCommandSwitchToItemBuffer>());
    283283    case ItemType::PutImageData:
    284284        return append<PutImageData>(item.get<PutImageData>());
  • trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItemBuffer.cpp

    r269753 r270006  
    227227        return;
    228228    }
    229     case ItemType::MetaCommandSwitchTo:
     229    case ItemType::MetaCommandSwitchToItemBuffer:
    230230        return;
    231231    case ItemType::PutImageData: {
     
    455455        return;
    456456    }
    457     case ItemType::MetaCommandSwitchTo: {
    458         static_assert(std::is_trivially_destructible<MetaCommandSwitchTo>::value);
     457    case ItemType::MetaCommandSwitchToItemBuffer: {
     458        static_assert(std::is_trivially_destructible<MetaCommandSwitchToItemBuffer>::value);
    459459        return;
    460460    }
     
    706706        return;
    707707    }
    708     case ItemType::MetaCommandSwitchTo: {
    709         new (itemOffset) MetaCommandSwitchTo(get<MetaCommandSwitchTo>());
     708    case ItemType::MetaCommandSwitchToItemBuffer: {
     709        new (itemOffset) MetaCommandSwitchToItemBuffer(get<MetaCommandSwitchToItemBuffer>());
    710710        return;
    711711    }
     
    861861void ItemBuffer::swapWritableBufferIfNeeded(size_t numberOfBytes)
    862862{
    863     auto sizeForBufferSwitchItem = paddedSizeOfTypeAndItemInBytes(ItemType::MetaCommandSwitchTo);
     863    auto sizeForBufferSwitchItem = paddedSizeOfTypeAndItemInBytes(ItemType::MetaCommandSwitchToItemBuffer);
    864864    if (m_writtenNumberOfBytes + numberOfBytes + sizeForBufferSwitchItem <= m_writableBuffer.capacity)
    865865        return;
     
    868868    bool hadPreviousBuffer = m_writableBuffer;
    869869    if (hadPreviousBuffer)
    870         uncheckedAppend<MetaCommandSwitchTo>(nextBuffer.identifier);
     870        uncheckedAppend<MetaCommandSwitchToItemBuffer>(nextBuffer.identifier);
    871871    auto previousBuffer = std::exchange(m_writableBuffer, { });
    872872    previousBuffer.capacity = std::exchange(m_writtenNumberOfBytes, 0);
  • trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItemType.cpp

    r269753 r270006  
    127127    case ItemType::FlushContext:
    128128        return sizeof(FlushContext);
    129     case ItemType::MetaCommandSwitchTo:
    130         return sizeof(MetaCommandSwitchTo);
     129    case ItemType::MetaCommandSwitchToItemBuffer:
     130        return sizeof(MetaCommandSwitchToItemBuffer);
    131131    case ItemType::PutImageData:
    132132        return sizeof(PutImageData);
     
    181181    case ItemType::ConcatenateCTM:
    182182    case ItemType::FlushContext:
    183     case ItemType::MetaCommandSwitchTo:
     183    case ItemType::MetaCommandSwitchToItemBuffer:
    184184    case ItemType::Restore:
    185185    case ItemType::Rotate:
     
    292292    case ItemType::FillRect:
    293293    case ItemType::FlushContext:
    294     case ItemType::MetaCommandSwitchTo:
     294    case ItemType::MetaCommandSwitchToItemBuffer:
    295295    case ItemType::PaintFrameForMedia:
    296296    case ItemType::Restore:
  • trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItemType.h

    r269724 r270006  
    7777    FillEllipse,
    7878    FlushContext,
    79     MetaCommandSwitchTo,
     79    MetaCommandSwitchToItemBuffer,
    8080    PutImageData,
    8181    PaintFrameForMedia,
  • trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp

    r269753 r270006  
    10031003}
    10041004
    1005 static TextStream& operator<<(TextStream& ts, const MetaCommandSwitchTo& item)
     1005static TextStream& operator<<(TextStream& ts, const MetaCommandSwitchToItemBuffer& item)
    10061006{
    10071007    ts.dumpProperty("identifier", item.identifier());
     
    10581058    case ItemType::FillEllipse: ts << "fill-ellipse"; break;
    10591059    case ItemType::FlushContext: ts << "flush-context"; break;
    1060     case ItemType::MetaCommandSwitchTo: ts << "meta-command-switch-to"; break;
     1060    case ItemType::MetaCommandSwitchToItemBuffer: ts << "meta-command-switch-to-item-buffer"; break;
    10611061    case ItemType::PutImageData: ts << "put-image-data"; break;
    10621062    case ItemType::PaintFrameForMedia: ts << "paint-frame-for-media"; break;
     
    12141214        ts << item.get<FlushContext>();
    12151215        break;
    1216     case ItemType::MetaCommandSwitchTo:
    1217         ts << item.get<MetaCommandSwitchTo>();
     1216    case ItemType::MetaCommandSwitchToItemBuffer:
     1217        ts << item.get<MetaCommandSwitchToItemBuffer>();
    12181218        break;
    12191219    case ItemType::PutImageData:
  • trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h

    r269753 r270006  
    22342234// FIXME: This should be refactored so that the command to "switch to the next item buffer"
    22352235// is not itself a drawing item.
    2236 class MetaCommandSwitchTo {
    2237 public:
    2238     static constexpr ItemType itemType = ItemType::MetaCommandSwitchTo;
    2239     static constexpr bool isInlineItem = true;
    2240     static constexpr bool isDrawingItem = false;
    2241 
    2242     MetaCommandSwitchTo(ItemBufferIdentifier identifier)
     2236class MetaCommandSwitchToItemBuffer {
     2237public:
     2238    static constexpr ItemType itemType = ItemType::MetaCommandSwitchToItemBuffer;
     2239    static constexpr bool isInlineItem = true;
     2240    static constexpr bool isDrawingItem = false;
     2241
     2242    MetaCommandSwitchToItemBuffer(ItemBufferIdentifier identifier)
    22432243        : m_identifier(identifier)
    22442244    {
     
    23082308    WebCore::DisplayList::ItemType::FillEllipse,
    23092309    WebCore::DisplayList::ItemType::FlushContext,
    2310     WebCore::DisplayList::ItemType::MetaCommandSwitchTo,
     2310    WebCore::DisplayList::ItemType::MetaCommandSwitchToItemBuffer,
    23112311    WebCore::DisplayList::ItemType::PutImageData,
    23122312    WebCore::DisplayList::ItemType::PaintFrameForMedia,
  • trunk/Source/WebKit/ChangeLog

    r270002 r270006  
     12020-11-18  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Rename MetaCommandSwitchTo to MetaCommandSwitchToItemBuffer
     4        https://bugs.webkit.org/show_bug.cgi?id=219130
     5
     6        Reviewed by Tim Horton.
     7
     8        * GPUProcess/graphics/RemoteImageBuffer.h:
     9        * GPUProcess/graphics/RemoteRenderingBackend.cpp:
     10        (WebKit::RemoteRenderingBackend::decodeItem):
     11        * WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
     12
    1132020-11-18  Wenson Hsieh  <wenson_hsieh@apple.com>
    214
  • trunk/Source/WebKit/GPUProcess/graphics/RemoteImageBuffer.h

    r270002 r270006  
    9393        }
    9494
    95         if (item.is<WebCore::DisplayList::MetaCommandSwitchTo>()) {
    96             auto nextBufferIdentifier = item.get<WebCore::DisplayList::MetaCommandSwitchTo>().identifier();
     95        if (item.is<WebCore::DisplayList::MetaCommandSwitchToItemBuffer>()) {
     96            auto nextBufferIdentifier = item.get<WebCore::DisplayList::MetaCommandSwitchToItemBuffer>().identifier();
    9797            m_remoteRenderingBackend.setNextItemBufferToRead(nextBufferIdentifier);
    9898            return true;
  • trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp

    r270002 r270006  
    316316    case DisplayList::ItemType::FillRect:
    317317    case DisplayList::ItemType::FlushContext:
    318     case DisplayList::ItemType::MetaCommandSwitchTo:
     318    case DisplayList::ItemType::MetaCommandSwitchToItemBuffer:
    319319    case DisplayList::ItemType::PaintFrameForMedia:
    320320    case DisplayList::ItemType::Restore:
  • trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h

    r270002 r270006  
    306306        case WebCore::DisplayList::ItemType::FillRect:
    307307        case WebCore::DisplayList::ItemType::FlushContext:
    308         case WebCore::DisplayList::ItemType::MetaCommandSwitchTo:
     308        case WebCore::DisplayList::ItemType::MetaCommandSwitchToItemBuffer:
    309309        case WebCore::DisplayList::ItemType::PaintFrameForMedia:
    310310        case WebCore::DisplayList::ItemType::Restore:
  • trunk/Tools/ChangeLog

    r270004 r270006  
     12020-11-18  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Rename MetaCommandSwitchTo to MetaCommandSwitchToItemBuffer
     4        https://bugs.webkit.org/show_bug.cgi?id=219130
     5
     6        Reviewed by Tim Horton.
     7
     8        * TestWebKitAPI/Tests/WebCore/DisplayListTests.cpp:
     9        (TestWebKitAPI::TEST):
     10
    1112020-11-18  Jonathan Bedard  <jbedard@apple.com>
    212
  • trunk/Tools/TestWebKitAPI/Tests/WebCore/DisplayListTests.cpp

    r270002 r270006  
    122122        }
    123123#endif
    124         case ItemType::MetaCommandSwitchTo:
     124        case ItemType::MetaCommandSwitchToItemBuffer:
    125125            break;
    126126        default: {
Note: See TracChangeset for help on using the changeset viewer.