OLD | NEW |
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 "SkColorFilterShader.h" | 8 #include "SkColorFilterShader.h" |
9 #include "SkReadBuffer.h" | 9 #include "SkReadBuffer.h" |
10 #include "SkWriteBuffer.h" | 10 #include "SkWriteBuffer.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // TODO: add "fFilter->toString(str);" once SkColorFilter::toString is added | 130 // TODO: add "fFilter->toString(str);" once SkColorFilter::toString is added |
131 | 131 |
132 this->INHERITED::toString(str); | 132 this->INHERITED::toString(str); |
133 | 133 |
134 str->append(")"); | 134 str->append(")"); |
135 } | 135 } |
136 #endif | 136 #endif |
137 | 137 |
138 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 138 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
139 | 139 |
140 SkShader* SkShader::newWithColorFilter(SkColorFilter* filter) const { | 140 sk_sp<SkShader> SkShader::makeWithColorFilter(SkColorFilter* filter) const { |
141 SkShader* base = const_cast<SkShader*>(this); | 141 SkShader* base = const_cast<SkShader*>(this); |
142 if (!filter) { | 142 if (!filter) { |
143 return SkRef(base); | 143 return sk_ref_sp(base); |
144 } | 144 } |
145 return new SkColorFilterShader(base, filter); | 145 return sk_make_sp<SkColorFilterShader>(base, filter); |
146 } | 146 } |
OLD | NEW |