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

Side by Side Diff: gm/imagefiltersgraph.cpp

Issue 1855733002: change flattenable factory to return 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 | « gm/imagefiltersbase.cpp ('k') | include/core/SkFlattenable.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 2012 Google Inc. 2 * Copyright 2012 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 9
10 #include "SkArithmeticMode.h" 10 #include "SkArithmeticMode.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 SimpleOffsetFilter(SkScalar dx, SkScalar dy, SkImageFilter* input) 77 SimpleOffsetFilter(SkScalar dx, SkScalar dy, SkImageFilter* input)
78 : SkImageFilter(1, &input), fDX(dx), fDY(dy) {} 78 : SkImageFilter(1, &input), fDX(dx), fDY(dy) {}
79 79
80 SkScalar fDX, fDY; 80 SkScalar fDX, fDY;
81 81
82 typedef SkImageFilter INHERITED; 82 typedef SkImageFilter INHERITED;
83 }; 83 };
84 84
85 static SimpleOffsetFilter::Registrar gReg; 85 static SimpleOffsetFilter::Registrar gReg;
86 86
87 SkFlattenable* SimpleOffsetFilter::CreateProc(SkReadBuffer& buffer) { 87 sk_sp<SkFlattenable> SimpleOffsetFilter::CreateProc(SkReadBuffer& buffer) {
88 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); 88 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
89 SkScalar dx = buffer.readScalar(); 89 SkScalar dx = buffer.readScalar();
90 SkScalar dy = buffer.readScalar(); 90 SkScalar dy = buffer.readScalar();
91 return Create(dx, dy, common.getInput(0).get()); 91 return sk_sp<SkFlattenable>(Create(dx, dy, common.getInput(0).get()));
92 } 92 }
93 93
94 #ifndef SK_IGNORE_TO_STRING 94 #ifndef SK_IGNORE_TO_STRING
95 void SimpleOffsetFilter::toString(SkString* str) const { 95 void SimpleOffsetFilter::toString(SkString* str) const {
96 str->appendf("SimpleOffsetFilter: ("); 96 str->appendf("SimpleOffsetFilter: (");
97 str->append(")"); 97 str->append(")");
98 } 98 }
99 #endif 99 #endif
100 100
101 class ImageFiltersGraphGM : public skiagm::GM { 101 class ImageFiltersGraphGM : public skiagm::GM {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 } 238 }
239 239
240 sk_sp<SkImage> fImage; 240 sk_sp<SkImage> fImage;
241 241
242 typedef GM INHERITED; 242 typedef GM INHERITED;
243 }; 243 };
244 244
245 /////////////////////////////////////////////////////////////////////////////// 245 ///////////////////////////////////////////////////////////////////////////////
246 246
247 DEF_GM(return new ImageFiltersGraphGM;) 247 DEF_GM(return new ImageFiltersGraphGM;)
OLDNEW
« no previous file with comments | « gm/imagefiltersbase.cpp ('k') | include/core/SkFlattenable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698