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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 const SkMatrix&, const SkIRect&) const { | 433 const SkMatrix&, const SkIRect&) const { |
434 return false; | 434 return false; |
435 } | 435 } |
436 | 436 |
437 SkImageFilter* SkImageFilter::CreateMatrixFilter(const SkMatrix& matrix, | 437 SkImageFilter* SkImageFilter::CreateMatrixFilter(const SkMatrix& matrix, |
438 SkFilterQuality filterQuality, | 438 SkFilterQuality filterQuality, |
439 SkImageFilter* input) { | 439 SkImageFilter* input) { |
440 return SkMatrixImageFilter::Create(matrix, filterQuality, input); | 440 return SkMatrixImageFilter::Create(matrix, filterQuality, input); |
441 } | 441 } |
442 | 442 |
443 SkImageFilter* SkImageFilter::CreateLocalMatrixFilter(const SkMatrix& matrix, | 443 SkImageFilter* SkImageFilter::newWithLocalMatrix(const SkMatrix& matrix) const { |
444 SkImageFilter* input) { | 444 // SkLocalMatrixImageFilter takes SkImage* in its factory, but logically tha
t parameter |
445 return SkLocalMatrixImageFilter::Create(matrix, input); | 445 // is *always* treated as a const ptr. Hence the const-cast here. |
| 446 // |
| 447 return SkLocalMatrixImageFilter::Create(matrix, const_cast<SkImageFilter*>(t
his)); |
446 } | 448 } |
447 | 449 |
448 #if SK_SUPPORT_GPU | 450 #if SK_SUPPORT_GPU |
449 | 451 |
450 void SkImageFilter::WrapTexture(GrTexture* texture, int width, int height, SkBit
map* result) { | 452 void SkImageFilter::WrapTexture(GrTexture* texture, int width, int height, SkBit
map* result) { |
451 SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); | 453 SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); |
452 result->setInfo(info); | 454 result->setInfo(info); |
453 result->setPixelRef(new SkGrPixelRef(info, texture))->unref(); | 455 result->setPixelRef(new SkGrPixelRef(info, texture))->unref(); |
454 } | 456 } |
455 | 457 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 } | 599 } |
598 return dev; | 600 return dev; |
599 } | 601 } |
600 | 602 |
601 bool SkImageFilter::DeviceProxy::filterImage(const SkImageFilter* filter, const
SkBitmap& src, | 603 bool SkImageFilter::DeviceProxy::filterImage(const SkImageFilter* filter, const
SkBitmap& src, |
602 const SkImageFilter::Context& ctx, | 604 const SkImageFilter::Context& ctx, |
603 SkBitmap* result, SkIPoint* offset) { | 605 SkBitmap* result, SkIPoint* offset) { |
604 return fDevice->filterImage(filter, src, ctx, result, offset); | 606 return fDevice->filterImage(filter, src, ctx, result, offset); |
605 } | 607 } |
606 | 608 |
OLD | NEW |