mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Add an RAII helper for read-unlocking textures. (bug 1365879 part 15, r=mattwoodrow)
This commit is contained in:
parent
9467c3d33c
commit
5c3229c7cc
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user