Bug 1383786 - Rename GetImageKey into GenerateImageKey. r=sotaro
☠☠ backed out by 3330afeba84c ☠ ☠
authorNicolas Silva <nsilva@mozilla.com>
Tue, 25 Jul 2017 10:54:20 +0200
changeset 421964 3418fca78878f71e6f358417fda6d919aebdde86
parent 421963 4890e14058f44cf958aa138a03e571f645b96ea6
child 421965 f8c82658a657aa03168221ef56e22f444f28dc3b
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs1383786
milestone56.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 1383786 - Rename GetImageKey into GenerateImageKey. r=sotaro
gfx/layers/wr/WebRenderCanvasLayer.cpp
gfx/layers/wr/WebRenderCompositableHolder.cpp
gfx/layers/wr/WebRenderCompositableHolder.h
gfx/layers/wr/WebRenderLayer.cpp
gfx/layers/wr/WebRenderLayer.h
gfx/layers/wr/WebRenderPaintedLayer.cpp
gfx/layers/wr/WebRenderPaintedLayerBlob.cpp
--- a/gfx/layers/wr/WebRenderCanvasLayer.cpp
+++ b/gfx/layers/wr/WebRenderCanvasLayer.cpp
@@ -78,17 +78,17 @@ WebRenderCanvasLayer::RenderLayer(wr::Di
   wr::ImageRendering filter = wr::ToImageRendering(mSamplingFilter);
 
   if (gfxPrefs::LayersDump()) {
     printf_stderr("CanvasLayer %p texture-filter=%s\n",
                   this->GetLayer(),
                   Stringify(filter).c_str());
   }
 
-  wr::WrImageKey key = GetImageKey();
+  wr::WrImageKey key = GenerateImageKey();
   WrBridge()->AddWebRenderParentCommand(OpAddExternalImage(mExternalImageId.value(), key));
   WrManager()->AddImageKeyForDiscard(key);
 
   wr::LayoutRect r = sc.ToRelativeLayoutRect(rect);
   aBuilder.PushImage(r, r, filter, key);
 }
 
 void
--- a/gfx/layers/wr/WebRenderCompositableHolder.cpp
+++ b/gfx/layers/wr/WebRenderCompositableHolder.cpp
@@ -150,25 +150,25 @@ WebRenderCompositableHolder::UpdateAsync
   holder->mScBounds = aScBounds;
   holder->mScTransform = aScTransform;
   holder->mScaleToSize = aScaleToSize;
   holder->mFilter = aFilter;
   holder->mMixBlendMode = aMixBlendMode;
 }
 
 bool
