示例#1
0
 @Override
 protected void onDraw(Canvas canvas) {
   if (mCanvasAdapter.beginPaint(canvas)) {
     canvas.drawColor(Color.TRANSPARENT, Mode.CLEAR);
     mCoreView.dynDraw(mViewAdapter, mCanvasAdapter);
     mCanvasAdapter.endPaint();
   }
 }
示例#2
0
  private int drawShapes(
      Longs docs, int gs, Longs shapes, Canvas canvas, CanvasAdapter adapter, boolean dyndraw) {
    int n = 0;

    if (adapter.beginPaint(canvas)) {
      if (mCachedBitmap == null || !dyndraw) {
        if (this.getBackground() != null) {
          this.getBackground().draw(canvas);
        }
        n = mCoreView.drawAll(docs, gs, adapter);
      } else if (mCachedBitmap != null) {
        synchronized (mCachedBitmap) {
          canvas.drawBitmap(mCachedBitmap, 0, 0, null);
          n++;
        }
      }
      if (dyndraw) {
        mCoreView.dynDraw(shapes, gs, adapter);
      }
      adapter.endPaint();
    }

    return n;
  }