Closed
Bug 915342
Opened 12 years ago
Closed 12 years ago
also display fill ratio when showing FPS counters
Categories
(Core :: Graphics: Layers, defect)
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: gal, Assigned: gal)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
10.72 KB,
patch
|
BenWa
:
review+
|
Details | Diff | Splinter Review |
This patch prints the current fill ratio in addition to the FPS counters. The fill ratio is defined as estimated-number-of-pixels-we-fill / framebuffer-pixels * 100.
| Assignee | ||
Comment 1•12 years ago
|
||
Assignee: nobody → gal
| Assignee | ||
Updated•12 years ago
|
Attachment #803229 -
Flags: review?(bgirard)
Comment 2•12 years ago
|
||
Comment on attachment 803229 [details] [diff] [review]
patch
Review of attachment 803229 [details] [diff] [review]:
-----------------------------------------------------------------
Ship it!
::: gfx/layers/opengl/CompositorOGL.cpp
@@ +218,5 @@
> + unsigned txnFps = unsigned(mTransactionFps.GetFpsAt(aNow));
> +
> + DrawCounter(0, fps, context, copyprog);
> + DrawCounter(80, txnFps, context, copyprog);
> + DrawCounter(160, aFillRatio, context, copyprog);
Nice, much cleaner!
@@ +1317,5 @@
> }
>
> if (mFPS) {
> + double fillRatio = 0;
> + if (mPixelsFilled > 0.0f && mPixelsPerFrame > 0.0f) {
mPixelsFilled > 0 && mPixelsPerFrame > 0
@@ +1320,5 @@
> + double fillRatio = 0;
> + if (mPixelsFilled > 0.0f && mPixelsPerFrame > 0.0f) {
> + fillRatio = 100.0f * double(mPixelsFilled) / double(mPixelsPerFrame);
> + if (fillRatio > 999.0f)
> + fillRatio = 999.0f;
We don't need double precision here since we only need the 3 most significant digits. Let's make everything here float since the code here is converting back and forth between double/float and finally to unsigned.
Attachment #803229 -
Flags: review?(bgirard) → review+
| Assignee | ||
Comment 3•12 years ago
|
||
| Assignee | ||
Comment 4•12 years ago
|
||
Ugh I landed the wrong version of the patch.
| Assignee | ||
Comment 5•12 years ago
|
||
The delta:
- double fillRatio = 0;
- if (mPixelsFilled > 0.0f && mPixelsPerFrame > 0.0f) {
- fillRatio = 100.0f * double(mPixelsFilled) / double(mPixelsPerFrame);
+ float fillRatio = 0;
+ if (mPixelsFilled > 0 && mPixelsPerFrame > 0) {
+ fillRatio = 100.0f * float(mPixelsFilled) / float(mPixelsPerFrame);
| Assignee | ||
Comment 6•12 years ago
|
||
And the double->float fix from comment 5:
https://hg.mozilla.org/integration/mozilla-inbound/rev/45fab5569c95
Comment 7•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/6be52ab5df74
https://hg.mozilla.org/mozilla-central/rev/45fab5569c95
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in
before you can comment on or make changes to this bug.
Description
•