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

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

Issue 1571033002: remove imagefilter::sizeconstraint (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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/SkXfermodeImageFilter.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 totMat.preConcat(info.fPreMat); 304 totMat.preConcat(info.fPreMat);
305 totMat.preConcat(info.fLocalMat); 305 totMat.preConcat(info.fLocalMat);
306 totMat.postTranslate(-SkIntToScalar(filterOffset.fX), -SkIntToScalar(filterO ffset.fY)); 306 totMat.postTranslate(-SkIntToScalar(filterOffset.fX), -SkIntToScalar(filterO ffset.fY));
307 307
308 SkASSERT(0 == layer->rect().fLeft && 0 == layer->rect().fTop); 308 SkASSERT(0 == layer->rect().fLeft && 0 == layer->rect().fTop);
309 SkIRect clipBounds = layer->rect(); 309 SkIRect clipBounds = layer->rect();
310 310
311 // This cache is transient, and is freed (along with all its contained 311 // This cache is transient, and is freed (along with all its contained
312 // textures) when it goes out of scope. 312 // textures) when it goes out of scope.
313 SkAutoTUnref<SkImageFilter::Cache> cache(SkImageFilter::Cache::Create(kDefau ltCacheSize)); 313 SkAutoTUnref<SkImageFilter::Cache> cache(SkImageFilter::Cache::Create(kDefau ltCacheSize));
314 SkImageFilter::Context filterContext(totMat, clipBounds, cache, SkImageFilte r::kApprox_SizeConstraint); 314 SkImageFilter::Context filterContext(totMat, clipBounds, cache);
315 315
316 SkImageFilter::DeviceProxy proxy(device); 316 SkImageFilter::DeviceProxy proxy(device);
317 const SkBitmap src = wrap_texture(layer->texture()); 317 const SkBitmap src = wrap_texture(layer->texture());
318 318
319 if (!layer->filter()->filterImage(&proxy, src, filterContext, &filteredBitma p, &offset)) { 319 if (!layer->filter()->filterImage(&proxy, src, filterContext, &filteredBitma p, &offset)) {
320 // Filtering failed. Press on with the unfiltered version. 320 // Filtering failed. Press on with the unfiltered version.
321 return; 321 return;
322 } 322 }
323 323
324 SkIRect newRect = SkIRect::MakeWH(filteredBitmap.width(), filteredBitmap.hei ght()); 324 SkIRect newRect = SkIRect::MakeWH(filteredBitmap.width(), filteredBitmap.hei ght());
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698