コード例 #1
0
 public void initialize(AwContents awContents) {
   mAwContents = awContents;
   if (isBackedByHardwareView()) {
     mHardwareView.initialize(
         mAwContents.getAwDrawGLFunction(), mAwContents.getAwDrawGLViewContext());
   }
 }
コード例 #2
0
 @Override
 public void onDraw(Canvas canvas) {
   if (isBackedByHardwareView()) {
     mHardwareView.updateScroll(getScrollX(), getScrollY());
   }
   mAwContents.onDraw(canvas);
   super.onDraw(canvas);
 }
コード例 #3
0
 @Override
 public void onDetachedFromWindow() {
   super.onDetachedFromWindow();
   mAwContents.onDetachedFromWindow();
   if (mHardwareView != null) {
     mHardwareView.setReadyToRenderCallback(null);
   }
   mAttachedContents = false;
 }
コード例 #4
0
 @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;
           }
         });
   }
 }