Add a way to extract TextureSources from a BigImageIterator. (bug 1365879 part 9, r=mattwoodrow)

This commit is contained in:
David Anderson
2017-06-20 01:17:18 -07:00
parent fe0a9c8eca
commit 7bb49bf46e
3 changed files with 16 additions and 0 deletions

View File

@@ -172,6 +172,13 @@ public:
MOZ_ASSERT(mCompositableCount >= 0); MOZ_ASSERT(mCompositableCount >= 0);
} }
// When iterating as a BigImage, this creates temporary TextureSources wrapping
// individual tiles.
virtual RefPtr<TextureSource> ExtractCurrentTile() {
NS_WARNING("Implementation does not expose tile sources");
return nullptr;
}
int NumCompositableRefs() const { return mCompositableCount; } int NumCompositableRefs() const { return mCompositableCount; }
protected: protected:

View File

@@ -1215,6 +1215,13 @@ DataTextureSourceD3D11::GetD3D11Texture() const
: mTexture; : mTexture;
} }
RefPtr<TextureSource>
DataTextureSourceD3D11::ExtractCurrentTile()
{
MOZ_ASSERT(mIterating);
return new DataTextureSourceD3D11(mDevice, mFormat, mTileTextures[mCurrentTile]);
}
ID3D11ShaderResourceView* ID3D11ShaderResourceView*
DataTextureSourceD3D11::GetShaderResourceView() DataTextureSourceD3D11::GetShaderResourceView()
{ {

View File

@@ -264,6 +264,8 @@ public:
mCurrentTile = 0; mCurrentTile = 0;
} }
RefPtr<TextureSource> ExtractCurrentTile() override;
void Reset(); void Reset();
protected: protected:
gfx::IntRect GetTileRect(uint32_t aIndex) const; gfx::IntRect GetTileRect(uint32_t aIndex) const;