| 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 if (this->hasHWBlendEquation()) { | 314 if (this->hasHWBlendEquation()) { |
| 315 blendInfo->fEquation = this->hwBlendEquation(); | 315 blendInfo->fEquation = this->hwBlendEquation(); |
| 316 } | 316 } |
| 317 } | 317 } |
| 318 | 318 |
| 319 /////////////////////////////////////////////////////////////////////////////// | 319 /////////////////////////////////////////////////////////////////////////////// |
| 320 class CustomXPFactory : public GrXPFactory { | 320 class CustomXPFactory : public GrXPFactory { |
| 321 public: | 321 public: |
| 322 CustomXPFactory(SkXfermode::Mode mode); | 322 CustomXPFactory(SkXfermode::Mode mode); |
| 323 | 323 |
| 324 bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const
override { | |
| 325 return true; | |
| 326 } | |
| 327 | |
| 328 void getInvariantBlendedColor(const GrProcOptInfo& colorPOI, | 324 void getInvariantBlendedColor(const GrProcOptInfo& colorPOI, |
| 329 GrXPFactory::InvariantBlendedColor*) const ove
rride; | 325 GrXPFactory::InvariantBlendedColor*) const ove
rride; |
| 330 | 326 |
| 331 private: | 327 private: |
| 332 GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, | 328 GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, |
| 333 const GrProcOptInfo& colorPOI, | 329 const GrProcOptInfo& colorPOI, |
| 334 const GrProcOptInfo& coveragePOI, | 330 const GrProcOptInfo& coveragePOI, |
| 335 bool hasMixedSamples, | 331 bool hasMixedSamples, |
| 336 const DstTexture*) const override; | 332 const DstTexture*) const override; |
| 337 | 333 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 | 391 |
| 396 /////////////////////////////////////////////////////////////////////////////// | 392 /////////////////////////////////////////////////////////////////////////////// |
| 397 | 393 |
| 398 GrXPFactory* GrCustomXfermode::CreateXPFactory(SkXfermode::Mode mode) { | 394 GrXPFactory* GrCustomXfermode::CreateXPFactory(SkXfermode::Mode mode) { |
| 399 if (!GrCustomXfermode::IsSupportedMode(mode)) { | 395 if (!GrCustomXfermode::IsSupportedMode(mode)) { |
| 400 return nullptr; | 396 return nullptr; |
| 401 } else { | 397 } else { |
| 402 return new CustomXPFactory(mode); | 398 return new CustomXPFactory(mode); |
| 403 } | 399 } |
| 404 } | 400 } |
| OLD | NEW |