1/*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "GrTextBlobCache.h"
9
10GrTextBlobCache::~GrTextBlobCache() {
11    this->freeAll();
12}
13
14void GrTextBlobCache::freeAll() {
15    SkTDynamicHash<GrAtlasTextBlob, GrAtlasTextBlob::Key>::Iter iter(&fCache);
16    while (!iter.done()) {
17        GrAtlasTextBlob* blob = &(*iter);
18        fBlobList.remove(blob);
19        blob->unref();
20        ++iter;
21    }
22    fCache.rewind();
23
24    // There should be no allocations in the memory pool at this point
25    SkASSERT(fPool.isEmpty());
26}
27