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

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

Issue 1847583002: Update SkMergeImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to To 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 | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/effects/SkTestImageFilters.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 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
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 "SkOffsetImageFilter.h" 8 #include "SkOffsetImageFilter.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 vec.negate(); 79 vec.negate();
80 } 80 }
81 81
82 return src.makeOffset(SkScalarCeilToInt(vec.fX), SkScalarCeilToInt(vec.fY)); 82 return src.makeOffset(SkScalarCeilToInt(vec.fX), SkScalarCeilToInt(vec.fY));
83 } 83 }
84 84
85 SkFlattenable* SkOffsetImageFilter::CreateProc(SkReadBuffer& buffer) { 85 SkFlattenable* SkOffsetImageFilter::CreateProc(SkReadBuffer& buffer) {
86 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); 86 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
87 SkPoint offset; 87 SkPoint offset;
88 buffer.readPoint(&offset); 88 buffer.readPoint(&offset);
89 return Create(offset.x(), offset.y(), common.getInput(0), &common.cropRect() ); 89 return Create(offset.x(), offset.y(), common.getInput(0).get(), &common.crop Rect());
90 } 90 }
91 91
92 void SkOffsetImageFilter::flatten(SkWriteBuffer& buffer) const { 92 void SkOffsetImageFilter::flatten(SkWriteBuffer& buffer) const {
93 this->INHERITED::flatten(buffer); 93 this->INHERITED::flatten(buffer);
94 buffer.writePoint(fOffset); 94 buffer.writePoint(fOffset);
95 } 95 }
96 96
97 SkOffsetImageFilter::SkOffsetImageFilter(SkScalar dx, SkScalar dy, SkImageFilter * input, 97 SkOffsetImageFilter::SkOffsetImageFilter(SkScalar dx, SkScalar dy, SkImageFilter * input,
98 const CropRect* cropRect) 98 const CropRect* cropRect)
99 : INHERITED(1, &input, cropRect) { 99 : INHERITED(1, &input, cropRect) {
100 fOffset.set(dx, dy); 100 fOffset.set(dx, dy);
101 } 101 }
102 102
103 #ifndef SK_IGNORE_TO_STRING 103 #ifndef SK_IGNORE_TO_STRING
104 void SkOffsetImageFilter::toString(SkString* str) const { 104 void SkOffsetImageFilter::toString(SkString* str) const {
105 str->appendf("SkOffsetImageFilter: ("); 105 str->appendf("SkOffsetImageFilter: (");
106 str->appendf("offset: (%f, %f) ", fOffset.fX, fOffset.fY); 106 str->appendf("offset: (%f, %f) ", fOffset.fX, fOffset.fY);
107 str->append("input: ("); 107 str->append("input: (");
108 if (this->getInput(0)) { 108 if (this->getInput(0)) {
109 this->getInput(0)->toString(str); 109 this->getInput(0)->toString(str);
110 } 110 }
111 str->append("))"); 111 str->append("))");
112 } 112 }
113 #endif 113 #endif
OLDNEW
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/effects/SkTestImageFilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698