Bug 1124249: Make sure we want accelerated canvas before going to SkiaGL. r=jrmuizel a=sledru
authorMilan Sreckovic <milan@mozilla.com>
Fri, 30 Jan 2015 14:42:12 -0500
changeset 243613 32bcf9383cee
parent 243612 1192f29eb59a
child 243614 bbc98a8c8142
push id4416
push userbschouten@mozilla.com
push date2015-02-02 01:32 +0000
treeherdermozilla-beta@32bcf9383cee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, sledru
bugs1124249
milestone36.0
Bug 1124249: Make sure we want accelerated canvas before going to SkiaGL. r=jrmuizel a=sledru
dom/canvas/CanvasRenderingContext2D.cpp
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -1342,17 +1342,19 @@ CanvasRenderingContext2D::EnsureTarget(R
     nsRefPtr<LayerManager> layerManager = nullptr;
 
     if (ownerDoc) {
       layerManager =
         nsContentUtils::PersistentLayerManagerForDocument(ownerDoc);
     }
 
      if (layerManager) {
-      if (mode == RenderingMode::OpenGLBackendMode && CheckSizeForSkiaGL(size)) {
+      if (mode == RenderingMode::OpenGLBackendMode &&
+          gfxPlatform::GetPlatform()->UseAcceleratedSkiaCanvas() &&
+          CheckSizeForSkiaGL(size)) {
         DemoteOldestContextIfNecessary();
 
         SkiaGLGlue* glue = gfxPlatform::GetPlatform()->GetSkiaGLGlue();
 
 #if USE_SKIA_GPU
         if (glue && glue->GetGrContext() && glue->GetGLContext()) {
           mTarget = Factory::CreateDrawTargetSkiaWithGrContext(glue->GetGrContext(), size, format);
           if (mTarget) {