Bug 1229577 - Rename NewSurfaceDescriptorGralloc into SurfaceDescriptorGralloc. r=sotaro
authorNicolas Silva <nsilva@mozilla.com>
Fri, 04 Dec 2015 11:23:42 +0100
changeset 309849 32065c89200f702e9d83d1e88900d57d24f2eb4a
parent 309848 6212d0b0e634d0f491ff2baaf7ab465dc2b51fe4
child 309850 611771d8de5857df525ab3dbfd44804bd38984c8
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs1229577
milestone45.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 1229577 - Rename NewSurfaceDescriptorGralloc into SurfaceDescriptorGralloc. r=sotaro
gfx/layers/basic/GrallocTextureHostBasic.cpp
gfx/layers/basic/GrallocTextureHostBasic.h
gfx/layers/basic/TextureHostBasic.cpp
gfx/layers/composite/TextureHost.cpp
gfx/layers/ipc/LayersSurfaces.ipdlh
gfx/layers/ipc/ShadowLayerUtilsGralloc.cpp
gfx/layers/ipc/SharedBufferManagerParent.cpp
gfx/layers/opengl/GrallocTextureClient.cpp
gfx/layers/opengl/GrallocTextureHost.cpp
gfx/layers/opengl/GrallocTextureHost.h
gfx/layers/opengl/TextureHostOGL.cpp
--- a/gfx/layers/basic/GrallocTextureHostBasic.cpp
+++ b/gfx/layers/basic/GrallocTextureHostBasic.cpp
@@ -77,17 +77,17 @@ NeedsConvertFromYUVtoRGB565(int aHalForm
       MOZ_CRASH("Unhandled HAL pixel format");
       return false; // not reached
     }
   }
 }
 
 GrallocTextureHostBasic::GrallocTextureHostBasic(
   TextureFlags aFlags,
-  const NewSurfaceDescriptorGralloc& aDescriptor)
+  const SurfaceDescriptorGralloc& aDescriptor)
   : TextureHost(aFlags)
   , mGrallocHandle(aDescriptor)
   , mSize(0, 0)
   , mCropSize(0, 0)
   , mFormat(gfx::SurfaceFormat::UNKNOWN)
   , mIsOpaque(aDescriptor.isOpaque())
 {
   android::GraphicBuffer* grallocBuffer = GetGraphicBufferFromDesc(mGrallocHandle).get();
--- a/gfx/layers/basic/GrallocTextureHostBasic.h
+++ b/gfx/layers/basic/GrallocTextureHostBasic.h
@@ -19,17 +19,17 @@ class BasicCompositor;
  * A TextureHost for shared gralloc
  *
  * Most of the logic actually happens in GrallocTextureSourceBasic.
  */
 class GrallocTextureHostBasic : public TextureHost
 {
 public:
   GrallocTextureHostBasic(TextureFlags aFlags,
-                          const NewSurfaceDescriptorGralloc& aDescriptor);
+                          const SurfaceDescriptorGralloc& aDescriptor);
 
   virtual void SetCompositor(Compositor* aCompositor) override;
 
   virtual bool Lock() override;
 
   virtual gfx::SurfaceFormat GetFormat() const override;
 
   virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override;
@@ -61,17 +61,17 @@ public:
 
 #ifdef MOZ_LAYERS_HAVE_LOG
   virtual const char* Name() override { return "GrallocTextureHostBasic"; }
 #endif
 
 protected:
   RefPtr<BasicCompositor> mCompositor;
   RefPtr<DataTextureSource> mTextureSource;
-  NewSurfaceDescriptorGralloc mGrallocHandle;
+  SurfaceDescriptorGralloc mGrallocHandle;
   // gralloc buffer size.
   gfx::IntSize mSize;
   // Size reported by TextureClient, can be different in some cases (video?),
   // used by LayerRenderState.
   gfx::IntSize mCropSize;
   gfx::SurfaceFormat mFormat;
   bool mIsOpaque;
   /**
--- a/gfx/layers/basic/TextureHostBasic.cpp
+++ b/gfx/layers/basic/TextureHostBasic.cpp
@@ -25,19 +25,19 @@ CreateTextureHostBasic(const SurfaceDesc
 #ifdef XP_MACOSX
   if (aDesc.type() == SurfaceDescriptor::TSurfaceDescriptorMacIOSurface) {
     const SurfaceDescriptorMacIOSurface& desc =
       aDesc.get_SurfaceDescriptorMacIOSurface();
     return MakeAndAddRef<MacIOSurfaceTextureHostBasic>(aFlags, desc);
   }
 #endif
 #ifdef MOZ_WIDGET_GONK
-  if (aDesc.type() == SurfaceDescriptor::TNewSurfaceDescriptorGralloc) {
-      const NewSurfaceDescriptorGralloc& desc =
-        aDesc.get_NewSurfaceDescriptorGralloc();
+  if (aDesc.type() == SurfaceDescriptor::TSurfaceDescriptorGralloc) {
+      const SurfaceDescriptorGralloc& desc =
+        aDesc.get_SurfaceDescriptorGralloc();
     return MakeAndAddRef<GrallocTextureHostBasic>(aFlags, desc);
     }
 #endif
   return CreateBackendIndependentTextureHost(aDesc, aDeallocator, aFlags);
 }
 
 } // namespace layers
 } // namespace mozilla
--- a/gfx/layers/composite/TextureHost.cpp
+++ b/gfx/layers/composite/TextureHost.cpp
@@ -208,17 +208,17 @@ TextureHost::Create(const SurfaceDescrip
     case SurfaceDescriptor::TSurfaceDescriptorFileMapping:
       return CreateBackendIndependentTextureHost(aDesc, aDeallocator, aFlags);
 
     case SurfaceDescriptor::TEGLImageDescriptor:
     case SurfaceDescriptor::TSurfaceTextureDescriptor:
     case SurfaceDescriptor::TSurfaceDescriptorSharedGLTexture:
       return CreateTextureHostOGL(aDesc, aDeallocator, aFlags);
 
-    case SurfaceDescriptor::TNewSurfaceDescriptorGralloc:
+    case SurfaceDescriptor::TSurfaceDescriptorGralloc:
     case SurfaceDescriptor::TSurfaceDescriptorMacIOSurface:
       if (aBackend == LayersBackend::LAYERS_OPENGL) {
         return CreateTextureHostOGL(aDesc, aDeallocator, aFlags);
       } else {
         return CreateTextureHostBasic(aDesc, aDeallocator, aFlags);
       }
 
 #ifdef MOZ_X11
--- a/gfx/layers/ipc/LayersSurfaces.ipdlh
+++ b/gfx/layers/ipc/LayersSurfaces.ipdlh
@@ -85,17 +85,17 @@ struct EGLImageDescriptor {
 struct SurfaceDescriptorSharedGLTexture {
   uint32_t texture;
   uint32_t target;
   uintptr_t fence;
   IntSize size;
   bool hasAlpha;
 };
 
-struct NewSurfaceDescriptorGralloc {
+struct SurfaceDescriptorGralloc {
   MaybeMagicGrallocBufferHandle buffer;
   bool isOpaque;
 };
 
 /**
  * Used for shmem-backed YCbCr and (flavors of) RGBA textures
  */
 struct SurfaceDescriptorShmem {
@@ -118,15 +118,15 @@ union SurfaceDescriptor {
   SurfaceDescriptorDIB;
   SurfaceDescriptorD3D10;
   SurfaceDescriptorFileMapping;
   SurfaceDescriptorDXGIYCbCr;
   SurfaceDescriptorX11;
   SurfaceTextureDescriptor;
   EGLImageDescriptor;
   SurfaceDescriptorMacIOSurface;
-  NewSurfaceDescriptorGralloc;
+  SurfaceDescriptorGralloc;
   SurfaceDescriptorSharedGLTexture;
   null_t;
 };
 
 } // namespace
 } // namespace
