BitmapCanvasLayerTextureUpdater.h [plain text]
#ifndef BitmapCanvasLayerTextureUpdater_h
#define BitmapCanvasLayerTextureUpdater_h
#if USE(ACCELERATED_COMPOSITING)
#include "CanvasLayerTextureUpdater.h"
#include "LayerTextureSubImage.h"
#include "PlatformCanvas.h"
namespace WebCore {
class LayerPainterChromium;
class BitmapCanvasLayerTextureUpdater : public CanvasLayerTextureUpdater {
public:
class Texture : public LayerTextureUpdater::Texture {
public:
Texture(BitmapCanvasLayerTextureUpdater*, PassOwnPtr<ManagedTexture>);
virtual ~Texture();
virtual void updateRect(GraphicsContext3D*, TextureAllocator*, const IntRect& sourceRect, const IntRect& destRect);
private:
BitmapCanvasLayerTextureUpdater* textureUpdater() { return m_textureUpdater; }
BitmapCanvasLayerTextureUpdater* m_textureUpdater;
};
static PassRefPtr<BitmapCanvasLayerTextureUpdater> create(PassOwnPtr<LayerPainterChromium>, bool useMapTexSubImage);
virtual ~BitmapCanvasLayerTextureUpdater();
virtual PassOwnPtr<LayerTextureUpdater::Texture> createTexture(TextureManager*);
virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat);
virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, int borderTexels, float contentsScale, IntRect& resultingOpaqueRect);
void updateTextureRect(GraphicsContext3D*, TextureAllocator*, ManagedTexture*, const IntRect& sourceRect, const IntRect& destRect);
virtual void setOpaque(bool);
private:
BitmapCanvasLayerTextureUpdater(PassOwnPtr<LayerPainterChromium>, bool useMapTexSubImage);
PlatformCanvas m_canvas;
LayerTextureSubImage m_texSubImage;
};
} #endif // USE(ACCELERATED_COMPOSITING)
#endif // BitmapCanvasLayerTextureUpdater_h