LibreOffice Module android (master) 1
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy Class Reference

This class implements the variation where we draw more of the page at low resolution while panning. More...

Inheritance diagram for org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy:
[legend]
Collaboration diagram for org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy:
[legend]

Public Member Functions

DisplayPortMetrics calculate (ImmutableViewportMetrics metrics, PointF velocity)
 Calculates a displayport given a viewport and panning velocity. More...
 
boolean aboutToCheckerboard (ImmutableViewportMetrics metrics, PointF velocity, DisplayPortMetrics displayPort)
 Returns true if a checkerboard is about to be visible and we should not throttle drawing. More...
 
String toString ()
 
- Public Member Functions inherited from org.mozilla.gecko.gfx.DisplayPortCalculator.DisplayPortStrategy
abstract DisplayPortMetrics calculate (ImmutableViewportMetrics metrics, PointF velocity)
 Calculates a displayport given a viewport and panning velocity. More...
 
abstract boolean aboutToCheckerboard (ImmutableViewportMetrics metrics, PointF velocity, DisplayPortMetrics displayPort)
 Returns true if a checkerboard is about to be visible and we should not throttle drawing. More...
 
boolean drawTimeUpdate (long millis, int pixels)
 Notify the strategy of a new recorded draw time. More...
 
void resetPageState ()
 Reset any page-specific state stored, as the page being displayed has changed. More...
 

Private Member Functions

float splitBufferByVelocity (float amount, float velocity)
 Split the given buffer amount into two based on the velocity. More...
 

Private Attributes

final float VELOCITY_EXPANSION_THRESHOLD
 
final float VELOCITY_FAST_THRESHOLD
 

Static Private Attributes

static final float SIZE_MULTIPLIER = 1.5f
 
static final float VELOCITY_MULTIPLIER = 60.0f
 
static final float FAST_SPLIT_FACTOR = 0.95f
 
static final float SLOW_SPLIT_FACTOR = 0.8f
 
static final float PREDICTION_VELOCITY_MULTIPLIER = 30.0f
 
static final float DANGER_ZONE_MULTIPLIER = 0.20f
 

Detailed Description

This class implements the variation where we draw more of the page at low resolution while panning.

In this variation, as we pan faster, we increase the page area we are drawing, but reduce the draw resolution to compensate. This results in the same device-pixel area drawn; the compositor then scales this up to the viewport zoom level. This results in a large area of the page drawn but it looks blurry. The assumption is that drawing extra that we never display is better than checkerboarding, where we draw less but never even show it on the screen.

Definition at line 455 of file DisplayPortCalculator.java.

Member Function Documentation

◆ aboutToCheckerboard()

boolean org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.aboutToCheckerboard ( ImmutableViewportMetrics  metrics,
PointF  velocity,
DisplayPortMetrics  displayPort 
)
inline

◆ calculate()

DisplayPortMetrics org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.calculate ( ImmutableViewportMetrics  metrics,
PointF  velocity 
)
inline

◆ splitBufferByVelocity()

float org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.splitBufferByVelocity ( float  amount,
float  velocity 
)
inlineprivate

Split the given buffer amount into two based on the velocity.

Given an amount of total usable buffer on an axis, this will return the amount that should be used on the left/top side of the axis (the side which a negative velocity vector corresponds to).

Definition at line 592 of file DisplayPortCalculator.java.

References org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.FAST_SPLIT_FACTOR, org.mozilla.gecko.util.FloatUtils.fuzzyEquals(), org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.SLOW_SPLIT_FACTOR, and org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.VELOCITY_FAST_THRESHOLD.

Referenced by org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.calculate().

◆ toString()

String org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.toString ( )
inline

Definition at line 643 of file DisplayPortCalculator.java.

References String.

Member Data Documentation

◆ DANGER_ZONE_MULTIPLIER

final float org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.DANGER_ZONE_MULTIPLIER = 0.20f
staticprivate

◆ FAST_SPLIT_FACTOR

final float org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.FAST_SPLIT_FACTOR = 0.95f
staticprivate

◆ PREDICTION_VELOCITY_MULTIPLIER

final float org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.PREDICTION_VELOCITY_MULTIPLIER = 30.0f
staticprivate

◆ SIZE_MULTIPLIER

final float org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.SIZE_MULTIPLIER = 1.5f
staticprivate

◆ SLOW_SPLIT_FACTOR

final float org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.SLOW_SPLIT_FACTOR = 0.8f
staticprivate

◆ VELOCITY_EXPANSION_THRESHOLD

final float org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.VELOCITY_EXPANSION_THRESHOLD
private

◆ VELOCITY_FAST_THRESHOLD

final float org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.VELOCITY_FAST_THRESHOLD
private

◆ VELOCITY_MULTIPLIER

final float org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.VELOCITY_MULTIPLIER = 60.0f
staticprivate

The documentation for this class was generated from the following file: