| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 // This cache is transient, and is freed (along with all its contained | 301 // This cache is transient, and is freed (along with all its contained |
| 302 // textures) when it goes out of scope. | 302 // textures) when it goes out of scope. |
| 303 SkAutoTUnref<SkImageFilter::Cache> cache(SkImageFilter::Cache::Create(kDefau
ltCacheSize)); | 303 SkAutoTUnref<SkImageFilter::Cache> cache(SkImageFilter::Cache::Create(kDefau
ltCacheSize)); |
| 304 SkImageFilter::Context filterContext(totMat, clipBounds, cache); | 304 SkImageFilter::Context filterContext(totMat, clipBounds, cache); |
| 305 | 305 |
| 306 SkImageFilter::DeviceProxy proxy(device); | 306 SkImageFilter::DeviceProxy proxy(device); |
| 307 SkBitmap src; | 307 SkBitmap src; |
| 308 GrWrapTextureInBitmap(layer->texture(), layer->texture()->width(), layer->te
xture()->height(), | 308 GrWrapTextureInBitmap(layer->texture(), layer->texture()->width(), layer->te
xture()->height(), |
| 309 false, &src); | 309 false, &src); |
| 310 | 310 |
| 311 if (!layer->filter()->filterImage(&proxy, src, filterContext, &filteredBitma
p, &offset)) { | 311 if (!layer->filter()->filterImageDeprecated(&proxy, src, filterContext, |
| 312 &filteredBitmap, &offset)) { |
| 312 // Filtering failed. Press on with the unfiltered version. | 313 // Filtering failed. Press on with the unfiltered version. |
| 313 return; | 314 return; |
| 314 } | 315 } |
| 315 | 316 |
| 316 SkIRect newRect = SkIRect::MakeWH(filteredBitmap.width(), filteredBitmap.hei
ght()); | 317 SkIRect newRect = SkIRect::MakeWH(filteredBitmap.width(), filteredBitmap.hei
ght()); |
| 317 layer->setTexture(filteredBitmap.getTexture(), newRect, false); | 318 layer->setTexture(filteredBitmap.getTexture(), newRect, false); |
| 318 layer->setOffset(offset); | 319 layer->setOffset(offset); |
| 319 } | 320 } |
| 320 | 321 |
| 321 void GrLayerHoister::DrawLayers(GrContext* context, const SkTDArray<GrHoistedLay
er>& layers) { | 322 void GrLayerHoister::DrawLayers(GrContext* context, const SkTDArray<GrHoistedLay
er>& layers) { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 #if !GR_CACHE_HOISTED_LAYERS | 385 #if !GR_CACHE_HOISTED_LAYERS |
| 385 | 386 |
| 386 // This code completely clears out the atlas. It is required when | 387 // This code completely clears out the atlas. It is required when |
| 387 // 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 |
| 388 // free floating layers | 389 // free floating layers |
| 389 layerCache->purgeAll(); | 390 layerCache->purgeAll(); |
| 390 #endif | 391 #endif |
| 391 | 392 |
| 392 layerCache->end(); | 393 layerCache->end(); |
| 393 } | 394 } |
| OLD | NEW |