--- a/gfx/layers/ipc/ShadowLayerUtilsGralloc.cpp
+++ b/gfx/layers/ipc/ShadowLayerUtilsGralloc.cpp
@@ -226,18 +226,18 @@ GetGraphicBufferFrom(MaybeMagicGrallocBu
   }
   return nullptr;
 }
 
 android::sp<android::GraphicBuffer>
 GetGraphicBufferFromDesc(SurfaceDescriptor aDesc)
 {
   MaybeMagicGrallocBufferHandle handle;
-  if (aDesc.type() == SurfaceDescriptor::TNewSurfaceDescriptorGralloc) {
-    handle = aDesc.get_NewSurfaceDescriptorGralloc().buffer();
+  if (aDesc.type() == SurfaceDescriptor::TSurfaceDescriptorGralloc) {
+    handle = aDesc.get_SurfaceDescriptorGralloc().buffer();
   }
   return GetGraphicBufferFrom(handle);
 }
 
 /*static*/ void
 ShadowLayerForwarder::PlatformSyncBeforeUpdate()
 {
   // Nothing to be done for gralloc.
--- a/gfx/layers/ipc/SharedBufferManagerParent.cpp
+++ b/gfx/layers/ipc/SharedBufferManagerParent.cpp
@@ -274,17 +274,17 @@ bool SharedBufferManagerParent::RecvDrop
 void SharedBufferManagerParent::DropGrallocBufferSync(SharedBufferManagerParent* mgr, mozilla::layers::SurfaceDescriptor aDesc)
 {
   mgr->DropGrallocBufferImpl(aDesc);
 }
 
 /*static*/
 void SharedBufferManagerParent::DropGrallocBuffer(ProcessId id, mozilla::layers::SurfaceDescriptor aDesc)
 {
-  if (aDesc.type() != SurfaceDescriptor::TNewSurfaceDescriptorGralloc) {
+  if (aDesc.type() != SurfaceDescriptor::TSurfaceDescriptorGralloc) {
     return;
   }
 
   MonitorAutoLock lock(*sManagerMonitor.get());
   SharedBufferManagerParent* mgr = SharedBufferManagerParent::GetInstance(id);
   if (!mgr) {
     return;
   }
@@ -307,18 +307,18 @@ void SharedBufferManagerParent::DropGral
 {
   MutexAutoLock lock(mLock);
   if (mDestroyed) {
     return;
   }
 #ifdef MOZ_HAVE_SURFACEDESCRIPTORGRALLOC
   int64_t key = -1;
   MaybeMagicGrallocBufferHandle handle;
-  if (aDesc.type() == SurfaceDescriptor::TNewSurfaceDescriptorGralloc) {
-    handle = aDesc.get_NewSurfaceDescriptorGralloc().buffer();
+  if (aDesc.type() == SurfaceDescriptor::TSurfaceDescriptorGralloc) {
+    handle = aDesc.get_SurfaceDescriptorGralloc().buffer();
   } else {
     return;
   }
 
   if (handle.type() == MaybeMagicGrallocBufferHandle::TGrallocBufferRef) {
     key = handle.get_GrallocBufferRef().mKey;
   } else if (handle.type() == MaybeMagicGrallocBufferHandle::TMagicGrallocBufferHandle) {
     key = handle.get_MagicGrallocBufferHandle().mRef.mKey;
--- a/gfx/layers/opengl/GrallocTextureClient.cpp
+++ b/gfx/layers/opengl/GrallocTextureClient.cpp
@@ -129,17 +129,17 @@ GrallocTextureData::Forget(ISurfaceAlloc
 
   mGrallocHandle = null_t();
   mGraphicBuffer = nullptr;
 }
 
 bool
 GrallocTextureData::Serialize(SurfaceDescriptor& aOutDescriptor)
 {
-  aOutDescriptor = NewSurfaceDescriptorGralloc(mGrallocHandle, gfx::IsOpaque(mFormat));
+  aOutDescriptor = SurfaceDescriptorGralloc(mGrallocHandle, gfx::IsOpaque(mFormat));
   return true;
 }
 
 void
 GrallocTextureData::WaitForFence(FenceHandle* aFence)
 {
 #if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION < 21 && ANDROID_VERSION >= 17
    if (aFence && aFence->IsValid()) {
--- a/gfx/layers/opengl/GrallocTextureHost.cpp
+++ b/gfx/layers/opengl/GrallocTextureHost.cpp
@@ -94,17 +94,17 @@ TextureTargetForAndroidPixelFormat(andro
       // like undesirable behaviour. We'd rather have a subtle artifact.
       MOZ_ASSERT(false, "Unknown Android pixel format.");
       return LOCAL_GL_TEXTURE_EXTERNAL;
     }
   }
 }
 
 GrallocTextureHostOGL::GrallocTextureHostOGL(TextureFlags aFlags,
-                                             const NewSurfaceDescriptorGralloc& aDescriptor)
+                                             const SurfaceDescriptorGralloc& aDescriptor)
   : TextureHost(aFlags)
   , mGrallocHandle(aDescriptor)
   , mSize(0, 0)
   , mCropSize(0, 0)
   , mFormat(gfx::SurfaceFormat::UNKNOWN)
   , mEGLImage(EGL_NO_IMAGE)
   , mIsOpaque(aDescriptor.isOpaque())
 {
--- a/gfx/layers/opengl/GrallocTextureHost.h
+++ b/gfx/layers/opengl/GrallocTextureHost.h
@@ -15,17 +15,17 @@
 namespace mozilla {
 namespace layers {
 
 class GrallocTextureHostOGL : public TextureHost
 {
   friend class GrallocBufferActor;
 public:
   GrallocTextureHostOGL(TextureFlags aFlags,
-                        const NewSurfaceDescriptorGralloc& aDescriptor);
+                        const SurfaceDescriptorGralloc& aDescriptor);
 
   virtual ~GrallocTextureHostOGL();
 
   virtual bool Lock() override;
 
   virtual void Unlock() override;
 
   virtual void SetCompositor(Compositor* aCompositor) override;
@@ -58,17 +58,17 @@ public:
 
   virtual const char* Name() override { return "GrallocTextureHostOGL"; }
 
   gl::GLContext* GetGLContext() const { return mCompositor ? mCompositor->gl() : nullptr; }
 
 private:
   void DestroyEGLImage();
 
-  NewSurfaceDescriptorGralloc mGrallocHandle;
+  SurfaceDescriptorGralloc mGrallocHandle;
   RefPtr<GLTextureSource> mGLTextureSource;
   RefPtr<CompositorOGL> mCompositor;
   // Size reported by the GraphicBuffer
   gfx::IntSize mSize;
   // Size reported by TextureClient, can be different in some cases (video?),
   // used by LayerRenderState.
   gfx::IntSize mCropSize;
   gfx::SurfaceFormat mFormat;
--- a/gfx/layers/opengl/TextureHostOGL.cpp
+++ b/gfx/layers/opengl/TextureHostOGL.cpp
@@ -84,19 +84,19 @@ CreateTextureHostOGL(const SurfaceDescri
       const SurfaceDescriptorMacIOSurface& desc =
         aDesc.get_SurfaceDescriptorMacIOSurface();
       result = new MacIOSurfaceTextureHostOGL(aFlags, desc);
       break;
     }
 #endif
 
 #ifdef MOZ_WIDGET_GONK
-    case SurfaceDescriptor::TNewSurfaceDescriptorGralloc: {
-      const NewSurfaceDescriptorGralloc& desc =
-        aDesc.get_NewSurfaceDescriptorGralloc();
+    case SurfaceDescriptor::TSurfaceDescriptorGralloc: {
+      const SurfaceDescriptorGralloc& desc =
+        aDesc.get_SurfaceDescriptorGralloc();
       result = new GrallocTextureHostOGL(aFlags, desc);
       break;
     }
 #endif
 
 #ifdef GL_PROVIDER_GLX
     case SurfaceDescriptor::TSurfaceDescriptorX11: {
       const auto& desc = aDesc.get_SurfaceDescriptorX11();