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

This class implements the variation with a small fixed-size margin with velocity bias. More...

Inheritance diagram for org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy:
[legend]
Collaboration diagram for org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy:
[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

RectF velocityBiasedMargins (float xAmount, float yAmount, PointF velocity)
 Split the given amounts into margins based on the VELOCITY_THRESHOLD and REVERSE_BUFFER values. More...
 

Private Attributes

final float SIZE_MULTIPLIER
 
final float VELOCITY_THRESHOLD
 
final float REVERSE_BUFFER
 
final float DANGER_ZONE_BASE_X_MULTIPLIER
 
final float DANGER_ZONE_BASE_Y_MULTIPLIER
 
final float DANGER_ZONE_INCR_X_MULTIPLIER
 
final float DANGER_ZONE_INCR_Y_MULTIPLIER
 

Detailed Description

This class implements the variation with a small fixed-size margin with velocity bias.

In this variation, the default margins are pretty small relative to the view size, but they are affected by the panning velocity. Specifically, if we are panning on one axis, we remove the margins on the other axis because we are likely axis-locked. Also once we are panning in one direction above a certain threshold velocity, we shift the buffer so that it is almost entirely in the direction of the pan, with a little bit in the reverse direction.

Definition at line 329 of file DisplayPortCalculator.java.

Member Function Documentation

◆ aboutToCheckerboard()

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

◆ calculate()

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

◆ toString()

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

◆ velocityBiasedMargins()

RectF org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.velocityBiasedMargins ( float  xAmount,
float  yAmount,
PointF  velocity 
)
inlineprivate

Split the given amounts into margins based on the VELOCITY_THRESHOLD and REVERSE_BUFFER values.

If the velocity is above the VELOCITY_THRESHOLD on an axis, split the amount into REVERSE_BUFFER and 1.0 - REVERSE_BUFFER fractions. The REVERSE_BUFFER fraction is set as the margin in the direction opposite to the velocity, and the remaining fraction is set as the margin in the direction of the velocity. If the velocity is lower than VELOCITY_THRESHOLD, split the amount evenly into the two margins on that axis.

Definition at line 364 of file DisplayPortCalculator.java.

References org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.REVERSE_BUFFER, and org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.VELOCITY_THRESHOLD.

Referenced by org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.aboutToCheckerboard(), and org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.calculate().

Member Data Documentation

◆ DANGER_ZONE_BASE_X_MULTIPLIER

final float org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.DANGER_ZONE_BASE_X_MULTIPLIER
private

◆ DANGER_ZONE_BASE_Y_MULTIPLIER

final float org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.DANGER_ZONE_BASE_Y_MULTIPLIER
private

◆ DANGER_ZONE_INCR_X_MULTIPLIER

final float org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.DANGER_ZONE_INCR_X_MULTIPLIER
private

◆ DANGER_ZONE_INCR_Y_MULTIPLIER

final float org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.DANGER_ZONE_INCR_Y_MULTIPLIER
private

◆ REVERSE_BUFFER

final float org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.REVERSE_BUFFER
private

◆ SIZE_MULTIPLIER

final float org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.SIZE_MULTIPLIER
private

◆ VELOCITY_THRESHOLD

final float org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.VELOCITY_THRESHOLD
private

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