Bug 1777264 Part 3: Make MacIOSurfaceImage report color depth accurately. r=media-playback-reviewers,alwu

Differential Revision: https://phabricator.services.mozilla.com/D153283
This commit is contained in:
Brad Werth 2022-08-17 06:50:51 +00:00
parent 8d95a0c511
commit ed3a0d7167
2 changed files with 9 additions and 0 deletions

View File

@ -30,6 +30,13 @@ TextureClient* MacIOSurfaceImage::GetTextureClient(
return mTextureClient;
}
ColorDepth MacIOSurfaceImage::GetColorDepth() const {
if (!mSurface) {
return gfx::ColorDepth::COLOR_8;
}
return mSurface->GetColorDepth();
}
already_AddRefed<SourceSurface> MacIOSurfaceImage::GetAsSourceSurface() {
return CreateSourceSurfaceFromMacIOSurface(mSurface);
}

View File

@ -44,6 +44,8 @@ class MacIOSurfaceImage : public Image {
gfx::IntRect GetPictureRect() const override { return mPictureRect; }
gfx::ColorDepth GetColorDepth() const override;
private:
RefPtr<MacIOSurface> mSurface;
RefPtr<TextureClient> mTextureClient;