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

Side by Side Diff: gm/tileimagefilter.cpp

Issue 1812023002: Switch SkSpecialImage & SkSpecialSurface classes over to smart pointers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix build Created 4 years, 9 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/offsetimagefilter.cpp ('k') | include/effects/SkImageSource.h » ('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 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 "sk_tool_utils.h" 8 #include "sk_tool_utils.h"
9 #include "SkColorFilterImageFilter.h" 9 #include "SkColorFilterImageFilter.h"
10 #include "SkColorMatrixFilter.h" 10 #include "SkColorMatrixFilter.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 canvas->clear(SK_ColorBLACK); 49 canvas->clear(SK_ColorBLACK);
50 SkPaint red; 50 SkPaint red;
51 red.setColor(SK_ColorRED); 51 red.setColor(SK_ColorRED);
52 red.setStyle(SkPaint::kStroke_Style); 52 red.setStyle(SkPaint::kStroke_Style);
53 SkPaint blue; 53 SkPaint blue;
54 blue.setColor(SK_ColorBLUE); 54 blue.setColor(SK_ColorBLUE);
55 blue.setStyle(SkPaint::kStroke_Style); 55 blue.setStyle(SkPaint::kStroke_Style);
56 56
57 int x = 0, y = 0; 57 int x = 0, y = 0;
58 for (size_t i = 0; i < 4; i++) { 58 for (size_t i = 0; i < 4; i++) {
59 const SkImage* image = (i & 0x01) ? fCheckerboard.get() : fBitmap.ge t(); 59 SkImage* image = (i & 0x01) ? fCheckerboard.get() : fBitmap.get();
60 SkRect srcRect = SkRect::MakeXYWH(SkIntToScalar(image->width()/4), 60 SkRect srcRect = SkRect::MakeXYWH(SkIntToScalar(image->width()/4),
61 SkIntToScalar(image->height()/4), 61 SkIntToScalar(image->height()/4),
62 SkIntToScalar(image->width()/(i+1) ), 62 SkIntToScalar(image->width()/(i+1) ),
63 SkIntToScalar(image->height()/(i+1 ))); 63 SkIntToScalar(image->height()/(i+1 )));
64 SkRect dstRect = SkRect::MakeXYWH(SkIntToScalar(i * 8), 64 SkRect dstRect = SkRect::MakeXYWH(SkIntToScalar(i * 8),
65 SkIntToScalar(i * 4), 65 SkIntToScalar(i * 4),
66 SkIntToScalar(image->width() - i * 12), 66 SkIntToScalar(image->width() - i * 12),
67 SkIntToScalar(image->height()) - i * 12); 67 SkIntToScalar(image->height()) - i * 12);
68 SkAutoTUnref<SkImageFilter> tileInput(SkImageSource::Create(image)); 68 SkAutoTUnref<SkImageFilter> tileInput(SkImageSource::Create(image));
69 SkAutoTUnref<SkImageFilter> filter( 69 SkAutoTUnref<SkImageFilter> filter(
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 private: 111 private:
112 sk_sp<SkImage> fBitmap, fCheckerboard; 112 sk_sp<SkImage> fBitmap, fCheckerboard;
113 113
114 typedef GM INHERITED; 114 typedef GM INHERITED;
115 }; 115 };
116 116
117 ////////////////////////////////////////////////////////////////////////////// 117 //////////////////////////////////////////////////////////////////////////////
118 118
119 DEF_GM(return new TileImageFilterGM;) 119 DEF_GM(return new TileImageFilterGM;)
120 } 120 }
OLDNEW
« no previous file with comments | « gm/offsetimagefilter.cpp ('k') | include/effects/SkImageSource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698