Backed out changeset b966ababca8d (bug 1284721) for bustage CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Fri, 08 Jul 2016 12:17:06 -0700
changeset 304278 84b0f9eb63d0437db2e8aed0d906494f3514b745
parent 304277 b966ababca8d78c565c28214483e10a679f6c44e
child 304279 14b16ac3899119428c9c434d4e4e2c75f7a1e5f7
push id30529
push userphilringnalda@gmail.com
push dateSat, 09 Jul 2016 15:59:57 +0000
treeherderautoland@679118259e91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1284721, 1285207
milestone50.0a1
backs outb966ababca8d78c565c28214483e10a679f6c44e
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
Backed out changeset b966ababca8d (bug 1284721) for bustage CLOSED TREE *** Backed out 3 changesets (bug 1284721, bug 1285207) for bustage CLOSED TREE Backed out changeset 75f6c7e15d76 (bug 1284721) Backed out changeset b7f2d54f3904 (bug 1285207) Backed out changeset fceb3f145f91 (bug 1284721)
dom/canvas/CanvasRenderingContext2D.cpp
gfx/layers/PersistentBufferProvider.cpp
gfx/layers/client/ClientLayerManager.cpp
gfx/thebes/gfxPrefs.h
modules/libpref/init/all.js
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -899,16 +899,19 @@ public:
   static void PreTransactionCallback(void* aData)
   {
     CanvasRenderingContext2DUserData* self =
       static_cast<CanvasRenderingContext2DUserData*>(aData);
     CanvasRenderingContext2D* context = self->mContext;
     if (!context || !context->mTarget)
       return;
 
+    // Since SkiaGL default to store drawing command until flush
+    // We will have to flush it before present.
+    context->mTarget->Flush();
     context->ReturnTarget();
   }
 
   static void DidTransactionCallback(void* aData)
   {
     CanvasRenderingContext2DUserData* self =
       static_cast<CanvasRenderingContext2DUserData*>(aData);
     if (self->mContext) {
@@ -1613,17 +1616,16 @@ CanvasRenderingContext2D::EnsureTarget(c
             gfxCriticalNote << "Failed to create a SkiaGL DrawTarget, falling back to software\n";
             mode = RenderingMode::SoftwareBackendMode;
           }
         }
 #endif
       }
 
       if (!mBufferProvider) {
-        mTarget = nullptr;
         mBufferProvider = layerManager->CreatePersistentBufferProvider(size, format);
       }
     }
 
     if (mBufferProvider) {
       mTarget = mBufferProvider->BorrowDrawTarget(IntRect(IntPoint(), IntSize(mWidth, mHeight)));
     } else if (!mTarget) {
       mTarget = gfxPlatform::GetPlatform()->CreateOffscreenCanvasDrawTarget(size, format);
@@ -1660,17 +1662,16 @@ CanvasRenderingContext2D::EnsureTarget(c
       mCanvasElement->InvalidateCanvas();
     }
     // Calling Redraw() tells our invalidation machinery that the entire
     // canvas is already invalid, which can speed up future drawing.
     Redraw();
   } else {
     EnsureErrorTarget();
     mTarget = sErrorTarget;
-    mBufferProvider = nullptr;
   }
 
   // Drop a note in the debug builds if we ever use accelerated Skia canvas.
   if (mIsSkiaGL && mTarget && mTarget->GetType() == DrawTargetType::HARDWARE_RASTER) {
     gfxWarningOnce() << "Using SkiaGL canvas.";
   }
   return mode;
 }
