Bug 903722 - Only demote to a software canvas if we're a GL-backed Skia canvas r=bjacob
authorGeorge Wright <gwright@mozilla.com>
Fri, 30 Aug 2013 14:35:30 -0400
changeset 158545 f6d0b53da118af96a5a59879d33d440c671841e7
parent 158544 b2730cc16df13d50feb7722dd4e088366929d0ce
child 158546 676322e0166cc3970b1467b796260b4219a60078
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbjacob
bugs903722
milestone26.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 903722 - Only demote to a software canvas if we're a GL-backed Skia canvas r=bjacob
content/canvas/src/CanvasRenderingContext2D.cpp
--- a/content/canvas/src/CanvasRenderingContext2D.cpp
+++ b/content/canvas/src/CanvasRenderingContext2D.cpp
@@ -741,17 +741,17 @@ CanvasRenderingContext2D::RedrawUser(con
   mgfx::Rect newr =
     mTarget->GetTransform().TransformBounds(ToRect(r));
   Redraw(newr);
 }
 
 void CanvasRenderingContext2D::Demote()
 {
 #ifdef  USE_SKIA_GPU
-  if (!IsTargetValid() || mForceSoftware)
+  if (!IsTargetValid() || mForceSoftware || !mTarget->GetGLContext())
     return;
 
   RemoveDemotableContext(this);
 
   RefPtr<SourceSurface> snapshot = mTarget->Snapshot();
   RefPtr<DrawTarget> oldTarget = mTarget;
   mTarget = nullptr;
   mResetLayer = true;