Closed Bug 1208661 Opened 10 years ago Closed 10 years ago

Dump client-side textures and integrate them into the HTML display list dump

Categories

(Core :: Graphics: Layers, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: botond, Assigned: botond)

References

Details

Attachments

(8 files)

40 bytes, text/x-review-board-request
BenWa
: review+
Details
40 bytes, text/x-review-board-request
BenWa
: review+
Details
40 bytes, text/x-review-board-request
BenWa
: review+
Details
40 bytes, text/x-review-board-request
BenWa
: review+
Details
40 bytes, text/x-review-board-request
BenWa
: review+
Details
40 bytes, text/x-review-board-request
BenWa
: review+
Details
40 bytes, text/x-review-board-request
BenWa
: review+
Details
40 bytes, text/x-review-board-request
BenWa
: review+
Details
This bug is to track landing the patches I used to produce the HTML display list dumps in bug 1205630 (e.g. [1]). This basically involves: - Fixing the dumping of client-side textures for individual display items. - Dumping client-side textures for layers. - Fixing the integration of these into the HTML display list dump, and making said dump nicer by showing the images in-line. [1] https://bug1205630.bmoattachments.org/attachment.cgi?id=8665158
Depends on: 1206915
Assignee: nobody → botond
Bug 1208661 - Move Dump() up from ContentClient to CompositableClient. r=mattwoodrow Only some ContentClient implementations implement it, but it allows it to be called from more general code. Other CompositableClient implementations can be provided later.
Bug 1208661 - Make ContentClient dumping play nicely with HTML dumping. r=mattwoodrow
Bug 1208661 - Support dumping client-side layer textures without compression. r=mattwoodrow Compression is used by the profiler, but we need uncompressed textures for the browser to be able to render them when we include them in the HTML paint dump.
Bug 1208661 - Do not assume that PaintRoot()'s contributions to the HTML paint dump will all be inside a <script> tag. r=mattwoodrow
Bug 1208661 - Dump client-side layer textures. r=mattwoodrow
Bug 1208661 - Implement SourceSurfaceDual::GetDataSurface() for debugging purposes. r=mattwoodrow
Bug 1208661 - Show display list and layer textures in-line in the HTML paint dump. r=mattwoodrow
These patches are an attempt to turn my local changes into something landable. Before posting them for review, I'd like to ask Matt's feedback on a couple of a things: 1) There are currently two places where we dump compositor-side textures for individual layers. - One is in Layer::Dump(), where we call CompositableHost::Dump() [1]. - The other is the calls to WriteSnapshotToDumpFile() in the various XXXLayerComposite::Render() implementations [2] [3] [4] [5], which are meant to be used together with the call to WriteSnapshotLinkToDumpFile() in Layer::Dump() [6]. Right now, my client-side dumping code is a mismash of these two, using WriteSnapshotLinkToDumpFile() to emit the link, and CompositableClient::Dump() to emit the texture itself. Do you know why we have these two compositor-side paths? Ideally I'd like to unify them, and then use the same approach on the client side. 2) To ensure that every display item that's painted gets an image in the dump, I had to implement SourceSurfaceDual::GetDataSurface(). I implemented it by returning |mA->GetDataSurface()|, which caused *something* to show up in the dumps, which was good enough for my purposes. Is this remotely appropriate? Should I be doing something else instead? [1] https://dxr.mozilla.org/mozilla-central/rev/5abe3c4deab94270440422c850bbeaf512b1f38d/gfx/layers/Layers.cpp#1685 [2] https://dxr.mozilla.org/mozilla-central/rev/5abe3c4deab94270440422c850bbeaf512b1f38d/gfx/layers/composite/CanvasLayerComposite.cpp?offset=0#94 [3] https://dxr.mozilla.org/mozilla-central/rev/5abe3c4deab94270440422c850bbeaf512b1f38d/gfx/layers/composite/ContainerLayerComposite.cpp#713 [4] https://dxr.mozilla.org/mozilla-central/rev/5abe3c4deab94270440422c850bbeaf512b1f38d/gfx/layers/composite/ImageLayerComposite.cpp?offset=0#92 [5] https://dxr.mozilla.org/mozilla-central/rev/5abe3c4deab94270440422c850bbeaf512b1f38d/gfx/layers/composite/PaintedLayerComposite.cpp?offset=0#121 [6] https://dxr.mozilla.org/mozilla-central/rev/5abe3c4deab94270440422c850bbeaf512b1f38d/gfx/layers/Layers.cpp#1676
Flags: needinfo?(matt.woodrow)
Asking BenWa instead as Matt is on PTO.
Flags: needinfo?(matt.woodrow) → needinfo?(bgirard)
(In reply to Botond Ballo [:botond] from comment #8) > These patches are an attempt to turn my local changes into something > landable. > > Before posting them for review, I'd like to ask Matt's feedback on a couple > of a things: > > 1) There are currently two places where we dump compositor-side textures > for individual layers. > > ... > > Do you know why we have these two compositor-side paths? Ideally I'd > like to unify them, and then use the same approach on the client side. > My understanding is that LayerManager::Dump() gives a way to recursively dump the layer tree and the texture data without painting. The WriteSnapshotToDumpFile calls all happen during the render and thus is tied to and requires a paint to happen to dump which is not ideal. WriteSnapshotToDumpFile seems to support some things that LayerManager::Dump does not such as showing intermediate surfaces and the final frames for OGL. I can't say if its worth keeping or not given that I only use the ::Dump stuff. > 2) To ensure that every display item that's painted gets an image in the > dump, I had to implement SourceSurfaceDual::GetDataSurface(). I > implemented it by returning |mA->GetDataSurface()|, which caused > *something* to show up in the dumps, which was good enough for my > purposes. > > Is this remotely appropriate? Should I be doing something else instead? From the code: "This class facilitates black-background/white-background drawing for per-component alpha extraction for backends which do not support native component alpha." Since we don't need to support alpha extraction for visualization I think showing just the first surface is fine. If we need to support the black/white code later we can extend the support later.
Flags: needinfo?(bgirard)
Thanks for the feedback! I agree that dumping in Dump() rather than Render() is better, and accordingly I updated my patch to use the Dump() mechanisms for the client-side texture dumps consistently. Posting patch series for review.
Comment on attachment 8666267 [details] MozReview Request: Bug 1208661 - Move Dump() up from ContentClient to CompositableClient. r=BenWa Bug 1208661 - Move Dump() up from ContentClient to CompositableClient. r=BenWa Only some ContentClient implementations implement it, but it allows it to be called from more general code. Other CompositableClient implementations can be provided later.
Attachment #8666267 - Attachment description: MozReview Request: Bug 1208661 - Move Dump() up from ContentClient to CompositableClient. r=mattwoodrow → MozReview Request: Bug 1208661 - Move Dump() up from ContentClient to CompositableClient. r=BenWa
Attachment #8666267 - Flags: review?(bgirard)
Attachment #8666268 - Attachment description: MozReview Request: Bug 1208661 - Make ContentClient dumping play nicely with HTML dumping. r=mattwoodrow → MozReview Request: Bug 1208661 - Make ContentClient dumping play nicely with HTML dumping. r=BenWa
Attachment #8666268 - Flags: review?(bgirard)
Comment on attachment 8666268 [details] MozReview Request: Bug 1208661 - Make ContentClient dumping play nicely with HTML dumping. r=BenWa Bug 1208661 - Make ContentClient dumping play nicely with HTML dumping. r=BenWa
Attachment #8666269 - Attachment description: MozReview Request: Bug 1208661 - Support dumping client-side layer textures without compression. r=mattwoodrow → MozReview Request: Bug 1208661 - Support dumping client-side layer textures without compression. r=BenWa
Attachment #8666269 - Flags: review?(bgirard)
Comment on attachment 8666269 [details] MozReview Request: Bug 1208661 - Support dumping client-side layer textures without compression. r=BenWa Bug 1208661 - Support dumping client-side layer textures without compression. r=BenWa Compression is used by the profiler, but we need uncompressed textures for the browser to be able to render them when we include them in the HTML paint dump.
Attachment #8666270 - Attachment description: MozReview Request: Bug 1208661 - Do not assume that PaintRoot()'s contributions to the HTML paint dump will all be inside a <script> tag. r=mattwoodrow → MozReview Request: Bug 1208661 - Do not assume that PaintRoot()'s contributions to the HTML paint dump will all be inside a <script> tag. r=BenWa
Attachment #8666270 - Flags: review?(bgirard)
Comment on attachment 8666270 [details] MozReview Request: Bug 1208661 - Do not assume that PaintRoot()'s contributions to the HTML paint dump will all be inside a <script> tag. r=BenWa Bug 1208661 - Do not assume that PaintRoot()'s contributions to the HTML paint dump will all be inside a <script> tag. r=BenWa
Comment on attachment 8666271 [details] MozReview Request: Bug 1208661 - Dump client-side layer textures. r=BenWa Bug 1208661 - Dump client-side layer textures. r=BenWa
Attachment #8666271 - Attachment description: MozReview Request: Bug 1208661 - Dump client-side layer textures. r=mattwoodrow → MozReview Request: Bug 1208661 - Dump client-side layer textures. r=BenWa
Attachment #8666271 - Flags: review?(bgirard)
Comment on attachment 8666272 [details] MozReview Request: Bug 1208661 - Implement SourceSurfaceDual::GetDataSurface() for debugging purposes. r=BenWa Bug 1208661 - Implement SourceSurfaceDual::GetDataSurface() for debugging purposes. r=BenWa
Attachment #8666272 - Attachment description: MozReview Request: Bug 1208661 - Implement SourceSurfaceDual::GetDataSurface() for debugging purposes. r=mattwoodrow → MozReview Request: Bug 1208661 - Implement SourceSurfaceDual::GetDataSurface() for debugging purposes. r=BenWa
Attachment #8666272 - Flags: review?(bgirard)
Comment on attachment 8666273 [details] MozReview Request: Bug 1208661 - Show display list and layer textures in-line in the HTML paint dump. r=BenWa Bug 1208661 - Show display list and layer textures in-line in the HTML paint dump. r=BenWa
Attachment #8666273 - Attachment description: MozReview Request: Bug 1208661 - Show display list and layer textures in-line in the HTML paint dump. r=mattwoodrow → MozReview Request: Bug 1208661 - Show display list and layer textures in-line in the HTML paint dump. r=BenWa
Attachment #8666273 - Flags: review?(bgirard)
Bug 1208661 - Remove some no-longer-used debugging code. r=BenWa
Attachment #8666892 - Flags: review?(bgirard)
Attachment #8666267 - Flags: review?(bgirard) → review+
Comment on attachment 8666267 [details] MozReview Request: Bug 1208661 - Move Dump() up from ContentClient to CompositableClient. r=BenWa https://reviewboard.mozilla.org/r/20491/#review18477
Attachment #8666268 - Flags: review?(bgirard) → review+
Comment on attachment 8666268 [details] MozReview Request: Bug 1208661 - Make ContentClient dumping play nicely with HTML dumping. r=BenWa https://reviewboard.mozilla.org/r/20493/#review18479
Comment on attachment 8666269 [details] MozReview Request: Bug 1208661 - Support dumping client-side layer textures without compression. r=BenWa https://reviewboard.mozilla.org/r/20495/#review18465 ::: gfx/layers/client/CompositableClient.h:133 (Diff revision 2) > + bool aCompress=true) {}; Generally we should prefer enum over bool for this. I'll leave it up to you if you want to fix it or not. ::: gfx/layers/composite/TiledContentHost.cpp:635 (Diff revision 2) > + false /* compression not supported on host side */); Doesn't the layer dumping code call this? Shoudn't compress be conditional on aDumpHtml then?
Attachment #8666269 - Flags: review?(bgirard) → review+
Comment on attachment 8666270 [details] MozReview Request: Bug 1208661 - Do not assume that PaintRoot()'s contributions to the HTML paint dump will all be inside a <script> tag. r=BenWa https://reviewboard.mozilla.org/r/20497/#review18481
Attachment #8666270 - Flags: review?(bgirard) → review+
Comment on attachment 8666271 [details] MozReview Request: Bug 1208661 - Dump client-side layer textures. r=BenWa https://reviewboard.mozilla.org/r/20499/#review18473 ::: gfx/layers/Layers.cpp:1681 (Diff revision 2) > + layerId.AppendInt((uint64_t)this); Wouldn't uintptr_t be a better cast here?
Attachment #8666271 - Flags: review?(bgirard) → review+
Attachment #8666272 - Flags: review?(bgirard) → review+
Comment on attachment 8666272 [details] MozReview Request: Bug 1208661 - Implement SourceSurfaceDual::GetDataSurface() for debugging purposes. r=BenWa https://reviewboard.mozilla.org/r/20501/#review18475 ::: gfx/2d/SourceSurfaceDual.h:32 (Diff revision 2) > + return mA->GetDataSurface(); Might want to add a comment like to make it clear to the reader that this shortcut is intentional: GetDataSurface() is only meant for debugging where we're not interested in supporting component alpha so we just return mA.
Comment on attachment 8666273 [details] MozReview Request: Bug 1208661 - Show display list and layer textures in-line in the HTML paint dump. r=BenWa https://reviewboard.mozilla.org/r/20503/#review18483
Attachment #8666273 - Flags: review?(bgirard) → review+
Comment on attachment 8666892 [details] MozReview Request: Bug 1208661 - Remove some no-longer-used debugging code. r=BenWa https://reviewboard.mozilla.org/r/20615/#review18485
Attachment #8666892 - Flags: review?(bgirard) → review+
(In reply to Benoit Girard (:BenWa) from comment #22) > ::: gfx/layers/composite/TiledContentHost.cpp:635 > (Diff revision 2) > > + false /* compression not supported on host side */); > > Doesn't the layer dumping code call this? Shoudn't compress be conditional > on aDumpHtml then? TileHost::DumpTexture() ignores its |aCompress| parameter, it never does compression. (The only reason it has that parameter at all is because TileClient::DumpTexture() does, and TileHost and TileClient need to present the same interface to TiledLayerBuffer which can use either one for its |Tile| template parameter).
Comment on attachment 8666267 [details] MozReview Request: Bug 1208661 - Move Dump() up from ContentClient to CompositableClient. r=BenWa Bug 1208661 - Move Dump() up from ContentClient to CompositableClient. r=BenWa Only some ContentClient implementations implement it, but it allows it to be called from more general code. Other CompositableClient implementations can be provided later.
Comment on attachment 8666268 [details] MozReview Request: Bug 1208661 - Make ContentClient dumping play nicely with HTML dumping. r=BenWa Bug 1208661 - Make ContentClient dumping play nicely with HTML dumping. r=BenWa
Comment on attachment 8666269 [details] MozReview Request: Bug 1208661 - Support dumping client-side layer textures without compression. r=BenWa Bug 1208661 - Support dumping client-side layer textures without compression. r=BenWa Compression is used by the profiler, but we need uncompressed textures for the browser to be able to render them when we include them in the HTML paint dump.
Comment on attachment 8666270 [details] MozReview Request: Bug 1208661 - Do not assume that PaintRoot()'s contributions to the HTML paint dump will all be inside a <script> tag. r=BenWa Bug 1208661 - Do not assume that PaintRoot()'s contributions to the HTML paint dump will all be inside a <script> tag. r=BenWa
Comment on attachment 8666271 [details] MozReview Request: Bug 1208661 - Dump client-side layer textures. r=BenWa Bug 1208661 - Dump client-side layer textures. r=BenWa
Comment on attachment 8666272 [details] MozReview Request: Bug 1208661 - Implement SourceSurfaceDual::GetDataSurface() for debugging purposes. r=BenWa Bug 1208661 - Implement SourceSurfaceDual::GetDataSurface() for debugging purposes. r=BenWa
Comment on attachment 8666273 [details] MozReview Request: Bug 1208661 - Show display list and layer textures in-line in the HTML paint dump. r=BenWa Bug 1208661 - Show display list and layer textures in-line in the HTML paint dump. r=BenWa
Comment on attachment 8666892 [details] MozReview Request: Bug 1208661 - Remove some no-longer-used debugging code. r=BenWa Bug 1208661 - Remove some no-longer-used debugging code. r=BenWa
(In reply to Benoit Girard (:BenWa) from comment #24) > ::: gfx/layers/Layers.cpp:1681 > (Diff revision 2) > > + layerId.AppendInt((uint64_t)this); > > Wouldn't uintptr_t be a better cast here? I had to axe this change because it led to an ambiguous overload error on platforms where uintptr_t was neither uint32_t nor uint64_t, AppendInt() being overloaded only for the latter (and AppendInt() can't be overloaded for uintptr_t because on other platforms it can be the same as uint32_t or uint64_t). New Try push that includes the updated patches: https://treeherder.mozilla.org/#/jobs?repo=try&revision=4203c34c0f82
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: