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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 SkASSERT(srcTexture); | 506 SkASSERT(srcTexture); |
507 GrContext* context = srcTexture->getContext(); | 507 GrContext* context = srcTexture->getContext(); |
508 | 508 |
509 GrContext::AutoMatrix am; | 509 GrContext::AutoMatrix am; |
510 am.setIdentity(context); | 510 am.setIdentity(context); |
511 | 511 |
512 GrContext::AutoClip acs(context, SkRect::MakeWH(SkIntToScalar(srcTexture->wi
dth()), | 512 GrContext::AutoClip acs(context, SkRect::MakeWH(SkIntToScalar(srcTexture->wi
dth()), |
513 SkIntToScalar(srcTexture->he
ight()))); | 513 SkIntToScalar(srcTexture->he
ight()))); |
514 | 514 |
515 SkIRect dstRect = SkIRect::MakeWH(rect.width(), rect.height()); | 515 SkIRect dstRect = SkIRect::MakeWH(rect.width(), rect.height()); |
516 GrTextureDesc desc; | 516 GrSurfaceDesc desc; |
517 desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit; | 517 desc.fFlags = kRenderTarget_GrSurfaceFlag | kNoStencil_GrSurfaceFlag; |
518 desc.fWidth = rect.width(); | 518 desc.fWidth = rect.width(); |
519 desc.fHeight = rect.height(); | 519 desc.fHeight = rect.height(); |
520 desc.fConfig = kSkia8888_GrPixelConfig; | 520 desc.fConfig = kSkia8888_GrPixelConfig; |
521 SkIRect srcRect = rect; | 521 SkIRect srcRect = rect; |
522 | 522 |
523 if (radius.fWidth > 0) { | 523 if (radius.fWidth > 0) { |
524 GrTexture* texture = context->refScratchTexture(desc, GrContext::kApprox
_ScratchTexMatch); | 524 GrTexture* texture = context->refScratchTexture(desc, GrContext::kApprox
_ScratchTexMatch); |
525 if (NULL == texture) { | 525 if (NULL == texture) { |
526 return false; | 526 return false; |
527 } | 527 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 SkBitmap* result, SkIPoint* offset) con
st { | 600 SkBitmap* result, SkIPoint* offset) con
st { |
601 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); | 601 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); |
602 } | 602 } |
603 | 603 |
604 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, | 604 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, |
605 SkBitmap* result, SkIPoint* offset) cons
t { | 605 SkBitmap* result, SkIPoint* offset) cons
t { |
606 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); | 606 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); |
607 } | 607 } |
608 | 608 |
609 #endif | 609 #endif |
OLD | NEW |