Backed out changeset 67cb195b1b45 (bug 1290081) for canvas reftest failures
authorWes Kocher <wkocher@mozilla.com>
Thu, 28 Jul 2016 13:09:07 -0700
changeset 307094 b498c2f4fdd8ba44f0d064e29d60a3e61f5acfdd
parent 307093 fc2138a46d6c1e59649f0181807974605ace82ed
child 307095 48cff1c9b619bb224dd763332836522fd60c160f
push id80027
push userkwierso@gmail.com
push dateThu, 28 Jul 2016 20:09:19 +0000
treeherdermozilla-inbound@b498c2f4fdd8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1290081
milestone50.0a1
backs out67cb195b1b45964b3d7a4d391c06d17228d47fe7
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 67cb195b1b45 (bug 1290081) for canvas reftest failures
gfx/layers/client/CanvasClient.cpp
gfx/layers/client/ClientCanvasLayer.cpp
--- a/gfx/layers/client/CanvasClient.cpp
+++ b/gfx/layers/client/CanvasClient.cpp
@@ -93,17 +93,18 @@ CanvasClient2D::UpdateFromTexture(Textur
 }
 
 void
 CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
 {
   mBufferProviderTexture = nullptr;
 
   AutoRemoveTexture autoRemove(this);
-  if (mBackBuffer && (mBackBuffer->IsReadLocked() || mBackBuffer->GetSize() != aSize)) {
+  if (mBackBuffer &&
+      (mBackBuffer->IsImmutable() || mBackBuffer->GetSize() != aSize)) {
     autoRemove.mTexture = mBackBuffer;
     mBackBuffer = nullptr;
   }
 
   bool bufferCreated = false;
   if (!mBackBuffer) {
     bool isOpaque = (aLayer->GetContentFlags() & Layer::CONTENT_OPAQUE);
     gfxContentType contentType = isOpaque
@@ -116,17 +117,16 @@ CanvasClient2D::Update(gfx::IntSize aSiz
       flags |= TextureFlags::ORIGIN_BOTTOM_LEFT;
     }
 
     mBackBuffer = CreateTextureClientForCanvas(surfaceFormat, aSize, flags, aLayer);
     if (!mBackBuffer) {
       NS_WARNING("Failed to allocate the TextureClient");
       return;
     }
-    mBackBuffer->EnableReadLock();
     MOZ_ASSERT(mBackBuffer->CanExposeDrawTarget());
 
     bufferCreated = true;
   }
 
   bool updated = false;
   {
     TextureClientAutoLock autoLock(mBackBuffer, OpenMode::OPEN_WRITE_ONLY);
--- a/gfx/layers/client/ClientCanvasLayer.cpp
+++ b/gfx/layers/client/ClientCanvasLayer.cpp
@@ -85,21 +85,26 @@ void
 ClientCanvasLayer::RenderLayer()
 {
   PROFILER_LABEL("ClientCanvasLayer", "RenderLayer",
     js::ProfileEntry::Category::GRAPHICS);
 
   RenderMaskLayers(this);
 
   if (!mCanvasClient) {
-    TextureFlags flags = TextureFlags::DEFAULT;
+    TextureFlags flags = TextureFlags::IMMEDIATE_UPLOAD;
     if (mOriginPos == gl::OriginPos::BottomLeft) {
       flags |= TextureFlags::ORIGIN_BOTTOM_LEFT;
     }
 
+    if (!mGLContext) {
+      // We don't support locking for buffer surfaces currently
+      flags |= TextureFlags::IMMEDIATE_UPLOAD;
+    }
+
     if (!mIsAlphaPremultiplied) {
       flags |= TextureFlags::NON_PREMULTIPLIED;
     }
 
     mCanvasClient = CanvasClient::CreateCanvasClient(GetCanvasClientType(),
                                                      ClientManager()->AsShadowForwarder(),
                                                      flags);
     if (!mCanvasClient) {