OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 The Android Open Source Project |
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 "SkImageFilter.h" | 8 #include "SkImageFilter.h" |
9 | 9 |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
516 | 516 |
517 SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache); | 517 SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache); |
518 | 518 |
519 SkImageFilter::Cache* SkImageFilter::Cache::Get() { | 519 SkImageFilter::Cache* SkImageFilter::Cache::Get() { |
520 return cache.get(); | 520 return cache.get(); |
521 } | 521 } |
522 | 522 |
523 void SkImageFilter::PurgeCache() { | 523 void SkImageFilter::PurgeCache() { |
524 cache.get()->purge(); | 524 cache.get()->purge(); |
525 } | 525 } |
526 | |
527 //////////////////////////////////////////////////////////////////////////////// /////////////////// | |
528 | |
529 #include "SkBitmapDevice.h" | |
Stephen White
2015/06/09 15:17:04
Nit: move this to top-of-file?
| |
530 | |
531 SkBaseDevice* SkImageFilter::Proxy::createDevice(int w, int h) { | |
532 SkBaseDevice::CreateInfo cinfo(SkImageInfo::MakeN32Premul(w, h), | |
robertphillips
2015/06/09 17:07:29
What about the SkTileImageFilter?
Stephen White
2015/06/10 14:42:45
SkTileImageFilter always does an extractSubset() o
| |
533 SkBaseDevice::kNever_TileUsage, | |
534 kUnknown_SkPixelGeometry, | |
535 true /*forImageFilter*/); | |
536 SkBaseDevice* dev = fDevice->onCreateDevice(cinfo, NULL); | |
robertphillips
2015/06/09 17:07:29
!dev ?
| |
537 if (NULL == dev) { | |
538 dev = SkBitmapDevice::Create(cinfo.fInfo); | |
539 } | |
540 return dev; | |
541 } | |
542 | |
543 bool SkImageFilter::Proxy::filterImage(const SkImageFilter* filter, const SkBitm ap& src, | |
544 const SkImageFilter::Context& ctx, | |
545 SkBitmap* result, SkIPoint* offset) { | |
546 return fDevice->filterImage(filter, src, ctx, result, offset); | |
547 } | |
548 | |
OLD | NEW |