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

Side by Side Diff: src/effects/SkTestImageFilters.cpp

Issue 1864583005: Update DownSampleImageFilter 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 | « samplecode/SampleFilterFuzz.cpp ('k') | no next file » | 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 2011 Google Inc. 2 * Copyright 2011 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 "SkTestImageFilters.h" 8 #include "SkTestImageFilters.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 canvas->scale(SkScalarInvert(fScale), SkScalarInvert(fScale)); 76 canvas->scale(SkScalarInvert(fScale), SkScalarInvert(fScale));
77 tmp->draw(canvas, 0, 0, &paint); 77 tmp->draw(canvas, 0, 0, &paint);
78 78
79 return surf->makeImageSnapshot(); 79 return surf->makeImageSnapshot();
80 } 80 }
81 } 81 }
82 82
83 sk_sp<SkFlattenable> SkDownSampleImageFilter::CreateProc(SkReadBuffer& buffer) { 83 sk_sp<SkFlattenable> SkDownSampleImageFilter::CreateProc(SkReadBuffer& buffer) {
84 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); 84 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
85 return sk_sp<SkFlattenable>(Create(buffer.readScalar(), common.getInput(0).g et())); 85 return Make(buffer.readScalar(), common.getInput(0));
86 } 86 }
87 87
88 void SkDownSampleImageFilter::flatten(SkWriteBuffer& buffer) const { 88 void SkDownSampleImageFilter::flatten(SkWriteBuffer& buffer) const {
89 this->INHERITED::flatten(buffer); 89 this->INHERITED::flatten(buffer);
90 buffer.writeScalar(fScale); 90 buffer.writeScalar(fScale);
91 } 91 }
92 92
93 #ifndef SK_IGNORE_TO_STRING 93 #ifndef SK_IGNORE_TO_STRING
94 void SkDownSampleImageFilter::toString(SkString* str) const { 94 void SkDownSampleImageFilter::toString(SkString* str) const {
95 str->appendf("SkDownSampleImageFilter: ("); 95 str->appendf("SkDownSampleImageFilter: (");
96 str->append(")"); 96 str->append(")");
97 } 97 }
98 #endif 98 #endif
OLDNEW
« no previous file with comments | « samplecode/SampleFilterFuzz.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698