BackingStoreCompositingSurface.h [plain text]
#ifndef BackingStoreCompositingSurface_h
#define BackingStoreCompositingSurface_h
#if USE(ACCELERATED_COMPOSITING)
#include <BlackBerryPlatformIntRectRegion.h>
#include <wtf/RefPtr.h>
#include <wtf/ThreadSafeRefCounted.h>
namespace BlackBerry {
namespace Platform {
namespace Graphics {
struct Buffer;
}
}
namespace WebKit {
class CompositingSurfaceBuffer {
public:
CompositingSurfaceBuffer(const Platform::IntSize&);
~CompositingSurfaceBuffer();
Platform::IntSize surfaceSize() const;
Platform::Graphics::Buffer* nativeBuffer() const;
private:
Platform::IntSize m_size;
mutable Platform::Graphics::Buffer* m_buffer;
};
class BackingStoreCompositingSurface : public ThreadSafeRefCounted<BackingStoreCompositingSurface> {
public:
static PassRefPtr<BackingStoreCompositingSurface> create(const Platform::IntSize& size, bool doubleBuffered)
{
return adoptRef(new BackingStoreCompositingSurface(size, doubleBuffered));
}
~BackingStoreCompositingSurface();
CompositingSurfaceBuffer* frontBuffer() const;
CompositingSurfaceBuffer* backBuffer() const;
bool isDoubleBuffered() const { return m_isDoubleBuffered; }
void swapBuffers();
bool needsSync() const { return m_needsSync; }
void setNeedsSync(bool needsSync) { m_needsSync = needsSync; }
private:
BackingStoreCompositingSurface(const Platform::IntSize&, bool doubleBuffered);
mutable CompositingSurfaceBuffer* m_frontBuffer;
mutable CompositingSurfaceBuffer* m_backBuffer;
bool m_isDoubleBuffered;
bool m_needsSync;
};
} }
#endif // USE(ACCELERATED_COMPOSITING)
#endif // BackingStoreCompositingSurface_h