Bug 902474 - Require a minimum size of 16x16 to use SkiaGL r=mattwoodrow

This commit is contained in:
James Willcox 2013-08-05 16:46:31 -04:00
parent 33c8aceca1
commit 9dffd3edff

View File

@ -800,6 +800,13 @@ CanvasRenderingContext2D::AddDemotableContext(CanvasRenderingContext2D* context)
DemotableContexts().push_back(context);
}
#define MIN_SKIA_GL_DIMENSION 16
bool
CheckSizeForSkiaGL(IntSize size) {
return size.width > MIN_SKIA_GL_DIMENSION && size.height > MIN_SKIA_GL_DIMENSION;
}
#endif
void
@ -845,7 +852,7 @@ CanvasRenderingContext2D::EnsureTarget()
nsCOMPtr<nsIGfxInfo> gfxInfo = do_GetService("@mozilla.org/gfx/info;1");
nsString vendor;
if (!mForceSoftware)
if (!mForceSoftware && CheckSizeForSkiaGL(size))
{
glContext = GLContextProvider::CreateOffscreen(gfxIntSize(size.width, size.height),
caps, GLContext::ContextFlagsNone);