Title: [294981] trunk/Source/WebCore
Revision
294981
Author
hey...@apple.com
Date
2022-05-27 20:37:10 -0700 (Fri, 27 May 2022)

Log Message

Fix sense of the display list AsTextFlags
https://bugs.webkit.org/show_bug.cgi?id=240939

Reviewed by Simon Fraser.

They do the opposite of what their names suggest.

* Source/WebCore/platform/graphics/displaylists/DisplayList.cpp:
(WebCore::DisplayList::DisplayList::shouldDumpForFlags):
(WebCore::DisplayList::DisplayList::dump const):
* Source/WebCore/platform/graphics/displaylists/DisplayListItemType.h:
* Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::dumpItem):
* Source/WebCore/platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::operator<<):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::displayListForElement):
(WebCore::Internals::replayDisplayListForElement):
(WebCore::Internals::cachedGlyphDisplayListsForTextNode):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:

Canonical link: https://commits.webkit.org/251085@main

Modified Paths

Diff

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp (294980 => 294981)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp	2022-05-28 03:16:46 UTC (rev 294980)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp	2022-05-28 03:37:10 UTC (rev 294981)
@@ -87,7 +87,7 @@
 {
     switch (item.type()) {
     case ItemType::SetState:
-        if (!flags.contains(AsTextFlag::IncludesPlatformOperations)) {
+        if (flags.contains(AsTextFlag::IncludePlatformOperations)) {
             const auto& stateItem = item.get<SetState>();
             // FIXME: for now, only drop the item if the only state-change flags are platform-specific.
             if (stateItem.state().changes() == GraphicsContextState::Change::ShouldSubpixelQuantizeFonts)
@@ -97,7 +97,7 @@
 #if USE(CG)
     case ItemType::ApplyFillPattern:
     case ItemType::ApplyStrokePattern:
-        if (!flags.contains(AsTextFlag::IncludesPlatformOperations))
+        if (flags.contains(AsTextFlag::IncludePlatformOperations))
             return false;
         break;
 #endif
@@ -136,7 +136,7 @@
     for (auto displayListItem : *this) {
         auto [item, extent, itemSizeInBuffer] = displayListItem.value();
         TextStream::GroupScope group(ts);
-        dumpItemHandle(ts, item, { AsTextFlag::IncludesPlatformOperations, AsTextFlag::IncludesResourceIdentifiers });
+        dumpItemHandle(ts, item, { AsTextFlag::IncludePlatformOperations, AsTextFlag::IncludeResourceIdentifiers });
         if (item.isDrawingItem())
             ts << " extent " << extent;
     }

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItemType.h (294980 => 294981)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItemType.h	2022-05-28 03:16:46 UTC (rev 294980)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItemType.h	2022-05-28 03:37:10 UTC (rev 294981)
@@ -29,9 +29,8 @@
 namespace DisplayList {
 
 enum class AsTextFlag : uint8_t {
-    IncludesPlatformOperations      = 1 << 0,
-    IncludesResourceIdentifiers     = 1 << 1,
-    DecomposesDrawGlyphs            = 1 << 2,
+    IncludePlatformOperations      = 1 << 0,
+    IncludeResourceIdentifiers     = 1 << 1,
 };
 
 enum class ItemType : uint8_t {

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp (294980 => 294981)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp	2022-05-28 03:16:46 UTC (rev 294980)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp	2022-05-28 03:37:10 UTC (rev 294981)
@@ -767,7 +767,7 @@
 
 void dumpItem(TextStream& ts, const ClipToImageBuffer& item, OptionSet<AsTextFlag> flags)
 {
-    if (!flags.contains(AsTextFlag::IncludesResourceIdentifiers))
+    if (flags.contains(AsTextFlag::IncludeResourceIdentifiers))
         ts.dumpProperty("image-buffer-identifier", item.imageBufferIdentifier());
     ts.dumpProperty("dest-rect", item.destinationRect());
 }
@@ -785,7 +785,7 @@
 
 void dumpItem(TextStream& ts, const DrawFilteredImageBuffer& item, OptionSet<AsTextFlag> flags)
 {
-    if (!flags.contains(AsTextFlag::IncludesResourceIdentifiers))
+    if (flags.contains(AsTextFlag::IncludeResourceIdentifiers))
         ts.dumpProperty("source-image-identifier", item.sourceImageIdentifier());
     ts.dumpProperty("source-image-rect", item.sourceImageRect());
 }
@@ -801,7 +801,7 @@
 
 void dumpItem(TextStream& ts, const DrawImageBuffer& item, OptionSet<AsTextFlag> flags)
 {
-    if (!flags.contains(AsTextFlag::IncludesResourceIdentifiers))
+    if (flags.contains(AsTextFlag::IncludeResourceIdentifiers))
         ts.dumpProperty("image-buffer-identifier", item.imageBufferIdentifier());
     ts.dumpProperty("source-rect", item.source());
     ts.dumpProperty("dest-rect", item.destinationRect());
@@ -809,7 +809,7 @@
 
 void dumpItem(TextStream& ts, const DrawNativeImage& item, OptionSet<AsTextFlag> flags)
 {
-    if (!flags.contains(AsTextFlag::IncludesResourceIdentifiers))
+    if (flags.contains(AsTextFlag::IncludeResourceIdentifiers))
         ts.dumpProperty("image-identifier", item.imageIdentifier());
     ts.dumpProperty("source-rect", item.source());
     ts.dumpProperty("dest-rect", item.destinationRect());
@@ -823,7 +823,7 @@
 
 void dumpItem(TextStream& ts, const DrawPattern& item, OptionSet<AsTextFlag> flags)
 {
-    if (!flags.contains(AsTextFlag::IncludesResourceIdentifiers))
+    if (flags.contains(AsTextFlag::IncludeResourceIdentifiers))
         ts.dumpProperty("image-identifier", item.imageIdentifier());
     ts.dumpProperty("pattern-transform", item.patternTransform());
     ts.dumpProperty("tile-rect", item.tileRect());

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h (294980 => 294981)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h	2022-05-28 03:16:46 UTC (rev 294980)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h	2022-05-28 03:37:10 UTC (rev 294981)
@@ -2115,7 +2115,7 @@
 template <typename T>
 TextStream& operator<<(TextStream& ts, const T& item)
 {
-    dumpItem(ts, item, { AsTextFlag::IncludesPlatformOperations, AsTextFlag::IncludesResourceIdentifiers });
+    dumpItem(ts, item, { AsTextFlag::IncludePlatformOperations, AsTextFlag::IncludeResourceIdentifiers });
     return ts;
 }
 
@@ -2123,7 +2123,7 @@
 
 inline TextStream& operator<<(TextStream& ts, const ItemHandle& itemHandle)
 {
-    dumpItemHandle(ts, itemHandle, { AsTextFlag::IncludesPlatformOperations, AsTextFlag::IncludesResourceIdentifiers });
+    dumpItemHandle(ts, itemHandle, { AsTextFlag::IncludePlatformOperations, AsTextFlag::IncludeResourceIdentifiers });
     return ts;
 }
 #endif

Modified: trunk/Source/WebCore/testing/Internals.cpp (294980 => 294981)


--- trunk/Source/WebCore/testing/Internals.cpp	2022-05-28 03:16:46 UTC (rev 294980)
+++ trunk/Source/WebCore/testing/Internals.cpp	2022-05-28 03:37:10 UTC (rev 294981)
@@ -3216,8 +3216,8 @@
         return Exception { InvalidAccessError };
 
     OptionSet<DisplayList::AsTextFlag> displayListFlags;
-    if (flags & DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS)
-        displayListFlags.add(DisplayList::AsTextFlag::IncludesPlatformOperations);
+    if (flags & DISPLAY_LIST_INCLUDE_PLATFORM_OPERATIONS)
+        displayListFlags.add(DisplayList::AsTextFlag::IncludePlatformOperations);
 
     if (!element.renderer()->hasLayer())
         return Exception { InvalidAccessError };
@@ -3241,8 +3241,8 @@
         return Exception { InvalidAccessError };
 
     OptionSet<DisplayList::AsTextFlag> displayListFlags;
-    if (flags & DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS)
-        displayListFlags.add(DisplayList::AsTextFlag::IncludesPlatformOperations);
+    if (flags & DISPLAY_LIST_INCLUDE_PLATFORM_OPERATIONS)
+        displayListFlags.add(DisplayList::AsTextFlag::IncludePlatformOperations);
 
     if (!element.renderer()->hasLayer())
         return Exception { InvalidAccessError };
@@ -3274,8 +3274,8 @@
         return Exception { InvalidAccessError };
 
     OptionSet<DisplayList::AsTextFlag> displayListFlags;
-    if (flags & DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS)
-        displayListFlags.add(DisplayList::AsTextFlag::IncludesPlatformOperations);
+    if (flags & DISPLAY_LIST_INCLUDE_PLATFORM_OPERATIONS)
+        displayListFlags.add(DisplayList::AsTextFlag::IncludePlatformOperations);
 
     return TextPainter::cachedGlyphDisplayListsForTextNodeAsText(downcast<Text>(node), displayListFlags);
 }

Modified: trunk/Source/WebCore/testing/Internals.h (294980 => 294981)


--- trunk/Source/WebCore/testing/Internals.h	2022-05-28 03:16:46 UTC (rev 294980)
+++ trunk/Source/WebCore/testing/Internals.h	2022-05-28 03:37:10 UTC (rev 294981)
@@ -480,7 +480,7 @@
 
     enum {
         // Values need to be kept in sync with Internals.idl.
-        DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS = 1,
+        DISPLAY_LIST_INCLUDE_PLATFORM_OPERATIONS = 1,
     };
     ExceptionOr<String> displayListForElement(Element&, unsigned short flags);
     ExceptionOr<String> replayDisplayListForElement(Element&, unsigned short flags);

Modified: trunk/Source/WebCore/testing/Internals.idl (294980 => 294981)


--- trunk/Source/WebCore/testing/Internals.idl	2022-05-28 03:16:46 UTC (rev 294980)
+++ trunk/Source/WebCore/testing/Internals.idl	2022-05-28 03:37:10 UTC (rev 294981)
@@ -609,7 +609,7 @@
     undefined setElementTracksDisplayListReplay(Element element, boolean trackReplay);
 
     // Flags for displayListForElement.
-    const unsigned short DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS = 1;
+    const unsigned short DISPLAY_LIST_INCLUDE_PLATFORM_OPERATIONS = 1;
     // Returns the recorded display list.
     DOMString displayListForElement(Element element, optional unsigned short flags = 0);
     // Returns the display list that was actually painted.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to