use of android.webkit.WebViewCore.DrawData in project android_frameworks_base by ParanoidAndroid.
the class ViewStateSerializer method deserializeViewState.
static DrawData deserializeViewState(InputStream stream) throws IOException {
DataInputStream dis = new DataInputStream(stream);
int version = dis.readInt();
if (version > VERSION) {
throw new IOException("Unexpected version: " + version);
}
int contentWidth = dis.readInt();
int contentHeight = dis.readInt();
int baseLayer = nativeDeserializeViewState(version, dis, new byte[WORKING_STREAM_STORAGE]);
final WebViewCore.DrawData draw = new WebViewCore.DrawData();
draw.mViewState = new WebViewCore.ViewState();
draw.mContentSize = new Point(contentWidth, contentHeight);
draw.mBaseLayer = baseLayer;
stream.close();
return draw;
}
use of android.webkit.WebViewCore.DrawData in project XobotOS by xamarin.
the class ViewStateSerializer method deserializeViewState.
static DrawData deserializeViewState(InputStream stream, WebView web) throws IOException {
DataInputStream dis = new DataInputStream(stream);
int version = dis.readInt();
if (version != VERSION) {
throw new IOException("Unexpected version: " + version);
}
int contentWidth = dis.readInt();
int contentHeight = dis.readInt();
int baseLayer = nativeDeserializeViewState(dis, new byte[WORKING_STREAM_STORAGE]);
final WebViewCore.DrawData draw = new WebViewCore.DrawData();
draw.mViewState = new WebViewCore.ViewState();
int viewWidth = web.getViewWidth();
int viewHeight = web.getViewHeightWithTitle() - web.getTitleHeight();
draw.mViewSize = new Point(viewWidth, viewHeight);
draw.mContentSize = new Point(contentWidth, contentHeight);
draw.mViewState.mDefaultScale = web.getDefaultZoomScale();
draw.mBaseLayer = baseLayer;
draw.mInvalRegion = new Region(0, 0, contentWidth, contentHeight);
return draw;
}
Aggregations