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

Side by Side Diff: gm/filterfastbounds.cpp

Issue 1858353002: Update SkMatrixImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix fuzz 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 | « fuzz/FilterFuzz.cpp ('k') | gm/imagefilters.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 "gm.h" 8 #include "gm.h"
9 #include "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkDropShadowImageFilter.h" 10 #include "SkDropShadowImageFilter.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 SkASSERT(p.canComputeFastBounds()); 88 SkASSERT(p.canComputeFastBounds());
89 } 89 }
90 90
91 // Create a selection of imagefilter-based paints to test 91 // Create a selection of imagefilter-based paints to test
92 static void create_paints(SkTArray<SkPaint>* paints, sk_sp<SkImageFilter> source ) { 92 static void create_paints(SkTArray<SkPaint>* paints, sk_sp<SkImageFilter> source ) {
93 { 93 {
94 SkMatrix scale; 94 SkMatrix scale;
95 scale.setScale(2.0f, 2.0f); 95 scale.setScale(2.0f, 2.0f);
96 96
97 sk_sp<SkImageFilter> scaleMIF( 97 sk_sp<SkImageFilter> scaleMIF(
98 SkImageFilter::CreateMatrixFilter(scale, kLow_SkFilterQuality, sourc e.get())); 98 SkImageFilter::MakeMatrixFilter(scale, kLow_SkFilterQuality, source) );
99 99
100 add_paint(paints, std::move(scaleMIF)); 100 add_paint(paints, std::move(scaleMIF));
101 } 101 }
102 102
103 { 103 {
104 SkMatrix rot; 104 SkMatrix rot;
105 rot.setRotate(-33.3f); 105 rot.setRotate(-33.3f);
106 106
107 sk_sp<SkImageFilter> rotMIF( 107 sk_sp<SkImageFilter> rotMIF(
108 SkImageFilter::CreateMatrixFilter(rot, kLow_SkFilterQuality, source. get())); 108 SkImageFilter::MakeMatrixFilter(rot, kLow_SkFilterQuality, source));
109 109
110 add_paint(paints, std::move(rotMIF)); 110 add_paint(paints, std::move(rotMIF));
111 } 111 }
112 112
113 { 113 {
114 SkRect src = SkRect::MakeXYWH(20, 20, 10, 10); 114 SkRect src = SkRect::MakeXYWH(20, 20, 10, 10);
115 SkRect dst = SkRect::MakeXYWH(30, 30, 30, 30); 115 SkRect dst = SkRect::MakeXYWH(30, 30, 30, 30);
116 sk_sp<SkImageFilter> tileIF(SkTileImageFilter::Create(src, dst, nullptr) ); 116 sk_sp<SkImageFilter> tileIF(SkTileImageFilter::Create(src, dst, nullptr) );
117 117
118 add_paint(paints, std::move(tileIF)); 118 add_paint(paints, std::move(tileIF));
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 } 314 }
315 315
316 private: 316 private:
317 typedef GM INHERITED; 317 typedef GM INHERITED;
318 }; 318 };
319 319
320 ////////////////////////////////////////////////////////////////////////////// 320 //////////////////////////////////////////////////////////////////////////////
321 321
322 DEF_GM(return new ImageFilterFastBoundGM;) 322 DEF_GM(return new ImageFilterFastBoundGM;)
323 } 323 }
OLDNEW
« no previous file with comments | « fuzz/FilterFuzz.cpp ('k') | gm/imagefilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698