Closed
Bug 1061393
Opened 11 years ago
Closed 10 years ago
[LayerScope] Dump Display List on Layerscope viewer
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: boris, Assigned: u459114)
References
Details
(Whiteboard: [gfx-noted])
Attachments
(3 files, 12 obsolete files)
According to our design, we also need to dump display list. In other words, we should dump the display list, and draw & combine the related rectangles together on the viewer. We should also add different tabs for display list and layer tree.
| Reporter | ||
Updated•11 years ago
|
Assignee: nobody → boris.chiou
| Reporter | ||
Updated•11 years ago
|
Whiteboard: [gfx-noted]
So far, we have two ways to dump display list
1. Dump to console
Dump display list to console is not that useful. Too many data on the screen at once.
2. Dump to html file
Better then #1, but still pure text and hard to read.
You need to turn on compile flag/ recompile/ turn on preference, which is complex for even gfx engineers.
3. Dump to profiler(Cleopatra)
Absolutely better then #1 and #2. But it still non real-time solution, you need to capture log and then display the parsed result in Cleopatra.
I think dump display list in layerscope is more promising. You can see both layer buffer and display list information of each frame real-time.
Here is my plan:
1. Send display list dump log to layerscope in chrome process
2. Send dump log with layer tree data to layerscope viewer
3. At viewer side, leverage code from layerTreeView.js in Cleopatra.
Attachment #8630881 -
Attachment is obsolete: true
Attachment #8630880 -
Attachment is obsolete: true
Attachment #8637258 -
Attachment is obsolete: true
Attachment #8637817 -
Attachment is obsolete: true
Attachment #8637994 -
Attachment is obsolete: true
| Assignee | ||
Comment 10•10 years ago
|
||
Attachment #8637998 -
Attachment is obsolete: true
| Assignee | ||
Comment 11•10 years ago
|
||
Almost done. Correct typo and more comment before send to review.
| Assignee | ||
Comment 12•10 years ago
|
||
Attachment #8637999 -
Attachment is obsolete: true
| Assignee | ||
Comment 13•10 years ago
|
||
Comment on attachment 8638290 [details] [diff] [review]
Send display list info to layerscope viewer
Hi Dan,
This patch do the following thing
1. Sends display list log from content process to LayerScope in chrome process
2. LayerScope sends display list log, by protocol buffer package, to LayerScope viewer.(Another patch of LayerScopeViewer will represent this information in a more friendly way, compares to dump plain text in console.
3. Send some more attributes to LayerScope viewer for scene reconstruction
i. scale(CSStoDevicePixel scale factor)
LayerScopeAutoFrame(int64_t aFrameStamp, float aScale)
ii. Texture coordinates of each draw
LayerScope::SetDrawRects(aQuads, aLayerRects, aTextureRects);
4. Correct the expression of display item log. Always take this form
name(value)
I notice the syntax of display item is not unified. Some of them put name inside parenthesis
(rgba 100, 200, 200, 125)
While some of them put name out of parenthesis, for example
layerBounds(%d,%d,%d,%d)
5. (Minor) remove a useless function in nsFrame.h
Hi BenWa,
Since this patch changes display list log, which may introduce a problem to cleopatra, wouldn't you mind to take a look on it?
Attachment #8638290 -
Flags: review?(dglastonbury)
Attachment #8638290 -
Flags: review?(bgirard)
Comment 14•10 years ago
|
||
Comment on attachment 8638290 [details] [diff] [review]
Send display list info to layerscope viewer
Review of attachment 8638290 [details] [diff] [review]:
-----------------------------------------------------------------
R+ with nits fixed.
::: gfx/layers/Layers.cpp
@@ +1598,5 @@
> +{
> + log.SetLength(0);
> +
> + if (gfxUtils::DumpDisplayList()) {
> + // This function retruns a plain text string which consists of two things
retruns -> returns
@@ +1605,5 @@
> + // We know the target layer of each display item by information in #1.
> + // Here is an example of a Text display item line log in #1
> + // Text p=0xa9850c00 f=0x0xaa405b00(.....
> + // f keeps the address of the target client layer of a display item.
> + // For LayerSceope, this display-item-to-clien-layer mapping is not enough
LayerSceope -> LayerScope
clien -> client
@@ +1609,5 @@
> + // For LayerSceope, this display-item-to-clien-layer mapping is not enough
> + // since LayerScope, which lives in the chrome process, knows only
> + // composite layers. As so, we need
> + // display-item-to-client-layer-to-layer-composite
> + // mapping. That's the reason we inter #2 into the log
inter -> enter
@@ +1610,5 @@
> + // since LayerScope, which lives in the chrome process, knows only
> + // composite layers. As so, we need
> + // display-item-to-client-layer-to-layer-composite
> + // mapping. That's the reason we inter #2 into the log
> + log.AppendPrintf("0x%p\n%s",(void *)this, mDisplayListLog.get());
prefer keeping * with the type, so (void*). Also spaces after , so:
log.AppendPrintf("0x%p\n%s", (void*) this, mDisplayListLog.get());
Attachment #8638290 -
Flags: review?(dglastonbury) → review+
Comment 15•10 years ago
|
||
Comment on attachment 8638290 [details] [diff] [review]
Send display list info to layerscope viewer
Review of attachment 8638290 [details] [diff] [review]:
-----------------------------------------------------------------
::: layout/base/nsDisplayList.cpp
@@ -2092,4 @@
> void
> nsDisplaySolidColor::WriteDebugInfo(std::stringstream& aStream)
> {
> - aStream << " (rgba "
Yes, these changes will break the parsing for https://github.com/bgirard/cleopatra/blob/master/js/layerTreeView.js#L137.
Note that you can test a display list in cleopatra by going to:
http://people.mozilla.org/~bgirard/cleopatra/ and pasting a displaylist there instead of a profile. You have to past the line starting at 'Painting --- before optimization':
https://github.com/bgirard/cleopatra/blob/master/js/appUI.js#L48
I'm not sure if it's really worthwhile to make these changes considering we need to fix any tools that parses this data but I'd be happy to accept any PR.
Attachment #8638290 -
Flags: review?(bgirard)
| Assignee | ||
Comment 16•10 years ago
|
||
Attachment #8638290 -
Attachment is obsolete: true
Attachment #8640397 -
Flags: review+
| Assignee | ||
Comment 17•10 years ago
|
||
fix thread assertion.
Attachment #8640397 -
Attachment is obsolete: true
Attachment #8641695 -
Flags: review+
Comment 18•10 years ago
|
||
Comment on attachment 8641695 [details] [diff] [review]
Send display list info to layerscope viewer
Review of attachment 8641695 [details] [diff] [review]:
-----------------------------------------------------------------
Two nits.
::: gfx/layers/LayerScope.cpp
@@ +691,5 @@
> + pRect->set_h(mTextureRects[i].height);
> + }
> +
> + for (std::list<GLuint>::iterator it = mTexIDs.begin(); it != mTexIDs.end(); it++) {
> + dp->add_texids(*it);
A perfect place to use range-based for loop. For example,
for (GLuint texId: mTextIds) {
dp->add_texids(texId);
}
::: layout/base/nsLayoutUtils.cpp
@@ +3364,5 @@
> gfxUtils::sDumpPaintFile = savedDumpFile;
> gPaintCount++;
> #endif
> +
> + UniquePtr<std::stringstream> lsStream = MakeUnique<std::stringstream>();
Can |std::stringsstream lsStream| be used here and pass &lsStream to PrintDisplayList?
| Assignee | ||
Comment 19•10 years ago
|
||
Keywords: leave-open
| Assignee | ||
Comment 20•10 years ago
|
||
Rebase and fix what TY mentioned.
Attachment #8641695 -
Attachment is obsolete: true
Attachment #8642216 -
Flags: review+
Keywords: checkin-needed
Keywords: checkin-needed,
leave-open
Attachment #8637243 -
Flags: review?(boris.chiou)
| Assignee | ||
Comment 21•10 years ago
|
||
Fix threading issue
Attachment #8642216 -
Attachment is obsolete: true
Attachment #8642274 -
Flags: review+
| Assignee | ||
Comment 22•10 years ago
|
||
Remove debug log
Attachment #8642274 -
Attachment is obsolete: true
Attachment #8642310 -
Flags: review+
| Assignee | ||
Comment 23•10 years ago
|
||
Update try result:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=f60325d24d88
| Assignee | ||
Comment 24•10 years ago
|
||
Please help to check-in attachment 8642310 [details] [diff] [review]
Keywords: checkin-needed,
leave-open
Comment 25•10 years ago
|
||
Keywords: checkin-needed
Comment 26•10 years ago
|
||
| Reporter | ||
Updated•10 years ago
|
Attachment #8637243 -
Flags: review?(boris.chiou) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Comment 27•8 years ago
|
||
Removing leave-open keyword from resolved bugs, per :sylvestre.
Keywords: leave-open
You need to log in
before you can comment on or make changes to this bug.
Description
•