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

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

Issue 1893973002: Outline SkImageFilter Make methods (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 4 years, 8 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/SkMergeImageFilter.cpp ('k') | src/effects/SkOffsetImageFilter.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 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 10 matching lines...) Expand all
21 #include "GrInvariantOutput.h" 21 #include "GrInvariantOutput.h"
22 #include "GrTexture.h" 22 #include "GrTexture.h"
23 #include "SkGr.h" 23 #include "SkGr.h"
24 #include "effects/Gr1DKernelEffect.h" 24 #include "effects/Gr1DKernelEffect.h"
25 #include "glsl/GrGLSLFragmentProcessor.h" 25 #include "glsl/GrGLSLFragmentProcessor.h"
26 #include "glsl/GrGLSLFragmentShaderBuilder.h" 26 #include "glsl/GrGLSLFragmentShaderBuilder.h"
27 #include "glsl/GrGLSLProgramDataManager.h" 27 #include "glsl/GrGLSLProgramDataManager.h"
28 #include "glsl/GrGLSLUniformHandler.h" 28 #include "glsl/GrGLSLUniformHandler.h"
29 #endif 29 #endif
30 30
31 sk_sp<SkImageFilter> SkDilateImageFilter::Make(int radiusX, int radiusY,
32 sk_sp<SkImageFilter> input,
33 const CropRect* cropRect) {
34 if (radiusX < 0 || radiusY < 0) {
35 return nullptr;
36 }
37 return sk_sp<SkImageFilter>(new SkDilateImageFilter(radiusX, radiusY,
38 std::move(input),
39 cropRect));
40 }
41
42
43 sk_sp<SkImageFilter> SkErodeImageFilter::Make(int radiusX, int radiusY,
44 sk_sp<SkImageFilter> input,
45 const CropRect* cropRect) {
46 if (radiusX < 0 || radiusY < 0) {
47 return nullptr;
48 }
49 return sk_sp<SkImageFilter>(new SkErodeImageFilter(radiusX, radiusY,
50 std::move(input),
51 cropRect));
52 }
53
31 SkMorphologyImageFilter::SkMorphologyImageFilter(int radiusX, 54 SkMorphologyImageFilter::SkMorphologyImageFilter(int radiusX,
32 int radiusY, 55 int radiusY,
33 sk_sp<SkImageFilter> input, 56 sk_sp<SkImageFilter> input,
34 const CropRect* cropRect) 57 const CropRect* cropRect)
35 : INHERITED(&input, 1, cropRect) 58 : INHERITED(&input, 1, cropRect)
36 , fRadius(SkISize::Make(radiusX, radiusY)) { 59 , fRadius(SkISize::Make(radiusX, radiusY)) {
37 } 60 }
38 61
39 void SkMorphologyImageFilter::flatten(SkWriteBuffer& buffer) const { 62 void SkMorphologyImageFilter::flatten(SkWriteBuffer& buffer) const {
40 this->INHERITED::flatten(buffer); 63 this->INHERITED::flatten(buffer);
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 inputBM.rowBytesAsPixels(), 641 inputBM.rowBytesAsPixels(),
619 &dst, height, srcBounds); 642 &dst, height, srcBounds);
620 } 643 }
621 offset->fX = bounds.left(); 644 offset->fX = bounds.left();
622 offset->fY = bounds.top(); 645 offset->fY = bounds.top();
623 646
624 return SkSpecialImage::MakeFromRaster(source->internal_getProxy(), 647 return SkSpecialImage::MakeFromRaster(source->internal_getProxy(),
625 SkIRect::MakeWH(bounds.width(), bounds .height()), 648 SkIRect::MakeWH(bounds.width(), bounds .height()),
626 dst, &source->props()); 649 dst, &source->props());
627 } 650 }
OLDNEW
« no previous file with comments | « src/effects/SkMergeImageFilter.cpp ('k') | src/effects/SkOffsetImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698