OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 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 "SkAtomics.h" | 8 #include "SkAtomics.h" |
9 #include "SkBitmapProcShader.h" | 9 #include "SkBitmapProcShader.h" |
10 #include "SkColorShader.h" | 10 #include "SkColorShader.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 #include "SkUtils.h" | 257 #include "SkUtils.h" |
258 | 258 |
259 SkColorShader::SkColorShader(SkColor c) | 259 SkColorShader::SkColorShader(SkColor c) |
260 : fColor(c) { | 260 : fColor(c) { |
261 } | 261 } |
262 | 262 |
263 bool SkColorShader::isOpaque() const { | 263 bool SkColorShader::isOpaque() const { |
264 return SkColorGetA(fColor) == 255; | 264 return SkColorGetA(fColor) == 255; |
265 } | 265 } |
266 | 266 |
267 SkFlattenable* SkColorShader::CreateProc(SkReadBuffer& buffer) { | 267 sk_sp<SkFlattenable> SkColorShader::CreateProc(SkReadBuffer& buffer) { |
268 return new SkColorShader(buffer.readColor()); | 268 return sk_make_sp<SkColorShader>(buffer.readColor()); |
269 } | 269 } |
270 | 270 |
271 void SkColorShader::flatten(SkWriteBuffer& buffer) const { | 271 void SkColorShader::flatten(SkWriteBuffer& buffer) const { |
272 buffer.writeColor(fColor); | 272 buffer.writeColor(fColor); |
273 } | 273 } |
274 | 274 |
275 uint32_t SkColorShader::ColorShaderContext::getFlags() const { | 275 uint32_t SkColorShader::ColorShaderContext::getFlags() const { |
276 return fFlags; | 276 return fFlags; |
277 } | 277 } |
278 | 278 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 state->fBlitBW = D64_BlitBW; | 412 state->fBlitBW = D64_BlitBW; |
413 state->fBlitAA = D64_BlitAA; | 413 state->fBlitAA = D64_BlitAA; |
414 return true; | 414 return true; |
415 default: | 415 default: |
416 return false; | 416 return false; |
417 } | 417 } |
418 } | 418 } |
419 | 419 |
420 /////////////////////////////////////////////////////////////////////////////// | 420 /////////////////////////////////////////////////////////////////////////////// |
421 | 421 |
422 SkFlattenable* SkEmptyShader::CreateProc(SkReadBuffer&) { | 422 sk_sp<SkFlattenable> SkEmptyShader::CreateProc(SkReadBuffer&) { |
423 return SkShader::MakeEmptyShader().release(); | 423 return SkShader::MakeEmptyShader(); |
424 } | 424 } |
425 | 425 |
426 #ifndef SK_IGNORE_TO_STRING | 426 #ifndef SK_IGNORE_TO_STRING |
427 #include "SkEmptyShader.h" | 427 #include "SkEmptyShader.h" |
428 | 428 |
429 void SkEmptyShader::toString(SkString* str) const { | 429 void SkEmptyShader::toString(SkString* str) const { |
430 str->append("SkEmptyShader: ("); | 430 str->append("SkEmptyShader: ("); |
431 | 431 |
432 this->INHERITED::toString(str); | 432 this->INHERITED::toString(str); |
433 | 433 |
(...skipping 20 matching lines...) Expand all Loading... |
454 } | 454 } |
455 #endif | 455 #endif |
456 | 456 |
457 #ifdef SK_SUPPORT_LEGACY_XFERMODE_PTR | 457 #ifdef SK_SUPPORT_LEGACY_XFERMODE_PTR |
458 #include "SkXfermode.h" | 458 #include "SkXfermode.h" |
459 sk_sp<SkShader> SkShader::MakeComposeShader(sk_sp<SkShader> dst, sk_sp<SkShader>
src, | 459 sk_sp<SkShader> SkShader::MakeComposeShader(sk_sp<SkShader> dst, sk_sp<SkShader>
src, |
460 SkXfermode* xfer) { | 460 SkXfermode* xfer) { |
461 return MakeComposeShader(std::move(dst), std::move(src), sk_ref_sp(xfer)); | 461 return MakeComposeShader(std::move(dst), std::move(src), sk_ref_sp(xfer)); |
462 } | 462 } |
463 #endif | 463 #endif |
OLD | NEW |