OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #ifndef GrXferProcessor_DEFINED | 8 #ifndef GrXferProcessor_DEFINED |
9 #define GrXferProcessor_DEFINED | 9 #define GrXferProcessor_DEFINED |
10 | 10 |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 const DstTexture*, | 356 const DstTexture*, |
357 const GrCaps& caps) const; | 357 const GrCaps& caps) const; |
358 | 358 |
359 /** | 359 /** |
360 * This function returns true if the GrXferProcessor generated from this fac
tory will be able to | 360 * This function returns true if the GrXferProcessor generated from this fac
tory will be able to |
361 * correctly blend when using RGB coverage. The knownColor and knownColorFla
gs represent the | 361 * correctly blend when using RGB coverage. The knownColor and knownColorFla
gs represent the |
362 * final computed color from the color stages. | 362 * final computed color from the color stages. |
363 */ | 363 */ |
364 virtual bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlag
s) const = 0; | 364 virtual bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlag
s) const = 0; |
365 | 365 |
366 struct InvariantOutput { | 366 /** |
367 bool fWillBlendWithDst; | 367 * Known color information after blending, but before accounting for any cov
erage. |
368 GrColor fBlendedColor; | 368 */ |
369 uint32_t fBlendedColorFlags; | 369 struct InvariantBlendedColor { |
| 370 bool fWillBlendWithDst; |
| 371 GrColor fKnownColor; |
| 372 GrColorComponentFlags fKnownColorFlags; |
370 }; | 373 }; |
371 | 374 |
372 /** | 375 /** |
373 * This function returns known information about the output of the xfer proc
essor produced by | 376 * Returns information about the output color, produced by XPs from this fac
tory, that will be |
374 * this xp factory. The invariant color information returned by this functio
n refers to the | 377 * known after blending. Note that we can conflate coverage and color, so th
e actual values |
375 * final color produced after all blending. | 378 * written to pixels with partial coverage may not always seem consistent wi
th the invariant |
| 379 * information returned by this function. |
376 */ | 380 */ |
377 virtual void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcO
ptInfo& coveragePOI, | 381 virtual void getInvariantBlendedColor(const GrProcOptInfo& colorPOI, |
378 InvariantOutput*) const = 0; | 382 InvariantBlendedColor*) const = 0; |
379 | 383 |
380 bool willNeedDstTexture(const GrCaps& caps, const GrProcOptInfo& colorPOI, | 384 bool willNeedDstTexture(const GrCaps& caps, const GrProcOptInfo& colorPOI, |
381 const GrProcOptInfo& coveragePOI) const; | 385 const GrProcOptInfo& coveragePOI) const; |
382 | 386 |
383 bool isEqual(const GrXPFactory& that) const { | 387 bool isEqual(const GrXPFactory& that) const { |
384 if (this->classID() != that.classID()) { | 388 if (this->classID() != that.classID()) { |
385 return false; | 389 return false; |
386 } | 390 } |
387 return this->onIsEqual(that); | 391 return this->onIsEqual(that); |
388 } | 392 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 enum { | 438 enum { |
435 kIllegalXPFClassID = 0, | 439 kIllegalXPFClassID = 0, |
436 }; | 440 }; |
437 static int32_t gCurrXPFClassID; | 441 static int32_t gCurrXPFClassID; |
438 | 442 |
439 typedef GrProgramElement INHERITED; | 443 typedef GrProgramElement INHERITED; |
440 }; | 444 }; |
441 | 445 |
442 #endif | 446 #endif |
443 | 447 |
OLD | NEW |