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

Side by Side Diff: gm/imagefiltersclipped.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/displacement.cpp ('k') | gm/imagefilterscropexpand.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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 resizeMatrix.setScale(RESIZE_FACTOR_X, RESIZE_FACTOR_Y); 93 resizeMatrix.setScale(RESIZE_FACTOR_X, RESIZE_FACTOR_Y);
94 SkPoint3 pointLocation = SkPoint3::Make(32, 32, SkIntToScalar(10)); 94 SkPoint3 pointLocation = SkPoint3::Make(32, 32, SkIntToScalar(10));
95 95
96 sk_sp<SkImageFilter> filters[] = { 96 sk_sp<SkImageFilter> filters[] = {
97 SkBlurImageFilter::Make(SkIntToScalar(12), SkIntToScalar(12), nullpt r), 97 SkBlurImageFilter::Make(SkIntToScalar(12), SkIntToScalar(12), nullpt r),
98 SkDropShadowImageFilter::Make( 98 SkDropShadowImageFilter::Make(
99 SkIntToScalar(10), SkIntToScalar(10), 99 SkIntToScalar(10), SkIntToScalar(10),
100 SkIntToScalar(3), SkIntToScalar(3), SK_Color GREEN, 100 SkIntToScalar(3), SkIntToScalar(3), SK_Color GREEN,
101 SkDropShadowImageFilter::kDrawShadowAndForeg round_ShadowMode, 101 SkDropShadowImageFilter::kDrawShadowAndForeg round_ShadowMode,
102 nullptr), 102 nullptr),
103 sk_sp<SkImageFilter>(SkDisplacementMapEffect::Create( 103 SkDisplacementMapEffect::Make(SkDisplacementMapEffect::kR_ChannelSel ectorType,
104 SkDisplacementMapEffect::kR_ChannelS electorType, 104 SkDisplacementMapEffect::kR_ChannelSel ectorType,
105 SkDisplacementMapEffect::kR_ChannelS electorType, 105 SkIntToScalar(12),
106 SkIntToScalar(12), 106 std::move(gradient),
107 gradient.get(), 107 checkerboard),
108 checkerboard.get())),
109 SkDilateImageFilter::Make(2, 2, checkerboard), 108 SkDilateImageFilter::Make(2, 2, checkerboard),
110 SkErodeImageFilter::Make(2, 2, checkerboard), 109 SkErodeImageFilter::Make(2, 2, checkerboard),
111 SkOffsetImageFilter::Make(SkIntToScalar(-16), SkIntToScalar(32), nul lptr), 110 SkOffsetImageFilter::Make(SkIntToScalar(-16), SkIntToScalar(32), nul lptr),
112 SkImageFilter::MakeMatrixFilter(resizeMatrix, kNone_SkFilterQuality, nullptr), 111 SkImageFilter::MakeMatrixFilter(resizeMatrix, kNone_SkFilterQuality, nullptr),
113 SkLightingImageFilter::MakePointLitDiffuse(pointLocation, SK_ColorWH ITE, SK_Scalar1, 112 SkLightingImageFilter::MakePointLitDiffuse(pointLocation, SK_ColorWH ITE, SK_Scalar1,
114 SkIntToScalar(2), checker board), 113 SkIntToScalar(2), checker board),
115 114
116 }; 115 };
117 116
118 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64)); 117 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64));
(...skipping 29 matching lines...) Expand all
148 private: 147 private:
149 sk_sp<SkImage> fCheckerboard, fGradientCircle; 148 sk_sp<SkImage> fCheckerboard, fGradientCircle;
150 149
151 typedef GM INHERITED; 150 typedef GM INHERITED;
152 }; 151 };
153 152
154 ////////////////////////////////////////////////////////////////////////////// 153 //////////////////////////////////////////////////////////////////////////////
155 154
156 DEF_GM(return new ImageFiltersClippedGM;) 155 DEF_GM(return new ImageFiltersClippedGM;)
157 } 156 }
OLDNEW
« no previous file with comments | « gm/displacement.cpp ('k') | gm/imagefilterscropexpand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698