{
m_bitmap.reset();
delete m_canvas;
+ SharedTexture* textures[3] = { &m_textureA, &m_textureB, 0 };
+ destroyTextures(textures);
}
-void BackedDoubleBufferedTexture::onDestroy(SharedTexture** textures)
+void BackedDoubleBufferedTexture::destroyTextures(SharedTexture** textures)
{
int x = 0;
while (textures[x] != 0) {
m_owner = 0;
}
+void BackedDoubleBufferedTexture::release()
+{
+ m_owner = 0;
+}
+
} // namespace WebCore
// returns false if ownership cannot be transferred because the tile is busy
bool acquire(BaseTile* owner);
void release(BaseTile* owner);
+ void release();
// private member accessor functions
BaseTile* owner() { return m_owner; } // only used by the consumer thread
// This is to be only used for debugging on the producer thread
bool busy() { return m_busy; }
-protected:
- virtual void onDestroy(SharedTexture** textures);
-
private:
+ void destroyTextures(SharedTexture** textures);
+
SkBitmap m_bitmap;
SkCanvas* m_canvas;
int m_usedLevel;
DoubleBufferedTexture::~DoubleBufferedTexture()
{
- SharedTexture* textures[3] = { &m_textureA, &m_textureB, 0 };
- onDestroy(textures);
#ifdef DEBUG_COUNT
gDoubleBufferedTextureCount--;
#endif
void consumerRelease();
protected:
- // enables sub-classes to signal the provider thread that the consumer is
- // being deleted and therefore should clean up any producer specific
- // textures or EGLImages
- virtual void onDestroy(SharedTexture** textures) { };
+ SharedTexture m_textureA;
+ SharedTexture m_textureB;
private:
SharedTexture* getReadableTexture();
SharedTexture* getWriteableTexture();
- SharedTexture m_textureA;
- SharedTexture m_textureB;
SharedTexture* m_writeableTexture;
SharedTexture* m_lockedConsumerTexture; // only used by the consumer