| OLD | NEW | 
|   1 /* |   1 /* | 
|   2  * Copyright 2014 Google Inc. |   2  * Copyright 2014 Google Inc. | 
|   3  * |   3  * | 
|   4  * Use of this source code is governed by a BSD-style license that can be |   4  * Use of this source code is governed by a BSD-style license that can be | 
|   5  * found in the LICENSE file. |   5  * found in the LICENSE file. | 
|   6  */ |   6  */ | 
|   7  |   7  | 
|   8 #include "GrAtlas.h" |   8 #include "GrAtlas.h" | 
|   9 #include "GrGpu.h" |   9 #include "GrGpu.h" | 
|  10 #include "GrLayerCache.h" |  10 #include "GrLayerCache.h" | 
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  62 } |  62 } | 
|  63  |  63  | 
|  64 void GrLayerCache::freeAll() { |  64 void GrLayerCache::freeAll() { | 
|  65     fLayerHash.deleteAll(); |  65     fLayerHash.deleteAll(); | 
|  66     fAtlasMgr.free(); |  66     fAtlasMgr.free(); | 
|  67 } |  67 } | 
|  68  |  68  | 
|  69 GrAtlasedLayer* GrLayerCache::createLayer(SkPicture* picture, int layerID) { |  69 GrAtlasedLayer* GrLayerCache::createLayer(SkPicture* picture, int layerID) { | 
|  70     GrAtlasedLayer* layer = fLayerPool.alloc(); |  70     GrAtlasedLayer* layer = fLayerPool.alloc(); | 
|  71  |  71  | 
|  72     SkASSERT(picture->getGenerationID() != SkPicture::kInvalidGenID); |  72     SkASSERT(picture->uniqueID() != SK_InvalidGenID); | 
|  73     layer->init(picture->getGenerationID(), layerID); |  73     layer->init(picture->uniqueID(), layerID); | 
|  74     fLayerHash.insert(PictureLayerKey(picture->getGenerationID(), layerID), laye
    r); |  74     fLayerHash.insert(PictureLayerKey(picture->uniqueID(), layerID), layer); | 
|  75     return layer; |  75     return layer; | 
|  76 } |  76 } | 
|  77  |  77  | 
|  78  |  78  | 
|  79 const GrAtlasedLayer* GrLayerCache::findLayerOrCreate(SkPicture* picture, int la
    yerID) { |  79 const GrAtlasedLayer* GrLayerCache::findLayerOrCreate(SkPicture* picture, int la
    yerID) { | 
|  80     SkASSERT(picture->getGenerationID() != SkPicture::kInvalidGenID); |  80     SkASSERT(picture->uniqueID() != SK_InvalidGenID); | 
|  81     GrAtlasedLayer* layer = fLayerHash.find(PictureLayerKey(picture->getGenerati
    onID(), layerID)); |  81     GrAtlasedLayer* layer = fLayerHash.find(PictureLayerKey(picture->uniqueID(),
     layerID)); | 
|  82     if (NULL == layer) { |  82     if (NULL == layer) { | 
|  83         layer = this->createLayer(picture, layerID); |  83         layer = this->createLayer(picture, layerID); | 
|  84     } |  84     } | 
|  85     return layer; |  85     return layer; | 
|  86 } |  86 } | 
| OLD | NEW |