-WebRenderCompositableHolder::GetImageKeyForTextureHost(wr::WebRenderAPI* aApi, TextureHost* aTexture, nsTArray<wr::ImageKey>& aKeys)
+WebRenderCompositableHolder::GenerateImageKeyForTextureHost(wr::WebRenderAPI* aApi, TextureHost* aTexture, nsTArray<wr::ImageKey>& aKeys)
 {
   MOZ_ASSERT(aKeys.IsEmpty());
   MOZ_ASSERT(aTexture);
 
   WebRenderTextureHost* wrTexture = aTexture->AsWebRenderTextureHost();
 
   if (!gfxEnv::EnableWebRenderRecording() && wrTexture) {
-    wrTexture->GetWRImageKeys(aKeys, std::bind(&WebRenderCompositableHolder::GetImageKey, this));
+    wrTexture->GetWRImageKeys(aKeys, std::bind(&WebRenderCompositableHolder::GenerateImageKey, this));
     MOZ_ASSERT(!aKeys.IsEmpty());
     Range<const wr::ImageKey> keys(&aKeys[0], aKeys.Length());
     wrTexture->AddWRImage(aApi, keys, wrTexture->GetExternalImageKey());
     return true;
   } else {
     RefPtr<gfx::DataSourceSurface> dSurf = aTexture->GetAsSurface();
     if (!dSurf) {
       NS_ERROR("TextureHost does not return DataSourceSurface");
@@ -178,17 +178,17 @@ WebRenderCompositableHolder::GetImageKey
     if (!dSurf->Map(gfx::DataSourceSurface::MapType::READ, &map)) {
       NS_ERROR("DataSourceSurface failed to map");
       return false;
     }
     gfx::IntSize size = dSurf->GetSize();
     wr::ImageDescriptor descriptor(size, map.mStride, dSurf->GetFormat());
     auto slice = Range<uint8_t>(map.mData, size.height * map.mStride);
 
-    wr::ImageKey key = GetImageKey();
+    wr::ImageKey key = GenerateImageKey();
     aKeys.AppendElement(key);
     aApi->AddImage(key, descriptor, slice);
     dSurf->Unmap();
   }
   return false;
 }
 
 bool
@@ -226,17 +226,17 @@ WebRenderCompositableHolder::UpdateImage
   aHolder->mKeys.Clear();
   aHolder->mCurrentTexture = nullptr;
 
   // No txture to render
   if (!texture) {
     return true;
   }
 
-  aUseExternalImage = aHolder->mUseExternalImage = GetImageKeyForTextureHost(aApi, texture, aKeys);
+  aUseExternalImage = aHolder->mUseExternalImage = GenerateImageKeyForTextureHost(aApi, texture, aKeys);
   MOZ_ASSERT(!aKeys.IsEmpty());
   aHolder->mKeys.AppendElements(aKeys);
   aHolder->mCurrentTexture = texture;
   return true;
 }
 
 void
 WebRenderCompositableHolder::ApplyAsyncImages(wr::WebRenderAPI* aApi)
--- a/gfx/layers/wr/WebRenderCompositableHolder.h
+++ b/gfx/layers/wr/WebRenderCompositableHolder.h
@@ -79,24 +79,24 @@ public:
                                 const wr::MixBlendMode& aMixBlendMode);
   void ApplyAsyncImages(wr::WebRenderAPI* aApi);
 
 private:
   void DeleteOldAsyncImages(wr::WebRenderAPI* aApi);
 
   uint32_t GetNextResourceId() { return ++mResourceId; }
   uint32_t GetNamespace() { return mIdNamespace; }
-  wr::ImageKey GetImageKey()
+  wr::ImageKey GenerateImageKey()
   {
     wr::ImageKey key;
     key.mNamespace = GetNamespace();
     key.mHandle = GetNextResourceId();
     return key;
   }
