ECode CPicture::Draw( /* [in] */ ICanvas* canvas) { Boolean is = FALSE; if (canvas->IsHardwareAccelerated(&is), is) { // throw new IllegalArgumentException( // "Picture playback is only supported on software canvas."); return E_ILLEGAL_ARGUMENT_EXCEPTION; } if (mRecordingCanvas != NULL) { EndRecording(); } NativeDraw(((Canvas*)canvas)->mNativeCanvas, mNativePicture); return NOERROR; }
ECode NinePatch::Draw( /* [in] */ ICanvas* canvas, /* [in] */ IRectF* location) { Boolean isAccelerated; canvas->IsHardwareAccelerated(&isAccelerated); if (!isAccelerated) { return NativeDraw(((Canvas*)canvas->Probe(EIID_Canvas))->mNativeCanvas, location, ((CBitmap*)mBitmap.Get())->Ni(), mChunk.Get(), mPaint != NULL ? ((Paint*)mPaint->Probe(EIID_Paint))->mNativePaint : 0, ((Canvas*)canvas->Probe(EIID_Canvas))->mDensity, ((CBitmap*)mBitmap.Get())->mDensity); } else { return canvas->DrawPatch(mBitmap, *mChunk, location, mPaint); } }