Bug 1058713 - Don't attempt to create a zero-sized CGContext for titlebar buttons. r=smichaud

This commit is contained in:
Markus Stange 2014-08-28 02:16:25 +02:00
parent 91aec94103
commit 4a057edfbd

View File

@ -2364,6 +2364,11 @@ nsChildView::UpdateTitlebarCGContext()
dirtyTitlebarRegion.And(mDirtyTitlebarRegion, mTitlebarRect);
mDirtyTitlebarRegion.SetEmpty();
if (mTitlebarRect.IsEmpty()) {
ReleaseTitlebarCGContext();
return;
}
nsIntSize texSize = RectTextureImage::TextureSizeForSize(mTitlebarRect.Size());
if (!mTitlebarCGContext ||
CGBitmapContextGetWidth(mTitlebarCGContext) != size_t(texSize.width) ||