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 "SkDrawExtraPathEffect.h" | 8 #include "SkDrawExtraPathEffect.h" |
9 #include "SkDrawPath.h" | 9 #include "SkDrawPath.h" |
10 #include "Sk1DPathEffect.h" | 10 #include "Sk1DPathEffect.h" |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 372 |
373 bool SkDrawComposePathEffect::addChild(SkAnimateMaker& , SkDisplayable* child) { | 373 bool SkDrawComposePathEffect::addChild(SkAnimateMaker& , SkDisplayable* child) { |
374 if (effect1 == nullptr) | 374 if (effect1 == nullptr) |
375 effect1 = (SkDrawPathEffect*) child; | 375 effect1 = (SkDrawPathEffect*) child; |
376 else | 376 else |
377 effect2 = (SkDrawPathEffect*) child; | 377 effect2 = (SkDrawPathEffect*) child; |
378 return true; | 378 return true; |
379 } | 379 } |
380 | 380 |
381 SkPathEffect* SkDrawComposePathEffect::getPathEffect() { | 381 SkPathEffect* SkDrawComposePathEffect::getPathEffect() { |
382 SkPathEffect* e1 = effect1->getPathEffect(); | 382 auto e1 = sk_sp<SkPathEffect>(effect1->getPathEffect()); |
383 SkPathEffect* e2 = effect2->getPathEffect(); | 383 auto e2 = sk_sp<SkPathEffect>(effect2->getPathEffect()); |
384 SkPathEffect* composite = SkComposePathEffect::Create(e1, e2); | 384 return SkComposePathEffect::Make(e1, e2).release(); |
385 e1->unref(); | |
386 e2->unref(); | |
387 return composite; | |
388 } | 385 } |
389 | 386 |
390 bool SkDrawComposePathEffect::isPaint() const { | 387 bool SkDrawComposePathEffect::isPaint() const { |
391 return true; | 388 return true; |
392 } | 389 } |
393 | 390 |
394 //////////// SkDrawCornerPathEffect | 391 //////////// SkDrawCornerPathEffect |
395 | 392 |
396 #if SK_USE_CONDENSED_INFO == 0 | 393 #if SK_USE_CONDENSED_INFO == 0 |
397 | 394 |
398 const SkMemberInfo SkDrawCornerPathEffect::fInfo[] = { | 395 const SkMemberInfo SkDrawCornerPathEffect::fInfo[] = { |
399 SK_MEMBER(radius, Float) | 396 SK_MEMBER(radius, Float) |
400 }; | 397 }; |
401 | 398 |
402 #endif | 399 #endif |
403 | 400 |
404 DEFINE_GET_MEMBER(SkDrawCornerPathEffect); | 401 DEFINE_GET_MEMBER(SkDrawCornerPathEffect); |
405 | 402 |
406 SkDrawCornerPathEffect::SkDrawCornerPathEffect(SkDisplayTypes type): | 403 SkDrawCornerPathEffect::SkDrawCornerPathEffect(SkDisplayTypes type): |
407 fType(type), radius(0) { | 404 fType(type), radius(0) { |
408 } | 405 } |
409 | 406 |
410 SkDrawCornerPathEffect::~SkDrawCornerPathEffect() { | 407 SkDrawCornerPathEffect::~SkDrawCornerPathEffect() { |
411 } | 408 } |
412 | 409 |
413 SkPathEffect* SkDrawCornerPathEffect::getPathEffect() { | 410 SkPathEffect* SkDrawCornerPathEffect::getPathEffect() { |
414 return SkCornerPathEffect::Create(radius); | 411 return SkCornerPathEffect::Make(radius).release(); |
415 } | 412 } |
416 | 413 |
417 ///////// | 414 ///////// |
418 | 415 |
419 #include "SkExtras.h" | 416 #include "SkExtras.h" |
420 | 417 |
421 const char kDrawShape1DPathEffectName[] = "pathEffect:shape1D"; | 418 const char kDrawShape1DPathEffectName[] = "pathEffect:shape1D"; |
422 const char kDrawShape2DPathEffectName[] = "pathEffect:shape2D"; | 419 const char kDrawShape2DPathEffectName[] = "pathEffect:shape2D"; |
423 const char kDrawComposePathEffectName[] = "pathEffect:compose"; | 420 const char kDrawComposePathEffectName[] = "pathEffect:compose"; |
424 const char kDrawCornerPathEffectName[] = "pathEffect:corner"; | 421 const char kDrawCornerPathEffectName[] = "pathEffect:corner"; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 | 513 |
517 void InitializeSkExtraPathEffects(SkAnimator* animator) { | 514 void InitializeSkExtraPathEffects(SkAnimator* animator) { |
518 animator->addExtras(new SkExtraPathEffects()); | 515 animator->addExtras(new SkExtraPathEffects()); |
519 } | 516 } |
520 | 517 |
521 //////////////// | 518 //////////////// |
522 | 519 |
523 | 520 |
524 SkExtras::SkExtras() : fExtraCallBack(nullptr), fExtraStorage(nullptr) { | 521 SkExtras::SkExtras() : fExtraCallBack(nullptr), fExtraStorage(nullptr) { |
525 } | 522 } |
OLD | NEW |