public void initialize(AwContents awContents) { mAwContents = awContents; if (isBackedByHardwareView()) { mHardwareView.initialize( mAwContents.getAwDrawGLFunction(), mAwContents.getAwDrawGLViewContext()); } }
@Override public void onDraw(Canvas canvas) { if (isBackedByHardwareView()) { mHardwareView.updateScroll(getScrollX(), getScrollY()); } mAwContents.onDraw(canvas); super.onDraw(canvas); }
@Override public void onDetachedFromWindow() { super.onDetachedFromWindow(); mAwContents.onDetachedFromWindow(); if (mHardwareView != null) { mHardwareView.setReadyToRenderCallback(null); } mAttachedContents = false; }
@Override public void onAttachedToWindow() { super.onAttachedToWindow(); if (mHardwareView == null || mHardwareView.isReadyToRender()) { mAwContents.onAttachedToWindow(); mAttachedContents = true; } else { mHardwareView.setReadyToRenderCallback( new Runnable() { @Override public void run() { assert !mAttachedContents; mAwContents.onAttachedToWindow(); mAttachedContents = true; } }); } }