Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(616)

Side by Side Diff: src/gpu/GrLayerHoister.cpp

Issue 1826893002: Switch new SkImageFilter internal methods over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Change method name to drawSpriteWithFilter Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/effects/SkPaintImageFilter.cpp ('k') | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 302
303 SkImageFilter::DeviceProxy proxy(device); 303 SkImageFilter::DeviceProxy proxy(device);
304 304
305 // TODO: should the layer hoister store stand alone layers as SkSpecialImage s internally? 305 // TODO: should the layer hoister store stand alone layers as SkSpecialImage s internally?
306 const SkIRect subset = SkIRect::MakeWH(layer->texture()->width(), layer->tex ture()->height()); 306 const SkIRect subset = SkIRect::MakeWH(layer->texture()->width(), layer->tex ture()->height());
307 sk_sp<SkSpecialImage> img(SkSpecialImage::MakeFromGpu(&proxy, subset, 307 sk_sp<SkSpecialImage> img(SkSpecialImage::MakeFromGpu(&proxy, subset,
308 kNeedNewImageUniqueID_ SpecialImage, 308 kNeedNewImageUniqueID_ SpecialImage,
309 layer->texture())); 309 layer->texture()));
310 310
311 SkIPoint offset = SkIPoint::Make(0, 0); 311 SkIPoint offset = SkIPoint::Make(0, 0);
312 SkAutoTUnref<SkSpecialImage> result(layer->filter()->filterImage(img.get(), 312 sk_sp<SkSpecialImage> result(layer->filter()->filterImage(img.get(),
313 filterConte xt, 313 filterContext,
314 &offset)); 314 &offset));
315 if (!result) { 315 if (!result) {
316 // Filtering failed. Press on with the unfiltered version. 316 // Filtering failed. Press on with the unfiltered version.
317 return; 317 return;
318 } 318 }
319 319
320 SkASSERT(result->peekTexture()); 320 SkASSERT(result->peekTexture());
321 layer->setTexture(result->peekTexture(), result->subset(), false); 321 layer->setTexture(result->peekTexture(), result->subset(), false);
322 layer->setOffset(offset); 322 layer->setOffset(offset);
323 } 323 }
324 324
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 #if !GR_CACHE_HOISTED_LAYERS 388 #if !GR_CACHE_HOISTED_LAYERS
389 389
390 // This code completely clears out the atlas. It is required when 390 // This code completely clears out the atlas. It is required when
391 // caching is disabled so the atlas doesn't fill up and force more 391 // caching is disabled so the atlas doesn't fill up and force more
392 // free floating layers 392 // free floating layers
393 layerCache->purgeAll(); 393 layerCache->purgeAll();
394 #endif 394 #endif
395 395
396 layerCache->end(); 396 layerCache->end();
397 } 397 }
OLDNEW
« no previous file with comments | « src/effects/SkPaintImageFilter.cpp ('k') | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698