Bug 990017. Prevent skia accelerated canvas backends from rendering content. r=jmuizelaar
authorMason Chang <mchang@mozilla.com>
Wed, 02 Dec 2015 09:11:52 -0800
changeset 275237 4feee02dd1d6a7a2dab8834622f23f4a242c630c
parent 275236 a52fb149b9ee7b3bd99c1b0161d6b9ad4505b9f8
child 275238 4478329ac0f94dca99b2acf7a6a05a8a56ebbf47
push id68784
push usermchang@mozilla.com
push dateWed, 02 Dec 2015 17:12:03 +0000
treeherdermozilla-inbound@4feee02dd1d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmuizelaar
bugs990017
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 990017. Prevent skia accelerated canvas backends from rendering content. r=jmuizelaar
gfx/thebes/gfxPlatform.cpp
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -1111,16 +1111,26 @@ gfxPlatform::PopulateScreenInfo()
 
 bool
 gfxPlatform::SupportsAzureContentForDrawTarget(DrawTarget* aTarget)
 {
   if (!aTarget) {
     return false;
   }
 
+#ifdef USE_SKIA_GPU
+ // Skia content rendering doesn't support GPU acceleration, so we can't
+ // use the same backend if the current backend is accelerated.
+ if ((aTarget->GetType() == DrawTargetType::HARDWARE_RASTER)
+     && (aTarget->GetBackendType() ==  BackendType::SKIA))
+ {
+  return false;
+ }
+#endif
+
   return SupportsAzureContentForType(aTarget->GetBackendType());
 }
 
 bool
 gfxPlatform::UseAcceleratedSkiaCanvas()
 {
   return gfxPrefs::CanvasAzureAccelerated() &&
          mPreferredCanvasBackend == BackendType::SKIA;