BitmapSkPictureCanvasLayerTextureUpdater.h [plain text]
#ifndef BitmapSkPictureCanvasLayerTextureUpdater_h
#define BitmapSkPictureCanvasLayerTextureUpdater_h
#if USE(ACCELERATED_COMPOSITING)
#include "LayerTextureSubImage.h"
#include "PlatformColor.h"
#include "SkBitmap.h"
#include "SkPictureCanvasLayerTextureUpdater.h"
namespace WebCore {
class BitmapSkPictureCanvasLayerTextureUpdater : public SkPictureCanvasLayerTextureUpdater {
public:
class Texture : public CanvasLayerTextureUpdater::Texture {
public:
Texture(BitmapSkPictureCanvasLayerTextureUpdater*, PassOwnPtr<ManagedTexture>);
virtual void prepareRect(const IntRect& sourceRect);
virtual void updateRect(GraphicsContext3D*, TextureAllocator*, const IntRect& sourceRect, const IntRect& destRect);
private:
BitmapSkPictureCanvasLayerTextureUpdater* textureUpdater() { return m_textureUpdater; }
SkBitmap m_bitmap;
BitmapSkPictureCanvasLayerTextureUpdater* m_textureUpdater;
};
static PassRefPtr<BitmapSkPictureCanvasLayerTextureUpdater> create(PassOwnPtr<LayerPainterChromium>, bool useMapTexSubImage);
virtual ~BitmapSkPictureCanvasLayerTextureUpdater();
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 paintContentsRect(SkCanvas*, const IntRect& sourceRect);
void updateTextureRect(GraphicsContext3D*, GC3Denum format, const IntRect& destRect, const uint8_t* pixels);
private:
BitmapSkPictureCanvasLayerTextureUpdater(PassOwnPtr<LayerPainterChromium>, bool useMapTexSubImage);
LayerTextureSubImage m_texSubImage;
};
} #endif // USE(ACCELERATED_COMPOSITING)
#endif // BitmapSkPictureCanvasLayerTextureUpdater_h