Bug 1544478 - Stub out SharedPlanarYCbCrImage::AdoptData because it can't be called without crashing, which means it's unused. r=mattwoodrow a=pascalc
authorMarkus Stange <mstange@themasta.com>
Tue, 16 Apr 2019 17:03:23 +0000
changeset 526249 fe4d81fb62b8947997174ba4cf32a269eeecb33d
parent 526248 9b2635dc41a478fa26dd8cf2bd428e1974e4d880
child 526250 86f6ec90b34b8df2d33d9a9380a2500fd8dfbef9
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, pascalc
bugs1544478
milestone67.0
Bug 1544478 - Stub out SharedPlanarYCbCrImage::AdoptData because it can't be called without crashing, which means it's unused. r=mattwoodrow a=pascalc GetBuffer() would always return null here. Differential Revision: https://phabricator.services.mozilla.com/D27603
gfx/layers/ipc/SharedPlanarYCbCrImage.cpp
--- a/gfx/layers/ipc/SharedPlanarYCbCrImage.cpp
+++ b/gfx/layers/ipc/SharedPlanarYCbCrImage.cpp
@@ -85,48 +85,18 @@ bool SharedPlanarYCbCrImage::CopyData(co
     MOZ_ASSERT(false, "Failed to copy YCbCr data into the TextureClient");
     return false;
   }
   mTextureClient->MarkImmutable();
   return true;
 }
 
 bool SharedPlanarYCbCrImage::AdoptData(const Data& aData) {
-  MOZ_ASSERT(mTextureClient, "This Image should have already allocated data");
-  if (!mTextureClient) {
-    return false;
-  }
-  mData = aData;
-  mSize = aData.mPicSize;
-  mOrigin = gfx::IntPoint(aData.mPicX, aData.mPicY);
-
-  uint8_t* base = GetBuffer();
-  uint32_t yOffset = aData.mYChannel - base;
-  uint32_t cbOffset = aData.mCbChannel - base;
-  uint32_t crOffset = aData.mCrChannel - base;
-
-  auto fwd = mCompositable->GetForwarder();
-  bool supportsTextureDirectMapping =
-      fwd->SupportsTextureDirectMapping() &&
-      std::max(
-          aData.mYSize.width,
-          std::max(aData.mYSize.height,
-                   std::max(aData.mCbCrSize.width, aData.mCbCrSize.height))) <=
-          fwd->GetMaxTextureSize();
-  bool hasIntermediateBuffer = ComputeHasIntermediateBuffer(
-      gfx::SurfaceFormat::YUV, fwd->GetCompositorBackendType(),
-      supportsTextureDirectMapping);
-
-  static_cast<BufferTextureData*>(mTextureClient->GetInternalData())
-      ->SetDescriptor(YCbCrDescriptor(
-          aData.mYSize, aData.mYStride, aData.mCbCrSize, aData.mCbCrStride,
-          yOffset, cbOffset, crOffset, aData.mStereoMode, aData.mColorDepth,
-          aData.mYUVColorSpace, hasIntermediateBuffer));
-
-  return true;
+  MOZ_ASSERT(false, "This shouldn't be used.");
+  return false;
 }
 
 bool SharedPlanarYCbCrImage::IsValid() const {
   return mTextureClient && mTextureClient->IsValid();
 }
 
 bool SharedPlanarYCbCrImage::Allocate(PlanarYCbCrData& aData) {
   MOZ_ASSERT(!mTextureClient, "This image already has allocated data");