Closed Bug 1666802 Opened 4 years ago Closed 4 years ago

Clean up layers logging code

Categories

(Core :: Graphics: Layers, task, P3)

task

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: kats, Assigned: kats)

References

Details

Attachments

(5 files)

We have a bunch of stuff in LayersLogging.* that knows how to stringify various types and structs for debug-printing. It's a bit inconsistent though and having this code centralized in LayersLogging.* rather than embedded in the individual classes/structs seems odd.

I would like to make it so that each struct that we care about logging has a built-in function that can serialize itself to an ostream. This seems like a quasi-standard way of doing things, in that the gtest framework will look for such a mechanism to print structures on failed assertions.

The gfx/2d code already has this in some places so I'm just proposing we use that consistently everywhere instead of having to pick one of the many places we have to generate logging.

As a bonus it would be nice to fix https://bugzilla.mozilla.org/show_bug.cgi?id=1334042 so MOZ_LOG can then take these structs directly in a streaming style.

See Also: → 1334042

Note that we have a ToString() function which uses operator<<, similar to the way Stringify uses the LayersLogging AppendToString functions. As part of this cleanup, we may want to unify the two.

Indeed. We should dump Stringify after this unification.

Severity: -- → S3
Priority: -- → P3
Assignee: nobody → kats

This also adds all the missing flags to the serializer.

Depends on D93142

This also adds some missing types to the serializer.

Depends on D93143

The remaining functions are moved to be with their brethren in xpcom.

Depends on D93145

Pushed by kgupta@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1a3828a49bce Modify the ScrollPositionUpdate serializer to write to an ostream directly. r=mattwoodrow https://hg.mozilla.org/integration/autoland/rev/8722892ad618 Move the TextureFlags serializer into an ostream operator. r=mattwoodrow https://hg.mozilla.org/integration/autoland/rev/ba47f161259a Move the SurfaceFormat serializer into an ostream operator. r=mattwoodrow https://hg.mozilla.org/integration/autoland/rev/5f57cee9e5d3 Remove unused serializers. r=mattwoodrow https://hg.mozilla.org/integration/autoland/rev/aa3bbbc5a7d3 Remove LayersLogging.*. r=mattwoodrow
Depends on: 1711900
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: