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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(new SkGrPixelRef(result.info(), texture))->unref(); | 285 result.setPixelRef(new SkGrPixelRef(result.info(), texture))->unref(); |
286 return result; | 286 return skstd::move(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 |
296 static const int kDefaultCacheSize = 32 * 1024 * 1024; | 296 static const int kDefaultCacheSize = 32 * 1024 * 1024; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 #if !GR_CACHE_HOISTED_LAYERS | 392 #if !GR_CACHE_HOISTED_LAYERS |
393 | 393 |
394 // This code completely clears out the atlas. It is required when | 394 // This code completely clears out the atlas. It is required when |
395 // caching is disabled so the atlas doesn't fill up and force more | 395 // caching is disabled so the atlas doesn't fill up and force more |
396 // free floating layers | 396 // free floating layers |
397 layerCache->purgeAll(); | 397 layerCache->purgeAll(); |
398 #endif | 398 #endif |
399 | 399 |
400 layerCache->end(); | 400 layerCache->end(); |
401 } | 401 } |
OLD | NEW |