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" |
| 11 #include "SkBitmapDevice.h" |
11 #include "SkChecksum.h" | 12 #include "SkChecksum.h" |
12 #include "SkDevice.h" | 13 #include "SkDevice.h" |
13 #include "SkLazyPtr.h" | 14 #include "SkLazyPtr.h" |
14 #include "SkMatrixImageFilter.h" | 15 #include "SkMatrixImageFilter.h" |
15 #include "SkReadBuffer.h" | 16 #include "SkReadBuffer.h" |
16 #include "SkWriteBuffer.h" | 17 #include "SkWriteBuffer.h" |
17 #include "SkRect.h" | 18 #include "SkRect.h" |
18 #include "SkTDynamicHash.h" | 19 #include "SkTDynamicHash.h" |
19 #include "SkTInternalLList.h" | 20 #include "SkTInternalLList.h" |
20 #include "SkValidationUtils.h" | 21 #include "SkValidationUtils.h" |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 SkImageFilter::Cache* SkImageFilter::Cache::Get() { | 520 SkImageFilter::Cache* SkImageFilter::Cache::Get() { |
520 return cache.get(); | 521 return cache.get(); |
521 } | 522 } |
522 | 523 |
523 void SkImageFilter::PurgeCache() { | 524 void SkImageFilter::PurgeCache() { |
524 cache.get()->purge(); | 525 cache.get()->purge(); |
525 } | 526 } |
526 | 527 |
527 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 528 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
528 | 529 |
529 #include "SkBitmapDevice.h" | |
530 | |
531 SkBaseDevice* SkImageFilter::Proxy::createDevice(int w, int h) { | 530 SkBaseDevice* SkImageFilter::Proxy::createDevice(int w, int h) { |
532 SkBaseDevice::CreateInfo cinfo(SkImageInfo::MakeN32Premul(w, h), | 531 SkBaseDevice::CreateInfo cinfo(SkImageInfo::MakeN32Premul(w, h), |
533 SkBaseDevice::kNever_TileUsage, | 532 SkBaseDevice::kNever_TileUsage, |
534 kUnknown_SkPixelGeometry, | 533 kUnknown_SkPixelGeometry, |
535 true /*forImageFilter*/); | 534 true /*forImageFilter*/); |
536 SkBaseDevice* dev = fDevice->onCreateDevice(cinfo, NULL); | 535 SkBaseDevice* dev = fDevice->onCreateDevice(cinfo, NULL); |
537 if (NULL == dev) { | 536 if (NULL == dev) { |
538 dev = SkBitmapDevice::Create(cinfo.fInfo); | 537 const SkSurfaceProps surfaceProps(fDevice->fSurfaceProps.flags(), |
| 538 kUnknown_SkPixelGeometry); |
| 539 dev = SkBitmapDevice::Create(cinfo.fInfo, surfaceProps); |
539 } | 540 } |
540 return dev; | 541 return dev; |
541 } | 542 } |
542 | 543 |
543 bool SkImageFilter::Proxy::filterImage(const SkImageFilter* filter, const SkBitm
ap& src, | 544 bool SkImageFilter::Proxy::filterImage(const SkImageFilter* filter, const SkBitm
ap& src, |
544 const SkImageFilter::Context& ctx, | 545 const SkImageFilter::Context& ctx, |
545 SkBitmap* result, SkIPoint* offset) { | 546 SkBitmap* result, SkIPoint* offset) { |
546 return fDevice->filterImage(filter, src, ctx, result, offset); | 547 return fDevice->filterImage(filter, src, ctx, result, offset); |
547 } | 548 } |
548 | 549 |
OLD | NEW |