-  bool GetImageKeyForTextureHost(wr::WebRenderAPI* aApi, TextureHost* aTexture, nsTArray<wr::ImageKey>& aKeys);
+  bool GenerateImageKeyForTextureHost(wr::WebRenderAPI* aApi, TextureHost* aTexture, nsTArray<wr::ImageKey>& aKeys);
 
   struct ForwardingTextureHost {
     ForwardingTextureHost(const wr::Epoch& aEpoch, TextureHost* aTexture)
       : mEpoch(aEpoch)
       , mTexture(aTexture)
     {}
     wr::Epoch mEpoch;
     CompositableTextureHostRef mTexture;
--- a/gfx/layers/wr/WebRenderLayer.cpp
+++ b/gfx/layers/wr/WebRenderLayer.cpp
@@ -27,17 +27,17 @@ WebRenderLayer::WrManager()
 
 WebRenderBridgeChild*
 WebRenderLayer::WrBridge()
 {
   return WrManager()->WrBridge();
 }
 
 wr::WrImageKey
-WebRenderLayer::GetImageKey()
+WebRenderLayer::GenerateImageKey()
 {
   wr::WrImageKey key;
   key.mNamespace = WrBridge()->GetNamespace();
   key.mHandle = WrBridge()->GetNextResourceId();
   return key;
 }
 
 Maybe<wr::WrImageMask>
@@ -106,17 +106,17 @@ WebRenderLayer::UpdateImageKey(ImageClie
     return aOldKey;
   }
 
   // Delete old key, we are generating a new key.
   if (aOldKey.isSome()) {
     WrManager()->AddImageKeyForDiscard(aOldKey.value());
   }
 
-  wr::WrImageKey key = GetImageKey();
+  wr::WrImageKey key = GenerateImageKey();
   WrBridge()->AddWebRenderParentCommand(OpAddExternalImage(aExternalImageId, key));
   return Some(key);
 }
 
 void
 WebRenderLayer::DumpLayerInfo(const char* aLayerType, const LayerRect& aRect)
 {
   if (!gfxPrefs::LayersDump()) {
--- a/gfx/layers/wr/WebRenderLayer.h
+++ b/gfx/layers/wr/WebRenderLayer.h
@@ -42,17 +42,17 @@ public:
 
   Maybe<wr::ImageKey> UpdateImageKey(ImageClientSingle* aImageClient,
                                      ImageContainer* aContainer,
                                      Maybe<wr::ImageKey>& aOldKey,
                                      wr::ExternalImageId& aExternalImageId);
 
   WebRenderLayerManager* WrManager();
   WebRenderBridgeChild* WrBridge();
-  wr::WrImageKey GetImageKey();
+  wr::WrImageKey GenerateImageKey();
 
   LayerRect Bounds();
   LayerRect BoundsForStackingContext();
 
   // Builds a WrImageMask from the mask layer on this layer, if there is one.
   // The |aRelativeTo| parameter should be a reference to the stacking context
   // that we want this mask to be relative to. This is usually the stacking
   // context of the *parent* layer of |this|, because that is what the mask
--- a/gfx/layers/wr/WebRenderPaintedLayer.cpp
+++ b/gfx/layers/wr/WebRenderPaintedLayer.cpp
@@ -94,17 +94,17 @@ WebRenderPaintedLayer::CreateWebRenderDi
                                                   const StackingContextHelper& aSc)
 {
   ScrollingLayersHelper scroller(this, aBuilder, aSc);
   StackingContextHelper sc(aSc, aBuilder, this);
 
   LayerRect rect = Bounds();
   DumpLayerInfo("PaintedLayer", rect);
 
-  wr::WrImageKey key = GetImageKey();
+  wr::WrImageKey key = GenerateImageKey();
   WrBridge()->AddWebRenderParentCommand(OpAddExternalImage(mExternalImageId.value(), key));
   WrManager()->AddImageKeyForDiscard(key);
 
   wr::LayoutRect r = sc.ToRelativeLayoutRect(rect);
   aBuilder.PushImage(r, r, wr::ImageRendering::Auto, key);
 }
 
 void
--- a/gfx/layers/wr/WebRenderPaintedLayerBlob.cpp
+++ b/gfx/layers/wr/WebRenderPaintedLayerBlob.cpp
@@ -73,17 +73,17 @@ WebRenderPaintedLayerBlob::RenderLayer(w
 
     wr::ByteBuffer bytes(recorder->mOutputStream.mLength, (uint8_t*)recorder->mOutputStream.mData);
 
     //XXX: We should switch to updating the blob image instead of adding a new one
     //     That will get rid of this discard bit
     if (mImageKey.isSome()) {
       WrManager()->AddImageKeyForDiscard(mImageKey.value());
     }
-    mImageKey = Some(GetImageKey());
+    mImageKey = Some(GenerateImageKey());
     WrBridge()->SendAddBlobImage(mImageKey.value(), imageSize, size.width * 4, dt->GetFormat(), bytes);
     mImageBounds = visibleRegion.GetBounds();
   }
 
   ScrollingLayersHelper scroller(this, aBuilder, aSc);
   StackingContextHelper sc(aSc, aBuilder, this);
   LayerRect rect = Bounds();
   DumpLayerInfo("PaintedLayer", rect);