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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 morphType))->unref(); | 495 morphType))->unref(); |
496 context->drawRectToRect(paint, SkRect::Make(dstRect), SkRect::Make(srcRect))
; | 496 context->drawRectToRect(paint, SkRect::Make(dstRect), SkRect::Make(srcRect))
; |
497 } | 497 } |
498 | 498 |
499 bool apply_morphology(const SkBitmap& input, | 499 bool apply_morphology(const SkBitmap& input, |
500 const SkIRect& rect, | 500 const SkIRect& rect, |
501 GrMorphologyEffect::MorphologyType morphType, | 501 GrMorphologyEffect::MorphologyType morphType, |
502 SkISize radius, | 502 SkISize radius, |
503 SkBitmap* dst) { | 503 SkBitmap* dst) { |
504 GrTexture* srcTexture = input.getTexture(); | 504 GrTexture* srcTexture = input.getTexture(); |
505 SkASSERT(NULL != srcTexture); | 505 SkASSERT(srcTexture); |
506 GrContext* context = srcTexture->getContext(); | 506 GrContext* context = srcTexture->getContext(); |
507 srcTexture->ref(); | 507 srcTexture->ref(); |
508 SkAutoTUnref<GrTexture> src(srcTexture); | 508 SkAutoTUnref<GrTexture> src(srcTexture); |
509 | 509 |
510 GrContext::AutoMatrix am; | 510 GrContext::AutoMatrix am; |
511 am.setIdentity(context); | 511 am.setIdentity(context); |
512 | 512 |
513 GrContext::AutoClip acs(context, SkRect::MakeWH(SkIntToScalar(srcTexture->wi
dth()), | 513 GrContext::AutoClip acs(context, SkRect::MakeWH(SkIntToScalar(srcTexture->wi
dth()), |
514 SkIntToScalar(srcTexture->he
ight()))); | 514 SkIntToScalar(srcTexture->he
ight()))); |
515 | 515 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 SkBitmap* result, SkIPoint* offset) con
st { | 601 SkBitmap* result, SkIPoint* offset) con
st { |
602 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); | 602 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); |
603 } | 603 } |
604 | 604 |
605 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, | 605 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, |
606 SkBitmap* result, SkIPoint* offset) cons
t { | 606 SkBitmap* result, SkIPoint* offset) cons
t { |
607 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); | 607 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); |
608 } | 608 } |
609 | 609 |
610 #endif | 610 #endif |
OLD | NEW |