コード例 #1
0
ファイル: GrLayerHoister.cpp プロジェクト: tachen/skia
void GrLayerHoister::UnlockLayers(GrContext* context,
                                  const SkTDArray<GrHoistedLayer>& atlased,
                                  const SkTDArray<GrHoistedLayer>& nonAtlased,
                                  const SkTDArray<GrHoistedLayer>& recycled) {
    GrLayerCache* layerCache = context->getLayerCache();

    for (int i = 0; i < atlased.count(); ++i) {
        layerCache->removeUse(atlased[i].fLayer);
    }

    for (int i = 0; i < nonAtlased.count(); ++i) {
        layerCache->removeUse(nonAtlased[i].fLayer);
    }

    for (int i = 0; i < recycled.count(); ++i) {
        layerCache->removeUse(recycled[i].fLayer);
    }

#if DISABLE_CACHING
    // This code completely clears out the atlas. It is required when
    // caching is disabled so the atlas doesn't fill up and force more
    // free floating layers
    layerCache->purgeAll();
#endif

    SkDEBUGCODE(layerCache->validate();)
}