Merge "Unify the rect names according to the coordinates" into jb-dev
This commit is contained in:
@@ -153,7 +153,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
|
|||||||
@Override
|
@Override
|
||||||
public void onGlobalLayout() {
|
public void onGlobalLayout() {
|
||||||
if (mWebView.isShown()) {
|
if (mWebView.isShown()) {
|
||||||
setGLRectViewport();
|
setInvScreenRect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -162,7 +162,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
|
|||||||
@Override
|
@Override
|
||||||
public void onScrollChanged() {
|
public void onScrollChanged() {
|
||||||
if (mWebView.isShown()) {
|
if (mWebView.isShown()) {
|
||||||
setGLRectViewport();
|
setInvScreenRect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -644,8 +644,8 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
|
|||||||
|
|
||||||
private ZoomManager mZoomManager;
|
private ZoomManager mZoomManager;
|
||||||
|
|
||||||
private final Rect mGLRectViewport = new Rect();
|
private final Rect mInvScreenRect = new Rect();
|
||||||
private final Rect mViewRectViewport = new Rect();
|
private final Rect mScreenRect = new Rect();
|
||||||
private final RectF mVisibleContentRect = new RectF();
|
private final RectF mVisibleContentRect = new RectF();
|
||||||
private boolean mGLViewportEmpty = false;
|
private boolean mGLViewportEmpty = false;
|
||||||
WebViewInputConnection mInputConnection = null;
|
WebViewInputConnection mInputConnection = null;
|
||||||
@@ -4224,11 +4224,11 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
|
|||||||
|
|
||||||
calcOurContentVisibleRectF(mVisibleContentRect);
|
calcOurContentVisibleRectF(mVisibleContentRect);
|
||||||
if (canvas.isHardwareAccelerated()) {
|
if (canvas.isHardwareAccelerated()) {
|
||||||
Rect glRectViewport = mGLViewportEmpty ? null : mGLRectViewport;
|
Rect invScreenRect = mGLViewportEmpty ? null : mInvScreenRect;
|
||||||
Rect viewRectViewport = mGLViewportEmpty ? null : mViewRectViewport;
|
Rect screenRect = mGLViewportEmpty ? null : mScreenRect;
|
||||||
|
|
||||||
int functor = nativeCreateDrawGLFunction(mNativeClass, glRectViewport,
|
int functor = nativeCreateDrawGLFunction(mNativeClass, invScreenRect,
|
||||||
viewRectViewport, mVisibleContentRect, getScale(), extras);
|
screenRect, mVisibleContentRect, getScale(), extras);
|
||||||
((HardwareCanvas) canvas).callDrawGLFunction(functor);
|
((HardwareCanvas) canvas).callDrawGLFunction(functor);
|
||||||
if (mHardwareAccelSkia != getSettings().getHardwareAccelSkiaEnabled()) {
|
if (mHardwareAccelSkia != getSettings().getHardwareAccelSkiaEnabled()) {
|
||||||
mHardwareAccelSkia = getSettings().getHardwareAccelSkiaEnabled();
|
mHardwareAccelSkia = getSettings().getHardwareAccelSkiaEnabled();
|
||||||
@@ -5548,26 +5548,26 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setGLRectViewport() {
|
void setInvScreenRect() {
|
||||||
// Use the getGlobalVisibleRect() to get the intersection among the parents
|
// Use the getGlobalVisibleRect() to get the intersection among the parents
|
||||||
// visible == false means we're clipped - send a null rect down to indicate that
|
// visible == false means we're clipped - send a null rect down to indicate that
|
||||||
// we should not draw
|
// we should not draw
|
||||||
boolean visible = mWebView.getGlobalVisibleRect(mGLRectViewport);
|
boolean visible = mWebView.getGlobalVisibleRect(mInvScreenRect);
|
||||||
if (visible) {
|
if (visible) {
|
||||||
// Then need to invert the Y axis, just for GL
|
// Then need to invert the Y axis, just for GL
|
||||||
View rootView = mWebView.getRootView();
|
View rootView = mWebView.getRootView();
|
||||||
int rootViewHeight = rootView.getHeight();
|
int rootViewHeight = rootView.getHeight();
|
||||||
mViewRectViewport.set(mGLRectViewport);
|
mScreenRect.set(mInvScreenRect);
|
||||||
int savedWebViewBottom = mGLRectViewport.bottom;
|
int savedWebViewBottom = mInvScreenRect.bottom;
|
||||||
mGLRectViewport.bottom = rootViewHeight - mGLRectViewport.top - getVisibleTitleHeightImpl();
|
mInvScreenRect.bottom = rootViewHeight - mInvScreenRect.top - getVisibleTitleHeightImpl();
|
||||||
mGLRectViewport.top = rootViewHeight - savedWebViewBottom;
|
mInvScreenRect.top = rootViewHeight - savedWebViewBottom;
|
||||||
mGLViewportEmpty = false;
|
mGLViewportEmpty = false;
|
||||||
} else {
|
} else {
|
||||||
mGLViewportEmpty = true;
|
mGLViewportEmpty = true;
|
||||||
}
|
}
|
||||||
calcOurContentVisibleRectF(mVisibleContentRect);
|
calcOurContentVisibleRectF(mVisibleContentRect);
|
||||||
nativeUpdateDrawGLFunction(mNativeClass, mGLViewportEmpty ? null : mGLRectViewport,
|
nativeUpdateDrawGLFunction(mNativeClass, mGLViewportEmpty ? null : mInvScreenRect,
|
||||||
mGLViewportEmpty ? null : mViewRectViewport,
|
mGLViewportEmpty ? null : mScreenRect,
|
||||||
mVisibleContentRect, getScale());
|
mVisibleContentRect, getScale());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5583,7 +5583,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
|
|||||||
// notify the WebKit about the new dimensions.
|
// notify the WebKit about the new dimensions.
|
||||||
sendViewSizeZoom(false);
|
sendViewSizeZoom(false);
|
||||||
}
|
}
|
||||||
setGLRectViewport();
|
setInvScreenRect();
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8602,11 +8602,11 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
|
|||||||
int color, int extra);
|
int color, int extra);
|
||||||
private native void nativeDumpDisplayTree(String urlOrNull);
|
private native void nativeDumpDisplayTree(String urlOrNull);
|
||||||
private native boolean nativeEvaluateLayersAnimations(int nativeInstance);
|
private native boolean nativeEvaluateLayersAnimations(int nativeInstance);
|
||||||
private native int nativeCreateDrawGLFunction(int nativeInstance, Rect rect,
|
private native int nativeCreateDrawGLFunction(int nativeInstance, Rect invScreenRect,
|
||||||
Rect viewRect, RectF visibleRect, float scale, int extras);
|
Rect screenRect, RectF visibleContentRect, float scale, int extras);
|
||||||
private native int nativeGetDrawGLFunction(int nativeInstance);
|
private native int nativeGetDrawGLFunction(int nativeInstance);
|
||||||
private native void nativeUpdateDrawGLFunction(int nativeInstance, Rect rect, Rect viewRect,
|
private native void nativeUpdateDrawGLFunction(int nativeInstance, Rect invScreenRect,
|
||||||
RectF visibleRect, float scale);
|
Rect screenRect, RectF visibleContentRect, float scale);
|
||||||
private native String nativeGetSelection();
|
private native String nativeGetSelection();
|
||||||
private native Rect nativeLayerBounds(int layer);
|
private native Rect nativeLayerBounds(int layer);
|
||||||
private native void nativeSetHeightCanMeasure(boolean measure);
|
private native void nativeSetHeightCanMeasure(boolean measure);
|
||||||
|
|||||||
Reference in New Issue
Block a user