Clean up some common Image and Canvas code.

This commit is contained in:
Alex Szpakowski
2020-02-01 23:54:51 -04:00
parent 7684920f19
commit 6c447ab4f6
11 changed files with 140 additions and 201 deletions
+5 -4
View File
@@ -2282,14 +2282,14 @@ int w_getCanvasFormats(lua_State *L)
{
supported = [](PixelFormat format) -> bool
{
return instance()->isCanvasFormatSupported(format, true);
return instance()->isPixelFormatSupported(format, true, true, false);
};
}
else
{
supported = [](PixelFormat format) -> bool
{
return instance()->isCanvasFormatSupported(format, false);
return instance()->isPixelFormatSupported(format, true, false, false);
};
}
}
@@ -2297,7 +2297,8 @@ int w_getCanvasFormats(lua_State *L)
{
supported = [](PixelFormat format) -> bool
{
return instance()->isCanvasFormatSupported(format);
bool readable = !isPixelFormatDepthStencil(format);
return instance()->isPixelFormatSupported(format, true, readable, false);
};
}
@@ -2308,7 +2309,7 @@ int w_getImageFormats(lua_State *L)
{
const auto supported = [](PixelFormat format) -> bool
{
return instance()->isImageFormatSupported(format);
return instance()->isPixelFormatSupported(format, false, true, false);
};
const auto ignore = [](PixelFormat format) -> bool