CCTextureUpdater.h [plain text]
#ifndef CCTextureUpdater_h
#define CCTextureUpdater_h
#include "IntRect.h"
#include "LayerTextureUpdater.h"
#include <wtf/Vector.h>
namespace WebCore {
class GraphicsContext3D;
class TextureAllocator;
class TextureCopier;
class TextureUploader;
class CCTextureUpdater {
public:
CCTextureUpdater();
~CCTextureUpdater();
void appendUpdate(LayerTextureUpdater::Texture*, const IntRect& sourceRect, const IntRect& destRect);
void appendPartialUpdate(LayerTextureUpdater::Texture*, const IntRect& sourceRect, const IntRect& destRect);
void appendCopy(unsigned sourceTexture, unsigned destTexture, const IntSize&);
void appendManagedCopy(unsigned sourceTexture, ManagedTexture* destTexture, const IntSize&);
bool hasMoreUpdates() const;
bool update(GraphicsContext3D*, TextureAllocator*, TextureCopier*, TextureUploader*, size_t count);
void clear();
private:
struct UpdateEntry {
LayerTextureUpdater::Texture* texture;
IntRect sourceRect;
IntRect destRect;
};
struct CopyEntry {
IntSize size;
unsigned sourceTexture;
unsigned destTexture;
};
struct ManagedCopyEntry {
IntSize size;
unsigned sourceTexture;
ManagedTexture* destTexture;
};
static void appendUpdate(LayerTextureUpdater::Texture*, const IntRect& sourceRect, const IntRect& destRect, Vector<UpdateEntry>&);
size_t m_entryIndex;
Vector<UpdateEntry> m_entries;
Vector<UpdateEntry> m_partialEntries;
Vector<CopyEntry> m_copyEntries;
Vector<ManagedCopyEntry> m_managedCopyEntries;
};
}
#endif // CCTextureUpdater_h