summaryrefslogtreecommitdiffstats
path: root/gfx/gl/GLScreenBuffer.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--gfx/gl/GLScreenBuffer.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gfx/gl/GLScreenBuffer.h b/gfx/gl/GLScreenBuffer.h
index d281249771..ace3145f7a 100644
--- a/gfx/gl/GLScreenBuffer.h
+++ b/gfx/gl/GLScreenBuffer.h
@@ -55,6 +55,7 @@ class SwapChain final {
UniquePtr<SurfaceFactory> mFactory;
private:
+ size_t mPoolLimit;
std::queue<std::shared_ptr<SharedSurface>> mPool;
std::shared_ptr<SharedSurface> mFrontBuffer;
std::function<void()> mDestroyedCallback;
@@ -69,6 +70,14 @@ class SwapChain final {
SwapChain();
virtual ~SwapChain();
+ void DisablePool() {
+ if (mPoolLimit) {
+ MOZ_ASSERT(mPool.empty());
+ mPool = {};
+ mPoolLimit = 0;
+ }
+ }
+
void ClearPool();
bool StoreRecycledSurface(const std::shared_ptr<SharedSurface>& surf);
const auto& FrontBuffer() const { return mFrontBuffer; }