Commit 8db3e693 authored by sotaro's avatar sotaro
Browse files

Bug 1835980 - Remove TextureHost::IsWrappingBufferTextureHost() r=gfx-reviewers,lsalzman

TextureHost::AsBufferTextureHost() already exists. The IsWrappingBufferTextureHost() is redundant.

It is preparation for Bug 1834039.

Differential Revision: https://phabricator.services.mozilla.com/D179519
parent 11103795
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -199,11 +199,11 @@ void GPUVideoTextureHost::NotifyNotUsed() {
  TextureHost::NotifyNotUsed();
}

bool GPUVideoTextureHost::IsWrappingBufferTextureHost() {
BufferTextureHost* GPUVideoTextureHost::AsBufferTextureHost() {
  if (EnsureWrappedTextureHost()) {
    return EnsureWrappedTextureHost()->IsWrappingBufferTextureHost();
    return EnsureWrappedTextureHost()->AsBufferTextureHost();
  }
  return false;
  return nullptr;
}

bool GPUVideoTextureHost::IsWrappingSurfaceTextureHost() {
+2 −1
Original line number Diff line number Diff line
@@ -63,7 +63,8 @@ class GPUVideoTextureHost : public TextureHost {

  void NotifyNotUsed() override;

  bool IsWrappingBufferTextureHost() override;
  BufferTextureHost* AsBufferTextureHost() override;

  bool IsWrappingSurfaceTextureHost() override;

  TextureHostType GetTextureHostType() override;
+0 −3
Original line number Diff line number Diff line
@@ -610,7 +610,6 @@ class TextureHost : public AtomicRefCountedWithFinalize<TextureHost> {
    return nullptr;
  }

  virtual bool IsWrappingBufferTextureHost() { return false; }
  virtual bool IsWrappingSurfaceTextureHost() { return false; }

  // Create the corresponding RenderTextureHost type of this texture, and
@@ -810,8 +809,6 @@ class BufferTextureHost : public TextureHost {

  BufferTextureHost* AsBufferTextureHost() override { return this; }

  bool IsWrappingBufferTextureHost() override { return true; }

  const BufferDescriptor& GetBufferDescriptor() const { return mDescriptor; }

  void CreateRenderTexture(
+2 −6
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ wr::ExternalImageId WebRenderTextureHost::GetExternalImageKey() {
bool WebRenderTextureHost::IsValid() { return mWrappedTextureHost->IsValid(); }

void WebRenderTextureHost::UnbindTextureSource() {
  if (mWrappedTextureHost->IsWrappingBufferTextureHost()) {
  if (mWrappedTextureHost->AsBufferTextureHost()) {
    mWrappedTextureHost->UnbindTextureSource();
  }
  // Handle read unlock
@@ -125,10 +125,6 @@ void WebRenderTextureHost::MaybeNotifyForUse(wr::TransactionBuilder& aTxn) {
#endif
}

bool WebRenderTextureHost::IsWrappingBufferTextureHost() {
  return mWrappedTextureHost->IsWrappingBufferTextureHost();
}

bool WebRenderTextureHost::IsWrappingSurfaceTextureHost() {
  return mWrappedTextureHost->IsWrappingSurfaceTextureHost();
}
@@ -138,7 +134,7 @@ void WebRenderTextureHost::PrepareForUse() {
  // PrepareForUse() is handled by SurfaceTextureHost.
  if ((IsWrappingSurfaceTextureHost() &&
       !mWrappedTextureHost->AsRemoteTextureHostWrapper()) ||
      mWrappedTextureHost->IsWrappingBufferTextureHost()) {
      mWrappedTextureHost->AsBufferTextureHost()) {
    // Call PrepareForUse on render thread.
    // See RenderAndroidSurfaceTextureHostOGL::PrepareForUse.
    wr::RenderThread::Get()->PrepareForUse(GetExternalImageKey());
+4 −1
Original line number Diff line number Diff line
@@ -61,7 +61,10 @@ class WebRenderTextureHost : public TextureHost {
    return mWrappedTextureHost->AsRemoteTextureHostWrapper();
  }

  bool IsWrappingBufferTextureHost() override;
  BufferTextureHost* AsBufferTextureHost() override {
    return mWrappedTextureHost->AsBufferTextureHost();
  }

  bool IsWrappingSurfaceTextureHost() override;

  virtual void PrepareForUse() override;