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

Side by Side Diff: tests/ImageFilterTest.cpp

Issue 1884253004: Revert of Update DisplacementMapEffect to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/SkDisplacementMapEffect.cpp ('k') | no next file » | 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 2013 Google Inc. 2 * Copyright 2013 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkBitmapDevice.h" 9 #include "SkBitmapDevice.h"
10 #include "SkBlurImageFilter.h" 10 #include "SkBlurImageFilter.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 153
154 this->addFilter("color filter", 154 this->addFilter("color filter",
155 SkColorFilterImageFilter::Make(std::move(cf), input, cropRect)); 155 SkColorFilterImageFilter::Make(std::move(cf), input, cropRect));
156 } 156 }
157 157
158 { 158 {
159 sk_sp<SkImage> gradientImage(SkImage::MakeFromBitmap(make_gradient_c ircle(64, 64))); 159 sk_sp<SkImage> gradientImage(SkImage::MakeFromBitmap(make_gradient_c ircle(64, 64)));
160 sk_sp<SkImageFilter> gradientSource(SkImageSource::Make(std::move(gr adientImage))); 160 sk_sp<SkImageFilter> gradientSource(SkImageSource::Make(std::move(gr adientImage)));
161 161
162 this->addFilter("displacement map", 162 this->addFilter("displacement map",
163 SkDisplacementMapEffect::Make(SkDisplacementMapEffect::kR_Channe lSelectorType, 163 sk_sp<SkImageFilter>(SkDisplacementMapEffect::Create(
164 SkDisplacementMapEffect::kB_Channe lSelectorType, 164 SkDisplacementMapEffect::kR_ChannelSelec torType,
165 20.0f, 165 SkDisplacementMapEffect::kB_ChannelSelec torType,
166 std::move(gradientSource), input, cropRect)); 166 20.0f, gradientSource.get(), input.get() , cropRect)));
167 } 167 }
168 168
169 this->addFilter("blur", SkBlurImageFilter::Make(SK_Scalar1, 169 this->addFilter("blur", SkBlurImageFilter::Make(SK_Scalar1,
170 SK_Scalar1, 170 SK_Scalar1,
171 input, 171 input,
172 cropRect)); 172 cropRect));
173 this->addFilter("drop shadow", SkDropShadowImageFilter::Make( 173 this->addFilter("drop shadow", SkDropShadowImageFilter::Make(
174 SK_Scalar1, SK_Scalar1, SK_Scalar1, SK_Scalar1, SK_ColorGREEN, 174 SK_Scalar1, SK_Scalar1, SK_Scalar1, SK_Scalar1, SK_ColorGREEN,
175 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, 175 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode,
176 input, cropRect)); 176 input, cropRect));
(...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after
1767 1767
1768 test_xfermode_cropped_input(&canvas, reporter); 1768 test_xfermode_cropped_input(&canvas, reporter);
1769 } 1769 }
1770 1770
1771 DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(ImageFilterBlurLargeImage_Gpu, reporter, ctxInfo ) { 1771 DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(ImageFilterBlurLargeImage_Gpu, reporter, ctxInfo ) {
1772 auto surface(SkSurface::MakeRenderTarget(ctxInfo.fGrContext, SkBudgeted::kYe s, 1772 auto surface(SkSurface::MakeRenderTarget(ctxInfo.fGrContext, SkBudgeted::kYe s,
1773 SkImageInfo::MakeN32Premul(100, 100 ))); 1773 SkImageInfo::MakeN32Premul(100, 100 )));
1774 test_large_blur_input(reporter, surface->getCanvas()); 1774 test_large_blur_input(reporter, surface->getCanvas());
1775 } 1775 }
1776 #endif 1776 #endif
OLDNEW
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698