Skip to content
Permalink
Browse files
Change display list item logging to respect logging options
https://bugs.webkit.org/show_bug.cgi?id=240527

Reviewed by Myles Maxfield.

Split off from the patch in bug 240422.

We need to log display list items through a function that can take the flags
argument to avoid logging unstable resource identifiers in layout tests, so
implement dumpItem() for each item type, and respect the IncludesResourceIdentifiers
flag.

* platform/graphics/displaylists/DisplayList.cpp:
(WebCore::DisplayList::DisplayList::asText const):
(WebCore::DisplayList::DisplayList::dump const):
* platform/graphics/displaylists/DisplayList.h:
* platform/graphics/displaylists/DisplayListItemType.h:
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::dumpItem):
(WebCore::DisplayList::dumpItemHandle):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::operator<<):

Canonical link: https://commits.webkit.org/250813@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294572 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
smfr committed May 20, 2022
1 parent 0b7e784 commit 292aafc71a7541eb02145c32318e06375f6f0386
Showing 5 changed files with 215 additions and 246 deletions.
@@ -110,16 +110,20 @@ bool DisplayList::shouldDumpForFlags(OptionSet<AsTextFlag> flags, ItemHandle ite
String DisplayList::asText(OptionSet<AsTextFlag> flags) const
{
TextStream stream(TextStream::LineMode::MultipleLine, TextStream::Formatting::SVGStyleRect);
#if !LOG_DISABLED
for (auto displayListItem : *this) {
auto [item, extent, itemSizeInBuffer] = displayListItem.value();
if (!shouldDumpForFlags(flags, item))
continue;

TextStream::GroupScope group(stream);
stream << item;
dumpItemHandle(stream, item, flags);
if (item.isDrawingItem())
stream << " extent " << extent;
}
#else
UNUSED_PARAM(flags);
#endif
return stream.release();
}

@@ -128,13 +132,16 @@ void DisplayList::dump(TextStream& ts) const
TextStream::GroupScope group(ts);
ts << "display list";

#if !LOG_DISABLED
for (auto displayListItem : *this) {
auto [item, extent, itemSizeInBuffer] = displayListItem.value();
TextStream::GroupScope group(ts);
ts << item;
dumpItemHandle(ts, item, { AsTextFlag::IncludesPlatformOperations, AsTextFlag::IncludesResourceIdentifiers });
if (item.isDrawingItem())
ts << " extent " << extent;
}
#endif

ts.startGroup();
ts << "size in bytes: " << sizeInBytes();
ts.endGroup();
@@ -46,12 +46,6 @@ namespace WebCore {

namespace DisplayList {

enum class AsTextFlag : uint8_t {
IncludesPlatformOperations = 1 << 0,
IncludesResourceIdentifiers = 1 << 1,
DecomposesDrawGlyphs = 1 << 2,
};

class DisplayList {
WTF_MAKE_NONCOPYABLE(DisplayList); WTF_MAKE_FAST_ALLOCATED;
friend class RecorderImpl;
@@ -28,6 +28,12 @@
namespace WebCore {
namespace DisplayList {

enum class AsTextFlag : uint8_t {
IncludesPlatformOperations = 1 << 0,
IncludesResourceIdentifiers = 1 << 1,
DecomposesDrawGlyphs = 1 << 2,
};

enum class ItemType : uint8_t {
Save,
Restore,

0 comments on commit 292aafc

Please sign in to comment.