TAG_UPDATE_TEXTURE,
};
+SkBitmap* RasterRenderer::g_bitmap = 0;
+
RasterRenderer::RasterRenderer() : BaseRenderer(BaseRenderer::Raster)
{
#ifdef DEBUG_COUNT
ClassTracker::instance()->increment("RasterRenderer");
#endif
- m_bitmap.setConfig(SkBitmap::kARGB_8888_Config,
- TilesManager::instance()->tileWidth(),
- TilesManager::instance()->tileHeight());
- m_bitmap.allocPixels();
+ if (!g_bitmap) {
+ g_bitmap = new SkBitmap();
+ g_bitmap->setConfig(SkBitmap::kARGB_8888_Config,
+ TilesManager::instance()->tileWidth(),
+ TilesManager::instance()->tileHeight());
+ g_bitmap->allocPixels();
+ }
}
RasterRenderer::~RasterRenderer()
m_perfMon.start(TAG_CREATE_BITMAP);
if (renderInfo.baseTile->isLayerTile()) {
- m_bitmap.setIsOpaque(false);
- m_bitmap.eraseARGB(0, 0, 0, 0);
+ g_bitmap->setIsOpaque(false);
+ g_bitmap->eraseARGB(0, 0, 0, 0);
} else {
- m_bitmap.setIsOpaque(true);
- m_bitmap.eraseARGB(255, 255, 255, 255);
+ g_bitmap->setIsOpaque(true);
+ g_bitmap->eraseARGB(255, 255, 255, 255);
}
- SkDevice* device = new SkDevice(NULL, m_bitmap, false);
+ SkDevice* device = new SkDevice(NULL, *g_bitmap, false);
if (renderInfo.measurePerf) {
m_perfMon.stop(TAG_CREATE_BITMAP);