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 249504 81a5207ffc757ed73a89444e37e1e4f71377b7ac
parent 249503 5a89d54ef5e916671123d0959612daea4d084d68
child 249505 0244a7d16f88010afb858393ca289e874554a81d
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, sledru
bugs1124249
milestone37.0a2
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) {