Exemplo n.º 1
0
void TilesManager::setMaxLayerTextureCount(int max)
{
    XLOG("setMaxLayerTextureCount: %d (current: %d, total:%d)",
         max, m_maxLayerTextureCount, MAX_TEXTURE_ALLOCATION);
    if (!max && m_hasLayerTextures) {
        double secondsSinceLayersUsed = WTF::currentTime() - m_lastTimeLayersUsed;
        if (secondsSinceLayersUsed > LAYER_TEXTURES_DESTROY_TIMEOUT) {
            unsigned long long sparedDrawCount = ~0; // by default, spare no textures
            deallocateTexturesVector(sparedDrawCount, m_tilesTextures);
            m_hasLayerTextures = false;
        }
        return;
    }
    m_lastTimeLayersUsed = WTF::currentTime();
    if (m_maxLayerTextureCount == MAX_TEXTURE_ALLOCATION ||
         max <= m_maxLayerTextureCount)
        return;

    android::Mutex::Autolock lock(m_texturesLock);

    if (max < MAX_TEXTURE_ALLOCATION)
        m_maxLayerTextureCount = max;
    else
        m_maxLayerTextureCount = MAX_TEXTURE_ALLOCATION;

    allocateTiles();
    m_hasLayerTextures = true;
}
Exemplo n.º 2
0
void TileView::setNumTiles( const unsigned int numX, const unsigned int numY )
{
  pNumX = numX;
  pNumY = numY;
  allocateTiles();
  checkAlign();
}
Exemplo n.º 3
0
void TilesManager::setMaxTextureCount(int max)
{
    XLOG("setMaxTextureCount: %d (current: %d, total:%d)",
         max, m_maxTextureCount, MAX_TEXTURE_ALLOCATION);
    if (m_maxTextureCount == MAX_TEXTURE_ALLOCATION ||
         max <= m_maxTextureCount)
        return;

    android::Mutex::Autolock lock(m_texturesLock);

    if (max < MAX_TEXTURE_ALLOCATION)
        m_maxTextureCount = max;
    else
        m_maxTextureCount = MAX_TEXTURE_ALLOCATION;

    allocateTiles();
}