Closed Bug 915342 Opened 6 years ago Closed 6 years ago

also display fill ratio when showing FPS counters

Categories

(Core :: Graphics: Layers, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: gal, Assigned: gal)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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.
Attached patch patchSplinter Review
Assignee: nobody → gal
Attachment #803229 - Flags: review?(bgirard)
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+
Ugh I landed the wrong version of the patch.
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);
https://hg.mozilla.org/mozilla-central/rev/6be52ab5df74
https://hg.mozilla.org/mozilla-central/rev/45fab5569c95
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Blocks: 916270
You need to log in before you can comment on or make changes to this bug.