Bug 1305490 - Use ALLOC_UPDATE_FROM_SURFACE flag r=mattwoodrow
authorSotaro Ikeda <sotaro.ikeda.g@gmail.com>
Tue, 11 Oct 2016 03:17:16 -0700
changeset 360361 1ecca76e7b94b1356a67cae946d7d4a2a117f114
parent 360360 61da7056917a6361f5499f5431b83421979c5233
child 360362 6e861a1843cb30d678bb4aa88c29cb9fbea61d1b
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-beta@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1305490
milestone52.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 1305490 - Use ALLOC_UPDATE_FROM_SURFACE flag r=mattwoodrow
dom/plugins/ipc/PluginInstanceParent.cpp
gfx/layers/client/TextureClientRecycleAllocator.cpp
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -764,17 +764,17 @@ PluginInstanceParent::RecvShowDirectBitm
         return false;
     }
 
     // Allocate a texture for the compositor.
     RefPtr<TextureClientRecycleAllocator> allocator = mParent->EnsureTextureAllocator();
     RefPtr<TextureClient> texture = allocator->CreateOrRecycle(
         format, size, BackendSelector::Content,
         TextureFlags::NO_FLAGS,
-        ALLOC_FOR_OUT_OF_BAND_CONTENT);
+        TextureAllocationFlags(ALLOC_FOR_OUT_OF_BAND_CONTENT | ALLOC_UPDATE_FROM_SURFACE));
     if (!texture) {
         NS_WARNING("Could not allocate a TextureClient for plugin!");
         return false;
     }
 
     // Upload the plugin buffer.
     {
         TextureClientAutoLock autoLock(texture, OpenMode::OPEN_WRITE_ONLY);
@@ -831,17 +831,17 @@ PluginInstanceParent::RecvShowDirectDXGI
         return false;
     }
 
     RefPtr<TextureClientRecycleAllocator> allocator = mParent->EnsureTextureAllocator();
     RefPtr<TextureClient> texture = allocator->CreateOrRecycle(
         surface->GetFormat(), surface->GetSize(),
         BackendSelector::Content,
         TextureFlags::NO_FLAGS,
-        ALLOC_FOR_OUT_OF_BAND_CONTENT);
+        TextureAllocationFlags(ALLOC_FOR_OUT_OF_BAND_CONTENT | ALLOC_UPDATE_FROM_SURFACE));
     if (!texture) {
         NS_WARNING("Could not allocate a TextureClient for plugin!");
         return false;
     }
 
     surface->CopyToTextureClient(texture);
 
     gfx::IntSize size(surface->GetSize());
--- a/gfx/layers/client/TextureClientRecycleAllocator.cpp
+++ b/gfx/layers/client/TextureClientRecycleAllocator.cpp
@@ -160,22 +160,16 @@ TextureClientRecycleAllocator::CreateOrR
                                               aTextureFlags,
                                               aAllocFlags);
   return CreateOrRecycle(helper);
 }
 
 already_AddRefed<TextureClient>
 TextureClientRecycleAllocator::CreateOrRecycle(ITextureClientAllocationHelper& aHelper)
 {
-  // TextureAllocationFlags is actually used only by ContentClient.
-  // This class does not handle ContentClient's TextureClient allocation.
-  MOZ_ASSERT(aHelper.mAllocationFlags == TextureAllocationFlags::ALLOC_DEFAULT ||
-             aHelper.mAllocationFlags == TextureAllocationFlags::ALLOC_DISALLOW_BUFFERTEXTURECLIENT ||
-             aHelper.mAllocationFlags == TextureAllocationFlags::ALLOC_FOR_OUT_OF_BAND_CONTENT ||
-             aHelper.mAllocationFlags == TextureAllocationFlags::ALLOC_MANUAL_SYNCHRONIZATION);
   MOZ_ASSERT(aHelper.mTextureFlags & TextureFlags::RECYCLE);
 
   RefPtr<TextureClientHolder> textureHolder;
 
   {
     MutexAutoLock lock(mLock);
     if (mIsDestroyed) {
       return nullptr;