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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 | 457 |
458 if (this->canFilterImageGPU()) { | 458 if (this->canFilterImageGPU()) { |
459 return this->filterImageGPU(proxy, src, ctx, result, offset); | 459 return this->filterImageGPU(proxy, src, ctx, result, offset); |
460 } else { | 460 } else { |
461 if (this->filterImage(proxy, src, ctx, result, offset)) { | 461 if (this->filterImage(proxy, src, ctx, result, offset)) { |
462 if (!result->getTexture()) { | 462 if (!result->getTexture()) { |
463 const SkImageInfo info = result->info(); | 463 const SkImageInfo info = result->info(); |
464 if (kUnknown_SkColorType == info.colorType()) { | 464 if (kUnknown_SkColorType == info.colorType()) { |
465 return false; | 465 return false; |
466 } | 466 } |
467 SkAutoTUnref<GrTexture> resultTex(GrRefCachedBitmapTexture(conte
xt, *result, nullptr)); | 467 SkAutoTUnref<GrTexture> resultTex( |
| 468 GrRefCachedBitmapTexture(context, *result,GrTextureParams::C
lampNoFilter())); |
468 result->setPixelRef(new SkGrPixelRef(info, resultTex))->unref(); | 469 result->setPixelRef(new SkGrPixelRef(info, resultTex))->unref(); |
469 } | 470 } |
470 return true; | 471 return true; |
471 } else { | 472 } else { |
472 return false; | 473 return false; |
473 } | 474 } |
474 } | 475 } |
475 } | 476 } |
476 #endif | 477 #endif |
477 | 478 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 } | 591 } |
591 return dev; | 592 return dev; |
592 } | 593 } |
593 | 594 |
594 bool SkImageFilter::Proxy::filterImage(const SkImageFilter* filter, const SkBitm
ap& src, | 595 bool SkImageFilter::Proxy::filterImage(const SkImageFilter* filter, const SkBitm
ap& src, |
595 const SkImageFilter::Context& ctx, | 596 const SkImageFilter::Context& ctx, |
596 SkBitmap* result, SkIPoint* offset) { | 597 SkBitmap* result, SkIPoint* offset) { |
597 return fDevice->filterImage(filter, src, ctx, result, offset); | 598 return fDevice->filterImage(filter, src, ctx, result, offset); |
598 } | 599 } |
599 | 600 |
OLD | NEW |