Add an RAII helper for read-unlocking textures. (bug 1365879 part 15, r=mattwoodrow)

This commit is contained in:
David Anderson 2017-06-20 01:17:21 -07:00
Родитель 9467c3d33c
Коммит 5c3229c7cc
1 изменённых файлов: 15 добавлений и 1 удалений

Просмотреть файл

@ -102,11 +102,25 @@ public:
// used to composite).
virtual bool IsValid() const = 0;
public:
class MOZ_STACK_CLASS AutoReadUnlockTextures
{
public:
explicit AutoReadUnlockTextures(TextureSourceProvider* aProvider)
: mProvider(aProvider)
{}
~AutoReadUnlockTextures() {
mProvider->ReadUnlockTextures();
}
private:
RefPtr<TextureSourceProvider> mProvider;
};
protected:
// Should be called at the end of each composition.
void ReadUnlockTextures();
protected:
virtual ~TextureSourceProvider();
private: