Bug 1335149 - Remove unnecessary flush() calls from canvas implementation. r=bas a=gchang
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Wed, 01 Feb 2017 15:04:38 -0500
changeset 376032 c73bb9843d79d3107031b40efe2731d3ae465f66
parent 376031 0ab74d80ea74104c4cd114be32357d906b44d8e3
child 376033 35072b8a12710b726bad9ec1daaff3c146ae3c74
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas, gchang
bugs1335149
milestone53.0a2
Bug 1335149 - Remove unnecessary flush() calls from canvas implementation. r=bas a=gchang Flushing should usually be done by the moz2d backend unless we're accessing the data through other mechanisms.
dom/canvas/CanvasRenderingContext2D.cpp
gfx/thebes/gfxContext.cpp
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -5363,17 +5363,16 @@ CanvasRenderingContext2D::DrawWindow(nsG
     }
 
     gfx::Rect destRect(0, 0, aW, aH);
     gfx::Rect sourceRect(0, 0, sw, sh);
     mTarget->DrawSurface(source, destRect, sourceRect,
                          DrawSurfaceOptions(gfx::SamplingFilter::POINT),
                          DrawOptions(GlobalAlpha(), UsedOperation(),
                                      AntialiasMode::NONE));
-    mTarget->Flush();
   } else {
     mTarget->SetTransform(matrix);
   }
 
   // note that x and y are coordinates in the document that
   // we're drawing; x and y are drawn to 0,0 in current user
   // space.
   RedrawUser(gfxRect(0, 0, aW, aH));
--- a/gfx/thebes/gfxContext.cpp
+++ b/gfx/thebes/gfxContext.cpp
@@ -111,17 +111,16 @@ gfxContext::CreatePreservingTransformOrN
 
 gfxContext::~gfxContext()
 {
   for (int i = mStateStack.Length() - 1; i >= 0; i--) {
     for (unsigned int c = 0; c < mStateStack[i].pushedClips.Length(); c++) {
       mStateStack[i].drawTarget->PopClip();
     }
   }
-  mDT->Flush();
 }
 
 void
 gfxContext::Save()
 {
   CurrentState().transform = mTransform;
   mStateStack.AppendElement(AzureState(CurrentState()));
   CurrentState().pushedClips.Clear();