also display fill ratio when showing FPS counters

RESOLVED FIXED in mozilla26

Status

()

Core
Graphics: Layers
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: gal, Assigned: gal)

Tracking

(Blocks: 1 bug)

Trunk
mozilla26
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
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

5 years ago
Created attachment 803229 [details] [diff] [review]
patch
Assignee: nobody → gal
(Assignee)

Updated

5 years ago
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+
(Assignee)

Comment 4

5 years ago
Ugh I landed the wrong version of the patch.
(Assignee)

Comment 5

5 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);

Comment 7

5 years ago
https://hg.mozilla.org/mozilla-central/rev/6be52ab5df74
https://hg.mozilla.org/mozilla-central/rev/45fab5569c95
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26

Updated

5 years ago
Blocks: 916270
You need to log in before you can comment on or make changes to this bug.