LibreOffice Module android (master) 1
|
This class implements the variation where we draw more of the page at low resolution while panning. 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 | |
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 |
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.
|
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 613 of file DisplayPortCalculator.java.
References org.mozilla.gecko.gfx.DisplayPortMetrics.contains(), org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.DANGER_ZONE_MULTIPLIER, org.mozilla.gecko.gfx.ImmutableViewportMetrics.getViewport(), and org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.PREDICTION_VELOCITY_MULTIPLIER.
|
inline |
Calculates a displayport given a viewport and panning velocity.
Reimplemented from org.mozilla.gecko.gfx.DisplayPortCalculator.DisplayPortStrategy.
Definition at line 515 of file DisplayPortCalculator.java.
References org.mozilla.gecko.gfx.ImmutableViewportMetrics.getHeight(), org.mozilla.gecko.gfx.ImmutableViewportMetrics.getWidth(), org.mozilla.gecko.gfx.FloatSize.height, Math, org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.SIZE_MULTIPLIER, org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.splitBufferByVelocity(), org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.VELOCITY_EXPANSION_THRESHOLD, org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.VELOCITY_MULTIPLIER, org.mozilla.gecko.gfx.ImmutableViewportMetrics.viewportRectBottom, org.mozilla.gecko.gfx.ImmutableViewportMetrics.viewportRectLeft, org.mozilla.gecko.gfx.ImmutableViewportMetrics.viewportRectRight, org.mozilla.gecko.gfx.ImmutableViewportMetrics.viewportRectTop, org.mozilla.gecko.gfx.FloatSize.width, and org.mozilla.gecko.gfx.ImmutableViewportMetrics.zoomFactor.
|
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().
|
inline |
Definition at line 643 of file DisplayPortCalculator.java.
References String.
|
staticprivate |
Definition at line 513 of file DisplayPortCalculator.java.
Referenced by org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.aboutToCheckerboard().
|
staticprivate |
Definition at line 497 of file DisplayPortCalculator.java.
Referenced by org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.splitBufferByVelocity().
|
staticprivate |
Definition at line 512 of file DisplayPortCalculator.java.
Referenced by org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.aboutToCheckerboard().
|
staticprivate |
Definition at line 470 of file DisplayPortCalculator.java.
Referenced by org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.calculate().
|
staticprivate |
Definition at line 498 of file DisplayPortCalculator.java.
Referenced by org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.splitBufferByVelocity().
|
private |
Definition at line 459 of file DisplayPortCalculator.java.
Referenced by org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.calculate().
|
private |
Definition at line 496 of file DisplayPortCalculator.java.
Referenced by org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.splitBufferByVelocity().
|
staticprivate |
Definition at line 488 of file DisplayPortCalculator.java.
Referenced by org.mozilla.gecko.gfx.DisplayPortCalculator.DynamicResolutionStrategy.calculate().