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

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

Issue 1584933002: Refactor to use GrWrapTextureInBitmap more (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix no-gpu build Created 4 years, 11 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/SkLightingImageFilter.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"
11 #include "SkDevice.h" 11 #include "SkDevice.h"
12 #include "SkOpts.h" 12 #include "SkOpts.h"
13 #include "SkReadBuffer.h" 13 #include "SkReadBuffer.h"
14 #include "SkRect.h" 14 #include "SkRect.h"
15 #include "SkWriteBuffer.h" 15 #include "SkWriteBuffer.h"
16 #if SK_SUPPORT_GPU 16 #if SK_SUPPORT_GPU
17 #include "GrContext.h" 17 #include "GrContext.h"
18 #include "GrDrawContext.h" 18 #include "GrDrawContext.h"
19 #include "GrInvariantOutput.h" 19 #include "GrInvariantOutput.h"
20 #include "GrTexture.h" 20 #include "GrTexture.h"
21 #include "SkGr.h"
21 #include "effects/Gr1DKernelEffect.h" 22 #include "effects/Gr1DKernelEffect.h"
22 #include "glsl/GrGLSLFragmentProcessor.h" 23 #include "glsl/GrGLSLFragmentProcessor.h"
23 #include "glsl/GrGLSLFragmentShaderBuilder.h" 24 #include "glsl/GrGLSLFragmentShaderBuilder.h"
24 #include "glsl/GrGLSLProgramDataManager.h" 25 #include "glsl/GrGLSLProgramDataManager.h"
25 #include "glsl/GrGLSLUniformHandler.h" 26 #include "glsl/GrGLSLUniformHandler.h"
26 #endif 27 #endif
27 28
28 SkMorphologyImageFilter::SkMorphologyImageFilter(int radiusX, 29 SkMorphologyImageFilter::SkMorphologyImageFilter(int radiusX,
29 int radiusY, 30 int radiusY,
30 SkImageFilter* input, 31 SkImageFilter* input,
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 if (!dstDrawContext) { 600 if (!dstDrawContext) {
600 return false; 601 return false;
601 } 602 }
602 603
603 apply_morphology_pass(dstDrawContext, clip, srcTexture, 604 apply_morphology_pass(dstDrawContext, clip, srcTexture,
604 srcRect, dstRect, radius.fHeight, morphType, 605 srcRect, dstRect, radius.fHeight, morphType,
605 Gr1DKernelEffect::kY_Direction); 606 Gr1DKernelEffect::kY_Direction);
606 607
607 srcTexture.reset(scratch); 608 srcTexture.reset(scratch);
608 } 609 }
609 SkImageFilter::WrapTexture(srcTexture, rect.width(), rect.height(), dst); 610 GrWrapTextureInBitmap(srcTexture, rect.width(), rect.height(), false, dst);
610 return true; 611 return true;
611 } 612 }
612 613
613 }; 614 };
614 615
615 bool SkMorphologyImageFilter::filterImageGPUGeneric(bool dilate, 616 bool SkMorphologyImageFilter::filterImageGPUGeneric(bool dilate,
616 Proxy* proxy, 617 Proxy* proxy,
617 const SkBitmap& src, 618 const SkBitmap& src,
618 const Context& ctx, 619 const Context& ctx,
619 SkBitmap* result, 620 SkBitmap* result,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 SkBitmap* result, SkIPoint* offset) con st { 661 SkBitmap* result, SkIPoint* offset) con st {
661 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); 662 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset);
662 } 663 }
663 664
664 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, 665 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx,
665 SkBitmap* result, SkIPoint* offset) cons t { 666 SkBitmap* result, SkIPoint* offset) cons t {
666 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); 667 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset);
667 } 668 }
668 669
669 #endif 670 #endif
OLDNEW
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698