tahoma2d/toonz/sources/include/tpredictivecachemanager.h

62 lines
1.4 KiB
C
Raw Normal View History

2016-05-17 03:04:11 +12:00
#pragma once
2016-03-19 06:57:51 +13:00
#ifndef TPREDICTIVECACHEMANAGER_H
#define TPREDICTIVECACHEMANAGER_H
2016-04-14 22:15:09 +12:00
#include <memory>
2016-03-19 06:57:51 +13:00
#include "tfxcachemanager.h"
#include "tgeometry.h"
#include "tfx.h"
#undef DVAPI
#undef DVVAR
#ifdef TFX_EXPORTS
#define DVAPI DV_EXPORT_API
#define DVVAR DV_EXPORT_VAR
#else
#define DVAPI DV_IMPORT_API
#define DVVAR DV_IMPORT_VAR
#endif
//=========================================================================
//======================================
// TPredictiveCacheManager class
//--------------------------------------
/*!
2016-06-15 18:43:10 +12:00
The TPredictiveCacheManager is the TFxCacheManagerDelegate used to cache
intermediate
2016-03-19 06:57:51 +13:00
render results due to predictive analysis of the scene schematic.
*/
class DVAPI TPredictiveCacheManager final : public TFxCacheManagerDelegate {
2016-06-15 18:43:10 +12:00
T_RENDER_RESOURCE_MANAGER
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
class Imp;
std::unique_ptr<Imp> m_imp;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
TPredictiveCacheManager();
~TPredictiveCacheManager();
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
static TPredictiveCacheManager *instance();
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
int getMaxTileSize() const;
int getBPP() const;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void setMaxTileSize(int maxTileSize);
void setBPP(int bpp);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void getResource(TCacheResourceP &resource, const std::string &alias,
const TFxP &fx, double frame, const TRenderSettings &rs,
2016-06-19 20:06:29 +12:00
ResourceDeclaration *resData) override;
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
void onRenderStatusStart(int renderStatus) override;
void onRenderStatusEnd(int renderStatus) override;
2016-03-19 06:57:51 +13:00
};
2016-06-15 18:43:10 +12:00
#endif // TPREDICTIVECACHEMANAGER_H