Bug 1544478 - Stub out SharedPlanarYCbCrImage::AdoptData because it can't be called without crashing, which means it's unused. r=mattwoodrow
authorMarkus Stange <mstange@themasta.com>
Tue, 16 Apr 2019 17:03:23 +0000
changeset 469715 4ab1a110e5d50f11983bbe9b4500c44383767328
parent 469714 d5ac9681d3ce59c427804b4f5add2daa1fcc06d0
child 469716 185e608c385272703bd89da77aa0d9a4d2c7a024
push id35879
push usernerli@mozilla.com
push dateTue, 16 Apr 2019 22:01:48 +0000
treeherdermozilla-central@12a60898fdc1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1544478
milestone68.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 1544478 - Stub out SharedPlanarYCbCrImage::AdoptData because it can't be called without crashing, which means it's unused. r=mattwoodrow 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");