Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: src/effects/SkMorphologyImageFilter.cpp

Issue 938383004: Dynamically create stencil buffer when needed. (Closed) Base URL: https://skia.googlesource.com/skia.git@bigstencil
Patch Set: Actually save file before uploading Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/effects/SkGpuBlurUtils.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 SkBitmap* dst) { 650 SkBitmap* dst) {
651 SkAutoTUnref<GrTexture> srcTexture(SkRef(input.getTexture())); 651 SkAutoTUnref<GrTexture> srcTexture(SkRef(input.getTexture()));
652 SkASSERT(srcTexture); 652 SkASSERT(srcTexture);
653 GrContext* context = srcTexture->getContext(); 653 GrContext* context = srcTexture->getContext();
654 654
655 GrContext::AutoClip acs(context, SkRect::MakeWH(SkIntToScalar(srcTexture->wi dth()), 655 GrContext::AutoClip acs(context, SkRect::MakeWH(SkIntToScalar(srcTexture->wi dth()),
656 SkIntToScalar(srcTexture->he ight()))); 656 SkIntToScalar(srcTexture->he ight())));
657 657
658 SkIRect dstRect = SkIRect::MakeWH(rect.width(), rect.height()); 658 SkIRect dstRect = SkIRect::MakeWH(rect.width(), rect.height());
659 GrSurfaceDesc desc; 659 GrSurfaceDesc desc;
660 desc.fFlags = kRenderTarget_GrSurfaceFlag | kNoStencil_GrSurfaceFlag; 660 desc.fFlags = kRenderTarget_GrSurfaceFlag;
661 desc.fWidth = rect.width(); 661 desc.fWidth = rect.width();
662 desc.fHeight = rect.height(); 662 desc.fHeight = rect.height();
663 desc.fConfig = kSkia8888_GrPixelConfig; 663 desc.fConfig = kSkia8888_GrPixelConfig;
664 SkIRect srcRect = rect; 664 SkIRect srcRect = rect;
665 665
666 if (radius.fWidth > 0) { 666 if (radius.fWidth > 0) {
667 GrTexture* texture = context->refScratchTexture(desc, GrContext::kApprox _ScratchTexMatch); 667 GrTexture* texture = context->refScratchTexture(desc, GrContext::kApprox _ScratchTexMatch);
668 if (NULL == texture) { 668 if (NULL == texture) {
669 return false; 669 return false;
670 } 670 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 SkBitmap* result, SkIPoint* offset) con st { 742 SkBitmap* result, SkIPoint* offset) con st {
743 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); 743 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset);
744 } 744 }
745 745
746 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, 746 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx,
747 SkBitmap* result, SkIPoint* offset) cons t { 747 SkBitmap* result, SkIPoint* offset) cons t {
748 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); 748 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset);
749 } 749 }
750 750
751 #endif 751 #endif
OLDNEW
« no previous file with comments | « src/effects/SkGpuBlurUtils.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698