AcceleratedCompositingContext.h [plain text]
#ifndef AcceleratedCompositingContext_h
#define AcceleratedCompositingContext_h
#include "GraphicsLayer.h"
#include "GraphicsLayerClient.h"
#include "IntRect.h"
#include "IntSize.h"
#include "Timer.h"
#include "webkitwebview.h"
#include <wtf/PassOwnPtr.h>
#if USE(TEXTURE_MAPPER_GL)
#include "GLContext.h"
#include "TextureMapperLayer.h"
#endif
#if USE(ACCELERATED_COMPOSITING)
namespace WebKit {
class AcceleratedCompositingContext : public WebCore::GraphicsLayerClient {
WTF_MAKE_NONCOPYABLE(AcceleratedCompositingContext);
public:
static PassOwnPtr<AcceleratedCompositingContext> create(WebKitWebView* webView)
{
return adoptPtr(new AcceleratedCompositingContext(webView));
}
virtual ~AcceleratedCompositingContext();
void attachRootGraphicsLayer(WebCore::GraphicsLayer*);
void scheduleRootLayerRepaint(const WebCore::IntRect&);
void markForSync();
void syncLayersTimeout();
void syncLayersNow();
void resizeRootLayer(const WebCore::IntSize&);
bool renderLayersToWindow(const WebCore::IntRect& clipRect);
bool enabled();
virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time);
virtual void notifySyncRequired(const WebCore::GraphicsLayer*);
virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& rectToPaint);
virtual bool showDebugBorders(const WebCore::GraphicsLayer*) const;
virtual bool showRepaintCounter(const WebCore::GraphicsLayer*) const;
private:
WebKitWebView* m_webView;
unsigned int m_syncTimerCallbackId;
#if USE(CLUTTER)
WebCore::GraphicsLayer* m_rootGraphicsLayer;
GtkWidget* m_rootLayerEmbedder;
#elif USE(TEXTURE_MAPPER_GL)
WebCore::GLContext* glContext();
WebCore::TextureMapperLayer* m_rootTextureMapperLayer;
OwnPtr<WebCore::GraphicsLayer> m_rootGraphicsLayer;
OwnPtr<WebCore::TextureMapper> m_textureMapper;
#endif
AcceleratedCompositingContext(WebKitWebView*);
};
}
#endif // USE(ACCELERATED_COMPOSITING)
#endif // AcceleratedCompositingContext_h