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

Side by Side Diff: gm/imagefiltersscaled.cpp

Issue 1877783003: Update DisplacementMapEffect to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix bug 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 | « gm/imagefilterscropexpand.cpp ('k') | gm/imagefilterstransformed.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 2014 Google Inc. 2 * Copyright 2014 Google Inc.
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 "sk_tool_utils.h" 8 #include "sk_tool_utils.h"
9 #include "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkColor.h" 10 #include "SkColor.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 SkMatrix resizeMatrix; 91 SkMatrix resizeMatrix;
92 resizeMatrix.setScale(RESIZE_FACTOR, RESIZE_FACTOR); 92 resizeMatrix.setScale(RESIZE_FACTOR, RESIZE_FACTOR);
93 93
94 sk_sp<SkImageFilter> filters[] = { 94 sk_sp<SkImageFilter> filters[] = {
95 SkBlurImageFilter::Make(SkIntToScalar(4), SkIntToScalar(4), nullptr) , 95 SkBlurImageFilter::Make(SkIntToScalar(4), SkIntToScalar(4), nullptr) ,
96 SkDropShadowImageFilter::Make( 96 SkDropShadowImageFilter::Make(
97 SkIntToScalar(5), SkIntToScalar(10), 97 SkIntToScalar(5), SkIntToScalar(10),
98 SkIntToScalar(3), SkIntToScalar(3), SK_Color YELLOW, 98 SkIntToScalar(3), SkIntToScalar(3), SK_Color YELLOW,
99 SkDropShadowImageFilter::kDrawShadowAndForeg round_ShadowMode, 99 SkDropShadowImageFilter::kDrawShadowAndForeg round_ShadowMode,
100 nullptr), 100 nullptr),
101 sk_sp<SkImageFilter>(SkDisplacementMapEffect::Create( 101 SkDisplacementMapEffect::Make(SkDisplacementMapEffect::kR_ChannelSel ectorType,
102 SkDisplacementMapEffect::kR_ChannelS electorType, 102 SkDisplacementMapEffect::kR_ChannelSel ectorType,
103 SkDisplacementMapEffect::kR_ChannelS electorType, 103 SkIntToScalar(12),
104 SkIntToScalar(12), 104 std::move(gradient),
105 gradient.get(), 105 checkerboard),
106 checkerboard.get())),
107 SkDilateImageFilter::Make(1, 1, checkerboard), 106 SkDilateImageFilter::Make(1, 1, checkerboard),
108 SkErodeImageFilter::Make(1, 1, checkerboard), 107 SkErodeImageFilter::Make(1, 1, checkerboard),
109 SkOffsetImageFilter::Make(SkIntToScalar(32), 0, nullptr), 108 SkOffsetImageFilter::Make(SkIntToScalar(32), 0, nullptr),
110 SkImageFilter::MakeMatrixFilter(resizeMatrix, kNone_SkFilterQuality, nullptr), 109 SkImageFilter::MakeMatrixFilter(resizeMatrix, kNone_SkFilterQuality, nullptr),
111 SkPaintImageFilter::Make(noisePaint), 110 SkPaintImageFilter::Make(noisePaint),
112 SkLightingImageFilter::MakePointLitDiffuse(pointLocation, white, sur faceScale, kd, 111 SkLightingImageFilter::MakePointLitDiffuse(pointLocation, white, sur faceScale, kd,
113 nullptr), 112 nullptr),
114 SkLightingImageFilter::MakeSpotLitDiffuse(spotLocation, spotTarget, spotExponent, 113 SkLightingImageFilter::MakeSpotLitDiffuse(spotLocation, spotTarget, spotExponent,
115 cutoffAngle, white, surfac eScale, kd, 114 cutoffAngle, white, surfac eScale, kd,
116 nullptr), 115 nullptr),
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 private: 156 private:
158 sk_sp<SkImage> fCheckerboard, fGradientCircle; 157 sk_sp<SkImage> fCheckerboard, fGradientCircle;
159 158
160 typedef GM INHERITED; 159 typedef GM INHERITED;
161 }; 160 };
162 161
163 ////////////////////////////////////////////////////////////////////////////// 162 //////////////////////////////////////////////////////////////////////////////
164 163
165 DEF_GM(return new ImageFiltersScaledGM;) 164 DEF_GM(return new ImageFiltersScaledGM;)
166 } 165 }
OLDNEW
« no previous file with comments | « gm/imagefilterscropexpand.cpp ('k') | gm/imagefilterstransformed.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698