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

Side by Side Diff: gm/filterfastbounds.cpp

Issue 1842243002: Update SkImageSource to sk_sp (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 | « gm/displacement.cpp ('k') | gm/imagefiltersclipped.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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 SkPaint p; 270 SkPaint p;
271 SkCanvas* temp = surface->getCanvas(); 271 SkCanvas* temp = surface->getCanvas();
272 temp->clear(SK_ColorYELLOW); 272 temp->clear(SK_ColorYELLOW);
273 p.setColor(SK_ColorBLUE); 273 p.setColor(SK_ColorBLUE);
274 temp->drawRect(SkRect::MakeLTRB(5, 5, 10, 10), p); 274 temp->drawRect(SkRect::MakeLTRB(5, 5, 10, 10), p);
275 p.setColor(SK_ColorGREEN); 275 p.setColor(SK_ColorGREEN);
276 temp->drawRect(SkRect::MakeLTRB(5, 0, 10, 5), p); 276 temp->drawRect(SkRect::MakeLTRB(5, 0, 10, 5), p);
277 } 277 }
278 278
279 sk_sp<SkImage> image(surface->makeImageSnapshot()); 279 sk_sp<SkImage> image(surface->makeImageSnapshot());
280 SkAutoTUnref<SkImageFilter> imageSource(SkImageSource::Create(image.get( ))); 280 sk_sp<SkImageFilter> imageSource(SkImageSource::Make(std::move(image)));
281 281
282 SkTArray<SkPaint> bmsPaints; 282 SkTArray<SkPaint> bmsPaints;
283 create_paints(imageSource, &bmsPaints); 283 create_paints(imageSource.get(), &bmsPaints);
284 284
285 //----------- 285 //-----------
286 SkASSERT(paints.count() == kNumVertTiles); 286 SkASSERT(paints.count() == kNumVertTiles);
287 SkASSERT(paints.count() == pifPaints.count()); 287 SkASSERT(paints.count() == pifPaints.count());
288 SkASSERT(paints.count() == bmsPaints.count()); 288 SkASSERT(paints.count() == bmsPaints.count());
289 289
290 // horizontal separators 290 // horizontal separators
291 for (int i = 1; i < paints.count(); ++i) { 291 for (int i = 1; i < paints.count(); ++i) {
292 canvas->drawLine(0, 292 canvas->drawLine(0,
293 i*SkIntToScalar(kTileHeight), 293 i*SkIntToScalar(kTileHeight),
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 } 328 }
329 329
330 private: 330 private:
331 typedef GM INHERITED; 331 typedef GM INHERITED;
332 }; 332 };
333 333
334 ////////////////////////////////////////////////////////////////////////////// 334 //////////////////////////////////////////////////////////////////////////////
335 335
336 DEF_GM(return new ImageFilterFastBoundGM;) 336 DEF_GM(return new ImageFilterFastBoundGM;)
337 } 337 }
OLDNEW
« no previous file with comments | « gm/displacement.cpp ('k') | gm/imagefiltersclipped.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698