зеркало из https://github.com/mozilla/pjs.git
Bug 610852 Check xRGB format for XShm Image r=karlt a=benjamin
This commit is contained in:
Родитель
e944c84255
Коммит
b661d3d1ea
|
@ -110,11 +110,19 @@ nsShmImage::Create(const gfxIntSize& aSize,
|
|||
shm->mSize = aSize;
|
||||
switch (shm->mImage->depth) {
|
||||
case 24:
|
||||
shm->mFormat = gfxASurface::ImageFormatRGB24; break;
|
||||
// Only xRGB is supported.
|
||||
if ((shm->mImage->red_mask == 0xff0000) &&
|
||||
(shm->mImage->green_mask == 0xff00) &&
|
||||
(shm->mImage->blue_mask == 0xff)) {
|
||||
shm->mFormat = gfxASurface::ImageFormatRGB24;
|
||||
break;
|
||||
}
|
||||
goto unsupported;
|
||||
case 16:
|
||||
shm->mFormat = gfxASurface::ImageFormatRGB16_565; break;
|
||||
unsupported:
|
||||
default:
|
||||
NS_WARNING("Unsupported XShm Image depth!");
|
||||
NS_WARNING("Unsupported XShm Image format!");
|
||||
gShmAvailable = PR_FALSE;
|
||||
return nsnull;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче