OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "effects/GrCustomXfermode.h" | 8 #include "effects/GrCustomXfermode.h" |
9 | 9 |
10 #include "GrCoordTransform.h" | 10 #include "GrCoordTransform.h" |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 return !can_use_hw_blend_equation(fHWBlendEquation, optimizations, caps); | 375 return !can_use_hw_blend_equation(fHWBlendEquation, optimizations, caps); |
376 } | 376 } |
377 | 377 |
378 void CustomXPFactory::getInvariantBlendedColor(const GrProcOptInfo& colorPOI, | 378 void CustomXPFactory::getInvariantBlendedColor(const GrProcOptInfo& colorPOI, |
379 InvariantBlendedColor* blendedCol
or) const { | 379 InvariantBlendedColor* blendedCol
or) const { |
380 blendedColor->fWillBlendWithDst = true; | 380 blendedColor->fWillBlendWithDst = true; |
381 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags; | 381 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags; |
382 } | 382 } |
383 | 383 |
384 GR_DEFINE_XP_FACTORY_TEST(CustomXPFactory); | 384 GR_DEFINE_XP_FACTORY_TEST(CustomXPFactory); |
385 const GrXPFactory* CustomXPFactory::TestCreate(GrProcessorTestData* d) { | 385 sk_sp<GrXPFactory> CustomXPFactory::TestCreate(GrProcessorTestData* d) { |
386 int mode = d->fRandom->nextRangeU(SkXfermode::kLastCoeffMode + 1, | 386 int mode = d->fRandom->nextRangeU(SkXfermode::kLastCoeffMode + 1, |
387 SkXfermode::kLastSeparableMode); | 387 SkXfermode::kLastSeparableMode); |
388 | 388 |
389 return new CustomXPFactory(static_cast<SkXfermode::Mode>(mode)); | 389 return sk_sp<GrXPFactory>(new CustomXPFactory(static_cast<SkXfermode::Mode>(
mode))); |
390 } | 390 } |
391 | 391 |
392 /////////////////////////////////////////////////////////////////////////////// | 392 /////////////////////////////////////////////////////////////////////////////// |
393 | 393 |
394 GrXPFactory* GrCustomXfermode::CreateXPFactory(SkXfermode::Mode mode) { | 394 sk_sp<GrXPFactory> GrCustomXfermode::MakeXPFactory(SkXfermode::Mode mode) { |
395 if (!GrCustomXfermode::IsSupportedMode(mode)) { | 395 if (!GrCustomXfermode::IsSupportedMode(mode)) { |
396 return nullptr; | 396 return nullptr; |
397 } else { | 397 } else { |
398 return new CustomXPFactory(mode); | 398 return sk_sp<GrXPFactory>(new CustomXPFactory(mode)); |
399 } | 399 } |
400 } | 400 } |
OLD | NEW |