Bug 888445 - Only use SkiaGL canvas on NVIDIA r=bjacob

This commit is contained in:
James Willcox 2013-06-28 15:59:44 -04:00
parent 1561ddb942
commit 5d2fe5dbb6

View File

@ -104,6 +104,7 @@
#include "GLContextProvider.h"
#include "GLContextSkia.h"
#include "SurfaceTypes.h"
#include "nsIGfxInfo.h"
using mozilla::gl::GLContext;
using mozilla::gl::GLContextProvider;
#endif
@ -873,8 +874,14 @@ CanvasRenderingContext2D::EnsureTarget()
DemoteOldestContextIfNecessary();
nsRefPtr<GLContext> glContext;
nsCOMPtr<nsIGfxInfo> gfxInfo = do_GetService("@mozilla.org/gfx/info;1");
nsString vendor;
if (!mForceSoftware) {
if (!mForceSoftware &&
gfxInfo &&
NS_SUCCEEDED(gfxInfo->GetAdapterVendorID(vendor)) &&
StringBeginsWith(vendor, NS_LITERAL_STRING("NVIDIA")))
{
glContext = GLContextProvider::CreateOffscreen(gfxIntSize(size.width, size.height),
caps, GLContext::ContextFlagsNone);
}