| 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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 GrRenderTarget* rt, | 464 GrRenderTarget* rt, |
| 465 const GrClip& clip, | 465 const GrClip& clip, |
| 466 GrTexture* texture, | 466 GrTexture* texture, |
| 467 const SkIRect& srcRect, | 467 const SkIRect& srcRect, |
| 468 const SkIRect& dstRect, | 468 const SkIRect& dstRect, |
| 469 int radius, | 469 int radius, |
| 470 GrMorphologyEffect::MorphologyType morphType, | 470 GrMorphologyEffect::MorphologyType morphType, |
| 471 float bounds[2], | 471 float bounds[2], |
| 472 Gr1DKernelEffect::Direction direction) { | 472 Gr1DKernelEffect::Direction direction) { |
| 473 GrPaint paint; | 473 GrPaint paint; |
| 474 paint.addColorProcessor(GrMorphologyEffect::Create(paint.getProcessorDataMan
ager(), | 474 paint.addColorFragmentProcessor(GrMorphologyEffect::Create(paint.getProcesso
rDataManager(), |
| 475 texture, | 475 texture, |
| 476 direction, | 476 direction, |
| 477 radius, | 477 radius, |
| 478 morphType, | 478 morphType, |
| 479 bounds))->unref(); | 479 bounds))->unref()
; |
| 480 drawContext->drawNonAARectToRect(rt, clip, paint, SkMatrix::I(), SkRect::Mak
e(dstRect), | 480 drawContext->drawNonAARectToRect(rt, clip, paint, SkMatrix::I(), SkRect::Mak
e(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 GrRenderTarget* rt, | 485 GrRenderTarget* rt, |
| 486 const GrClip& clip, | 486 const GrClip& clip, |
| 487 GrTexture* texture, | 487 GrTexture* texture, |
| 488 const SkIRect& srcRect, | 488 const SkIRect& srcRect, |
| 489 const SkIRect& dstRect, | 489 const SkIRect& dstRect, |
| 490 int radius, | 490 int radius, |
| 491 GrMorphologyEffect::MorphologyType morphTyp
e, | 491 GrMorphologyEffect::MorphologyType morphTyp
e, |
| 492 Gr1DKernelEffect::Direction direction) { | 492 Gr1DKernelEffect::Direction direction) { |
| 493 GrPaint paint; | 493 GrPaint paint; |
| 494 paint.addColorProcessor(GrMorphologyEffect::Create(paint.getProcessorDataMan
ager(), | 494 paint.addColorFragmentProcessor(GrMorphologyEffect::Create(paint.getProcesso
rDataManager(), |
| 495 texture, | 495 texture, |
| 496 direction, | 496 direction, |
| 497 radius, | 497 radius, |
| 498 morphType))->unref(); | 498 morphType))->unre
f(); |
| 499 drawContext->drawNonAARectToRect(rt, clip, paint, SkMatrix::I(), SkRect::Mak
e(dstRect), | 499 drawContext->drawNonAARectToRect(rt, clip, paint, SkMatrix::I(), SkRect::Mak
e(dstRect), |
| 500 SkRect::Make(srcRect)); | 500 SkRect::Make(srcRect)); |
| 501 } | 501 } |
| 502 | 502 |
| 503 void apply_morphology_pass(GrDrawContext* drawContext, | 503 void apply_morphology_pass(GrDrawContext* drawContext, |
| 504 GrRenderTarget* rt, | 504 GrRenderTarget* rt, |
| 505 const GrClip& clip, | 505 const GrClip& clip, |
| 506 GrTexture* texture, | 506 GrTexture* texture, |
| 507 const SkIRect& srcRect, | 507 const SkIRect& srcRect, |
| 508 const SkIRect& dstRect, | 508 const SkIRect& dstRect, |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 SkBitmap* result, SkIPoint* offset) con
st { | 662 SkBitmap* result, SkIPoint* offset) con
st { |
| 663 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); | 663 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); |
| 664 } | 664 } |
| 665 | 665 |
| 666 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, | 666 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, |
| 667 SkBitmap* result, SkIPoint* offset) cons
t { | 667 SkBitmap* result, SkIPoint* offset) cons
t { |
| 668 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); | 668 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); |
| 669 } | 669 } |
| 670 | 670 |
| 671 #endif | 671 #endif |
| OLD | NEW |