mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 610852 Check xRGB format for XShm Image r=karlt a=benjamin
This commit is contained in:
parent
79ff7cd658
commit
696c8578e7
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user