use of android.view.Surface.OutOfResourcesException in project android_frameworks_base by crdroidandroid.
the class EmulatorDisplayOverlay method drawIfNeeded.
private void drawIfNeeded() {
if (!mDrawNeeded || !mVisible) {
return;
}
mDrawNeeded = false;
Rect dirty = new Rect(0, 0, mScreenSize.x, mScreenSize.y);
Canvas c = null;
try {
c = mSurface.lockCanvas(dirty);
} catch (IllegalArgumentException e) {
} catch (OutOfResourcesException e) {
}
if (c == null) {
return;
}
c.drawColor(Color.TRANSPARENT, PorterDuff.Mode.SRC);
mSurfaceControl.setPosition(0, 0);
// Always draw the overlay with square dimensions
int size = Math.max(mScreenSize.x, mScreenSize.y);
mOverlay.setBounds(0, 0, size, size);
mOverlay.draw(c);
mSurface.unlockCanvasAndPost(c);
}
Aggregations