@@ -1767,21 +1768,19 @@ CanvasRenderingContext2D::InitializeWith
                                                    gfx::DrawTarget* aTarget)
 {
   RemovePostRefreshObserver();
   mDocShell = aShell;
   AddPostRefreshObserverIfNecessary();
 
   IntSize size = aTarget->GetSize();
   SetDimensions(size.width, size.height);
-
-  if (aTarget) {
-    mTarget = aTarget;
-    mBufferProvider = new PersistentBufferProviderBasic(aTarget);
-  } else {
+  mTarget = aTarget;
+
+  if (!mTarget) {
     EnsureErrorTarget();
     mTarget = sErrorTarget;
   }
 
   if (mTarget->GetBackendType() == gfx::BackendType::CAIRO) {
     // Cf comment in EnsureTarget
     mTarget->PushClipRect(gfx::Rect(Point(0, 0), Size(mWidth, mHeight)));
   }
@@ -5788,26 +5787,29 @@ CanvasRenderingContext2D::GetBufferProvi
   if (AlreadyShutDown()) {
     return nullptr;
   }
 
   if (mBufferProvider) {
     return mBufferProvider;
   }
 
-  if (mTarget) {
-    mBufferProvider = new PersistentBufferProviderBasic(mTarget);
-    return mBufferProvider;
+  if (!mTarget) {
+    return nullptr;
   }
 
   if (aManager) {
     mBufferProvider = aManager->CreatePersistentBufferProvider(gfx::IntSize(mWidth, mHeight),
                                                                GetSurfaceFormat());
   }
 
+  if (!mBufferProvider) {
+    mBufferProvider = new PersistentBufferProviderBasic(mTarget);
+  }
+
   return mBufferProvider;
 }
 
 already_AddRefed<Layer>
 CanvasRenderingContext2D::GetCanvasLayer(nsDisplayListBuilder* aBuilder,
                                          Layer *aOldLayer,
                                          LayerManager *aManager,
                                          bool aMirror /* = false */)
--- a/gfx/layers/PersistentBufferProvider.cpp
+++ b/gfx/layers/PersistentBufferProvider.cpp
@@ -35,21 +35,16 @@ PersistentBufferProviderBasic::BorrowDra
   return dt.forget();
 }
 
 bool
 PersistentBufferProviderBasic::ReturnDrawTarget(already_AddRefed<gfx::DrawTarget> aDT)
 {
   RefPtr<gfx::DrawTarget> dt(aDT);
   MOZ_ASSERT(mDrawTarget == dt);
-  if (dt) {
-    // Since SkiaGL default to storing drawing command until flush
-    // we have to flush it before present.
-    dt->Flush();
-  }
   return true;
 }
 
 already_AddRefed<gfx::SourceSurface>
 PersistentBufferProviderBasic::BorrowSnapshot()
 {
   mSnapshot = mDrawTarget->Snapshot();
   RefPtr<SourceSurface> snapshot = mSnapshot;
--- a/gfx/layers/client/ClientLayerManager.cpp
+++ b/gfx/layers/client/ClientLayerManager.cpp
@@ -848,25 +848,17 @@ ClientLayerManager::DependsOnStaleDevice
   return gfxPlatform::GetPlatform()->GetDeviceCounter() != mDeviceCounter;
 }
 
 
 already_AddRefed<PersistentBufferProvider>
 ClientLayerManager::CreatePersistentBufferProvider(const gfx::IntSize& aSize,
                                                    gfx::SurfaceFormat aFormat)
 {
-  if (gfxPrefs::PersistentBufferProviderSharedEnabled()) {
-    RefPtr<PersistentBufferProvider> provider
-      = PersistentBufferProviderShared::Create(aSize, aFormat, AsShadowForwarder());
-    if (provider) {
-      return provider.forget();
-    }
-  }
-
-  return LayerManager::CreatePersistentBufferProvider(aSize, aFormat);
+  return PersistentBufferProviderShared::Create(aSize, aFormat, AsShadowForwarder());
 }
 
 
 ClientLayer::~ClientLayer()
 {
   if (HasShadow()) {
     PLayerChild::Send__delete__(GetShadow());
   }
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -423,17 +423,16 @@ private:
   DECL_GFX_PREF(Live, "layers.acceleration.draw-fps.write-to-file", WriteFPSToFile, bool, false);
   DECL_GFX_PREF(Once, "layers.acceleration.force-enabled",     LayersAccelerationForceEnabledDoNotUseDirectly, bool, false);
   DECL_GFX_PREF(Once, "layers.allow-d3d9-fallback",            LayersAllowD3D9Fallback, bool, false);
   DECL_GFX_PREF(Once, "layers.amd-switchable-gfx.enabled",     LayersAMDSwitchableGfxEnabled, bool, false);
   DECL_GFX_PREF(Once, "layers.async-pan-zoom.enabled",         AsyncPanZoomEnabledDoNotUseDirectly, bool, true);
   DECL_GFX_PREF(Once, "layers.async-pan-zoom.separate-event-thread", AsyncPanZoomSeparateEventThread, bool, false);
   DECL_GFX_PREF(Live, "layers.bench.enabled",                  LayersBenchEnabled, bool, false);
   DECL_GFX_PREF(Once, "layers.bufferrotation.enabled",         BufferRotationEnabled, bool, true);
-  DECL_GFX_PREF(Live, "layers.shared-buffer-provider.enabled", PersistentBufferProviderSharedEnabled, bool, false);
 #ifdef MOZ_GFX_OPTIMIZE_MOBILE
   // If MOZ_GFX_OPTIMIZE_MOBILE is defined, we force component alpha off
   // and ignore the preference.
   DECL_GFX_PREF(Skip, "layers.componentalpha.enabled",         ComponentAlphaEnabled, bool, false);
 #else
   // If MOZ_GFX_OPTIMIZE_MOBILE is not defined, we actually take the
   // preference value, defaulting to true.
   DECL_GFX_PREF(Once, "layers.componentalpha.enabled",         ComponentAlphaEnabled, bool, true);
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -4590,19 +4590,16 @@ pref("gfx.direct2d.force-enabled", false
 pref("layers.prefer-opengl", false);
 pref("layers.prefer-d3d9", false);
 pref("layers.allow-d3d9-fallback", true);
 pref("layers.d3d11.force-warp", false);
 pref("layers.d3d11.disable-warp", true);
 
 #endif
 
-// Copy-on-write canvas
-pref("layers.shared-buffer-provider.enabled", false)
-
 // Force all possible layers to be always active layers
 pref("layers.force-active", false);
 
 // Never use gralloc surfaces, even when they're available on this
 // platform and are the optimal surface type.
 pref("layers.gralloc.disable", false);
 
 // Don't use compositor-lru on this platform