mHasValidMask = true;
- if (maskType == MASK_NONE) {
+ final Rect bounds = getBounds();
+ if (maskType == MASK_NONE || bounds.isEmpty()) {
if (mMaskBuffer != null) {
mMaskBuffer.recycle();
mMaskBuffer = null;
}
// Ensure we have a correctly-sized buffer.
- final Rect bounds = getBounds();
if (mMaskBuffer == null
|| mMaskBuffer.getWidth() != bounds.width()
|| mMaskBuffer.getHeight() != bounds.height()) {