| 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 "GrLayerCache.h" | 8 #include "GrLayerCache.h" |
| 9 #include "GrLayerHoister.h" | 9 #include "GrLayerHoister.h" |
| 10 #include "GrRecordReplaceDraw.h" | 10 #include "GrRecordReplaceDraw.h" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 | 275 |
| 276 atlasCanvas->flush(); | 276 atlasCanvas->flush(); |
| 277 } | 277 } |
| 278 } | 278 } |
| 279 | 279 |
| 280 SkBitmap wrap_texture(GrTexture* texture) { | 280 SkBitmap wrap_texture(GrTexture* texture) { |
| 281 SkASSERT(texture); | 281 SkASSERT(texture); |
| 282 | 282 |
| 283 SkBitmap result; | 283 SkBitmap result; |
| 284 result.setInfo(texture->surfacePriv().info(kPremul_SkAlphaType)); | 284 result.setInfo(texture->surfacePriv().info(kPremul_SkAlphaType)); |
| 285 result.setPixelRef(SkNEW_ARGS(SkGrPixelRef, (result.info(), texture)))->unre
f(); | 285 result.setPixelRef(new SkGrPixelRef(result.info(), texture))->unref(); |
| 286 return result; | 286 return result; |
| 287 } | 287 } |
| 288 | 288 |
| 289 void GrLayerHoister::FilterLayer(GrContext* context, | 289 void GrLayerHoister::FilterLayer(GrContext* context, |
| 290 SkGpuDevice* device, | 290 SkGpuDevice* device, |
| 291 const GrHoistedLayer& info) { | 291 const GrHoistedLayer& info) { |
| 292 GrCachedLayer* layer = info.fLayer; | 292 GrCachedLayer* layer = info.fLayer; |
| 293 | 293 |
| 294 SkASSERT(layer->filter()); | 294 SkASSERT(layer->filter()); |
| 295 | 295 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 void GrLayerHoister::PurgeCache(GrContext* context) { | 383 void GrLayerHoister::PurgeCache(GrContext* context) { |
| 384 #if !GR_CACHE_HOISTED_LAYERS | 384 #if !GR_CACHE_HOISTED_LAYERS |
| 385 GrLayerCache* layerCache = context->getLayerCache(); | 385 GrLayerCache* layerCache = context->getLayerCache(); |
| 386 | 386 |
| 387 // This code completely clears out the atlas. It is required when | 387 // This code completely clears out the atlas. It is required when |
| 388 // caching is disabled so the atlas doesn't fill up and force more | 388 // caching is disabled so the atlas doesn't fill up and force more |
| 389 // free floating layers | 389 // free floating layers |
| 390 layerCache->purgeAll(); | 390 layerCache->purgeAll(); |
| 391 #endif | 391 #endif |
| 392 } | 392 } |
| OLD | NEW |