Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1155495 - Part 2: Remove unnecessary class inheritance and castin…
Browse files Browse the repository at this point in the history
…g. r=nical, r=sotaro
  • Loading branch information
chenpighead committed May 20, 2015
1 parent 01af773 commit 06bc493
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 27 deletions.
5 changes: 0 additions & 5 deletions gfx/layers/composite/TextureHost.h
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,6 @@ class TextureHost
*/
virtual bool HasInternalBuffer() const { return false; }

/**
* Cast to a TextureHost for each backend.
*/
virtual TextureHostOGL* AsHostOGL() { return nullptr; }

void AddCompositableRef() { ++mCompositableCount; }

void ReleaseCompositableRef()
Expand Down
5 changes: 1 addition & 4 deletions gfx/layers/ipc/CompositableTransactionParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,7 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation
if (maybeFence.type() == MaybeFence::TFenceHandle) {
FenceHandle fence = maybeFence.get_FenceHandle();
if (fence.IsValid() && tex) {
TextureHostOGL* hostOGL = tex->AsHostOGL();
if (hostOGL) {
hostOGL->SetAcquireFence(fence);
}
tex->SetAcquireFenceHandle(fence);
}
}

Expand Down
8 changes: 0 additions & 8 deletions gfx/layers/opengl/GrallocTextureHost.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ namespace mozilla {
namespace layers {

class GrallocTextureHostOGL : public TextureHost
, public TextureHostOGL
{
friend class GrallocBufferActor;
public:
Expand Down Expand Up @@ -51,13 +50,6 @@ class GrallocTextureHostOGL : public TextureHost

virtual void UnbindTextureSource() override;

#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
virtual TextureHostOGL* AsHostOGL() override
{
return this;
}
#endif

virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() override;

virtual void WaitAcquireFenceHandleSyncComplete() override;
Expand Down
12 changes: 2 additions & 10 deletions widget/gonk/HwcComposer2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -858,11 +858,7 @@ HwcComposer2D::Commit()
if (!state.mTexture) {
continue;
}
TextureHostOGL* texture = state.mTexture->AsHostOGL();
if (!texture) {
continue;
}
FenceHandle fence = texture->GetAndResetAcquireFence();
FenceHandle fence = state.mTexture->GetAndResetAcquireFenceHandle();
if (fence.IsValid()) {
nsRefPtr<FenceHandle::FdObj> fdObj = fence.GetAndResetFdObj();
mList->hwLayers[j].acquireFenceFd = fdObj->GetAndResetFd();
Expand All @@ -884,11 +880,7 @@ HwcComposer2D::Commit()
if (!state.mTexture) {
continue;
}
TextureHostOGL* texture = state.mTexture->AsHostOGL();
if (!texture) {
continue;
}
texture->SetReleaseFence(fence);
state.mTexture->SetReleaseFenceHandle(fence);
}
}

Expand Down

0 comments on commit 06bc493

Please sign in to comment.