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 "SkMorphologyImageFilter.h" | 8 #include "SkMorphologyImageFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 int radius, | 470 int radius, |
471 GrMorphologyEffect::MorphologyType morphType, | 471 GrMorphologyEffect::MorphologyType morphType, |
472 float bounds[2], | 472 float bounds[2], |
473 Gr1DKernelEffect::Direction direction) { | 473 Gr1DKernelEffect::Direction direction) { |
474 GrPaint paint; | 474 GrPaint paint; |
475 paint.addColorFragmentProcessor(GrMorphologyEffect::Create(texture, | 475 paint.addColorFragmentProcessor(GrMorphologyEffect::Create(texture, |
476 direction, | 476 direction, |
477 radius, | 477 radius, |
478 morphType, | 478 morphType, |
479 bounds))->unref()
; | 479 bounds))->unref()
; |
480 drawContext->drawNonAARectToRect(clip, paint, SkMatrix::I(), SkRect::Make(ds
tRect), | 480 drawContext->fillRectToRect(clip, paint, SkMatrix::I(), SkRect::Make(dstRect
), |
481 SkRect::Make(srcRect)); | 481 SkRect::Make(srcRect)); |
482 } | 482 } |
483 | 483 |
484 void apply_morphology_rect_no_bounds(GrDrawContext* drawContext, | 484 void apply_morphology_rect_no_bounds(GrDrawContext* drawContext, |
485 const GrClip& clip, | 485 const GrClip& clip, |
486 GrTexture* texture, | 486 GrTexture* texture, |
487 const SkIRect& srcRect, | 487 const SkIRect& srcRect, |
488 const SkIRect& dstRect, | 488 const SkIRect& dstRect, |
489 int radius, | 489 int radius, |
490 GrMorphologyEffect::MorphologyType morphTyp
e, | 490 GrMorphologyEffect::MorphologyType morphTyp
e, |
491 Gr1DKernelEffect::Direction direction) { | 491 Gr1DKernelEffect::Direction direction) { |
492 GrPaint paint; | 492 GrPaint paint; |
493 paint.addColorFragmentProcessor(GrMorphologyEffect::Create(texture, | 493 paint.addColorFragmentProcessor(GrMorphologyEffect::Create(texture, |
494 direction, | 494 direction, |
495 radius, | 495 radius, |
496 morphType))->unre
f(); | 496 morphType))->unre
f(); |
497 drawContext->drawNonAARectToRect(clip, paint, SkMatrix::I(), SkRect::Make(ds
tRect), | 497 drawContext->fillRectToRect(clip, paint, SkMatrix::I(), SkRect::Make(dstRect
), |
498 SkRect::Make(srcRect)); | 498 SkRect::Make(srcRect)); |
499 } | 499 } |
500 | 500 |
501 void apply_morphology_pass(GrDrawContext* drawContext, | 501 void apply_morphology_pass(GrDrawContext* drawContext, |
502 const GrClip& clip, | 502 const GrClip& clip, |
503 GrTexture* texture, | 503 GrTexture* texture, |
504 const SkIRect& srcRect, | 504 const SkIRect& srcRect, |
505 const SkIRect& dstRect, | 505 const SkIRect& dstRect, |
506 int radius, | 506 int radius, |
507 GrMorphologyEffect::MorphologyType morphType, | 507 GrMorphologyEffect::MorphologyType morphType, |
508 Gr1DKernelEffect::Direction direction) { | 508 Gr1DKernelEffect::Direction direction) { |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 SkBitmap* result, SkIPoint* offset) con
st { | 669 SkBitmap* result, SkIPoint* offset) con
st { |
670 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); | 670 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); |
671 } | 671 } |
672 | 672 |
673 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, | 673 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, |
674 SkBitmap* result, SkIPoint* offset) cons
t { | 674 SkBitmap* result, SkIPoint* offset) cons
t { |
675 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); | 675 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); |
676 } | 676 } |
677 | 677 |
678 #endif | 678 #endif |
OLD | NEW |