Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: include/gpu/GrXferProcessor.h

Issue 1161273005: Update XPF invariant info to not account for conflation (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_reenablebea
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 const GrProcOptInfo& coveragePOI,
egdaniel 2015/06/02 14:19:41 Do we need coveragePOI to be in here anymore?
Chris Dalton 2015/06/02 17:07:12 Done.
383 InvariantBlendedColor*) const = 0;
379 384
380 bool willNeedDstTexture(const GrCaps& caps, const GrProcOptInfo& colorPOI, 385 bool willNeedDstTexture(const GrCaps& caps, const GrProcOptInfo& colorPOI,
381 const GrProcOptInfo& coveragePOI) const; 386 const GrProcOptInfo& coveragePOI) const;
382 387
383 bool isEqual(const GrXPFactory& that) const { 388 bool isEqual(const GrXPFactory& that) const {
384 if (this->classID() != that.classID()) { 389 if (this->classID() != that.classID()) {
385 return false; 390 return false;
386 } 391 }
387 return this->onIsEqual(that); 392 return this->onIsEqual(that);
388 } 393 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 enum { 439 enum {
435 kIllegalXPFClassID = 0, 440 kIllegalXPFClassID = 0,
436 }; 441 };
437 static int32_t gCurrXPFClassID; 442 static int32_t gCurrXPFClassID;
438 443
439 typedef GrProgramElement INHERITED; 444 typedef GrProgramElement INHERITED;
440 }; 445 };
441 446
442 #endif 447 #endif
443 448
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698