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

Side by Side Diff: gm/offsetimagefilter.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 | « no previous file | gm/tileimagefilter.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 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 "SkImage.h" 9 #include "SkImage.h"
10 #include "SkImageSource.h" 10 #include "SkImageSource.h"
(...skipping 29 matching lines...) Expand all
40 sk_tool_utils::color_to_56 5(0xFFA0A0A0), 40 sk_tool_utils::color_to_56 5(0xFFA0A0A0),
41 sk_tool_utils::color_to_56 5(0xFF404040), 41 sk_tool_utils::color_to_56 5(0xFF404040),
42 8)); 42 8));
43 } 43 }
44 44
45 void onDraw(SkCanvas* canvas) override { 45 void onDraw(SkCanvas* canvas) override {
46 canvas->clear(SK_ColorBLACK); 46 canvas->clear(SK_ColorBLACK);
47 SkPaint paint; 47 SkPaint paint;
48 48
49 for (int i = 0; i < 4; i++) { 49 for (int i = 0; i < 4; i++) {
50 const SkImage* image = (i & 0x01) ? fCheckerboard.get() : fBitmap.ge t(); 50 SkImage* image = (i & 0x01) ? fCheckerboard.get() : fBitmap.get();
51 SkIRect cropRect = SkIRect::MakeXYWH(i * 12, 51 SkIRect cropRect = SkIRect::MakeXYWH(i * 12,
52 i * 8, 52 i * 8,
53 image->width() - i * 8, 53 image->width() - i * 8,
54 image->height() - i * 12); 54 image->height() - i * 12);
55 SkImageFilter::CropRect rect(SkRect::Make(cropRect)); 55 SkImageFilter::CropRect rect(SkRect::Make(cropRect));
56 SkAutoTUnref<SkImageFilter> tileInput(SkImageSource::Create(image)); 56 SkAutoTUnref<SkImageFilter> tileInput(SkImageSource::Create(image));
57 SkScalar dx = SkIntToScalar(i*5); 57 SkScalar dx = SkIntToScalar(i*5);
58 SkScalar dy = SkIntToScalar(i*10); 58 SkScalar dy = SkIntToScalar(i*10);
59 SkAutoTUnref<SkImageFilter> filter(SkOffsetImageFilter::Create(dx, d y, tileInput, 59 SkAutoTUnref<SkImageFilter> filter(SkOffsetImageFilter::Create(dx, d y, tileInput,
60 &rect )); 60 &rect ));
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 // crop==clip==dst 199 // crop==clip==dst
200 canvas->translate(100, 0); 200 canvas->translate(100, 0);
201 this->doDraw(canvas, r, SkOffsetImageFilter::Create(40, 0, nullptr, &cr2 ), &r2); 201 this->doDraw(canvas, r, SkOffsetImageFilter::Create(40, 0, nullptr, &cr2 ), &r2);
202 } 202 }
203 203
204 private: 204 private:
205 typedef skiagm::GM INHERITED; 205 typedef skiagm::GM INHERITED;
206 }; 206 };
207 DEF_GM( return new SimpleOffsetImageFilterGM; ) 207 DEF_GM( return new SimpleOffsetImageFilterGM; )
OLDNEW
« no previous file with comments | « no previous file | gm/tileimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698