6package org.mozilla.gecko.gfx;
9import android.graphics.PointF;
10import android.graphics.RectF;
11import android.util.DisplayMetrics;
63 DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
95 Layer getLowResLayer() {
127 void setViewportSize(
FloatSize size,
boolean forceResizeEvent) {
132 PanZoomController getPanZoomController() {
140 DisplayMetrics metrics =
mContext.getResources().getDisplayMetrics();
141 IntSize newScreenSize =
new IntSize(metrics.widthPixels, metrics.heightPixels);
167 post(
new Runnable() {
180 if (displayPort ==
null) {
194 mView.post(
new Runnable() {
211 public void setPageRect(
float cssPageLeft,
float cssPageTop,
float cssPageRight,
float cssPageBottom) {
213 RectF cssPageRect =
new RectF(cssPageLeft, cssPageTop, cssPageRight, cssPageBottom);
292 public boolean post(Runnable action) {
304 PointF origin = viewportMetrics.
getOrigin();
308 ((viewPoint.x + origin.x) / zoom),
309 ((viewPoint.y + origin.y) / zoom));
327 public void moveTo(PointF point, Float zoom) {
333 public void zoomTo(
float pageWidth,
float pageHeight) {
334 zoomTo(
new RectF(0, 0, pageWidth, pageHeight));
Common static LOKit functions, functions to send events.
static void sendSizeChangedEvent(int width, int height)
Main activity of the LibreOffice App.
void beginTransaction()
Call this before modifying the layer.
void reevaluateTiles(ImmutableViewportMetrics viewportMetrics, DisplayPortMetrics mDisplayPort)
void endTransaction()
Call this when you're done modifying the layer.
void invalidateTiles(List< SubTile > tilesToInvalidate, RectF cssRect)
Invalidate tiles which intersect the input rect.
void zoomTo(float pageWidth, float pageHeight)
LayerRenderer mLayerRenderer
void setZoomConstraints(ZoomConstraints constraints)
final DisplayPortCalculator mDisplayPortCalculator
void setAnimationTarget(ImmutableViewportMetrics viewport)
Implementation of PanZoomTarget.
volatile ImmutableViewportMetrics mViewportMetrics
void clearAndResetlayers()
void invalidateTiles(List< SubTile > tilesToInvalidate, RectF rect)
static final String LOGTAG
DisplayPortMetrics mDisplayPort
void abortPanZoomAnimation()
Aborts any pan/zoom animation that is currently in progress.
void adjustViewport(DisplayPortMetrics displayPort)
boolean getRedrawHint()
Returns true if this controller is fine with performing a redraw operation or false if it would prefe...
void setViewportMetrics(ImmutableViewportMetrics viewport)
Implementation of PanZoomTarget You must hold the monitor while calling this.
void setPageRect(RectF rect, RectF cssRect)
Sets the current page rect.
void setPageRect(float cssPageLeft, float cssPageTop, float cssPageRight, float cssPageBottom)
The compositor invokes this function whenever it determines that the page rect has changed (based on ...
Object getLock()
Implementation of PanZoomTarget.
PointF convertViewPointToLayerPoint(PointF viewPoint)
ZoomConstraints mZoomConstraints
LibreOfficeMainActivity mContext
void moveTo(PointF point, Float zoom)
Move the viewport to the desired point, and change the zoom level.
PanZoomController mPanZoomController
void forceRedraw()
Implementation of PanZoomTarget.
void setView(LayerView view)
GeckoLayerClient(LibreOfficeMainActivity context)
ComposedTileLayer mRootLayer
boolean isFullScreen()
Implementation of PanZoomTarget.
ZoomConstraints getZoomConstraints()
Implementation of PanZoomTarget.
DisplayPortMetrics getDisplayPort()
ImmutableViewportMetrics getViewportMetrics()
Implementation of PanZoomTarget.
boolean post(Runnable action)
Implementation of PanZoomTarget.
ComposedTileLayer mLowResLayer
void sendResizeEventIfNecessary(boolean force)
ImmutableViewportMetrics are used to store the viewport metrics in way that we can access a version o...
ImmutableViewportMetrics clamp()
Clamps the viewport to remain within the page rect.
ImmutableViewportMetrics setViewportSize(float width, float height)
ImmutableViewportMetrics setPageRect(RectF pageRect, RectF cssPageRect)
boolean equals(IntSize size)
The layer renderer implements the rendering logic for a layer view.
A view rendered by the layer compositor.
void setLayerRenderer(LayerRenderer renderer)
static RectF scale(RectF rect, float scale)
def run(arg=None, arg2=-1)