LibreOffice Module android (master) 1
|
This class implements the variation with a small fixed-size margin with velocity bias. More...
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 |
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.
|
inline |
Returns true if a checkerboard is about to be visible and we should not throttle drawing.
Reimplemented from org.mozilla.gecko.gfx.DisplayPortCalculator.DisplayPortStrategy.
Definition at line 415 of file DisplayPortCalculator.java.
References org.mozilla.gecko.gfx.DisplayPortMetrics.contains(), org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.DANGER_ZONE_BASE_X_MULTIPLIER, org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.DANGER_ZONE_BASE_Y_MULTIPLIER, org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.DANGER_ZONE_INCR_X_MULTIPLIER, org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.DANGER_ZONE_INCR_Y_MULTIPLIER, org.mozilla.gecko.gfx.ImmutableViewportMetrics.getHeight(), org.mozilla.gecko.gfx.ImmutableViewportMetrics.getPageHeight(), org.mozilla.gecko.gfx.ImmutableViewportMetrics.getPageWidth(), org.mozilla.gecko.gfx.ImmutableViewportMetrics.getWidth(), Math, org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.velocityBiasedMargins(), org.mozilla.gecko.gfx.ImmutableViewportMetrics.viewportRectBottom, org.mozilla.gecko.gfx.ImmutableViewportMetrics.viewportRectLeft, org.mozilla.gecko.gfx.ImmutableViewportMetrics.viewportRectRight, and org.mozilla.gecko.gfx.ImmutableViewportMetrics.viewportRectTop.
|
inline |
Calculates a displayport given a viewport and panning velocity.
Reimplemented from org.mozilla.gecko.gfx.DisplayPortCalculator.DisplayPortStrategy.
Definition at line 388 of file DisplayPortCalculator.java.
References org.mozilla.gecko.util.FloatUtils.fuzzyEquals(), org.mozilla.gecko.gfx.ImmutableViewportMetrics.getHeight(), org.mozilla.gecko.gfx.ImmutableViewportMetrics.getPageHeight(), org.mozilla.gecko.gfx.ImmutableViewportMetrics.getPageWidth(), org.mozilla.gecko.gfx.ImmutableViewportMetrics.getWidth(), Math, org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.SIZE_MULTIPLIER, org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.VELOCITY_THRESHOLD, org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.velocityBiasedMargins(), and org.mozilla.gecko.gfx.ImmutableViewportMetrics.zoomFactor.
|
inline |
Definition at line 440 of file DisplayPortCalculator.java.
References org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.DANGER_ZONE_BASE_X_MULTIPLIER, org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.DANGER_ZONE_BASE_Y_MULTIPLIER, org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.DANGER_ZONE_INCR_Y_MULTIPLIER, org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.REVERSE_BUFFER, org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.SIZE_MULTIPLIER, String, and org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.VELOCITY_THRESHOLD.
|
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().
|
private |
Definition at line 341 of file DisplayPortCalculator.java.
Referenced by org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.aboutToCheckerboard(), and org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.toString().
|
private |
Definition at line 342 of file DisplayPortCalculator.java.
Referenced by org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.aboutToCheckerboard(), and org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.toString().
|
private |
Definition at line 343 of file DisplayPortCalculator.java.
Referenced by org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.aboutToCheckerboard().
|
private |
Definition at line 344 of file DisplayPortCalculator.java.
Referenced by org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.aboutToCheckerboard(), and org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.toString().
|
private |
Definition at line 336 of file DisplayPortCalculator.java.
Referenced by org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.toString(), and org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.velocityBiasedMargins().
|
private |
Definition at line 332 of file DisplayPortCalculator.java.
Referenced by org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.calculate(), and org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.toString().
|
private |
Definition at line 334 of file DisplayPortCalculator.java.
Referenced by org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.calculate(), org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.toString(), and org.mozilla.gecko.gfx.DisplayPortCalculator.VelocityBiasStrategy.velocityBiasedMargins().