| 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 "GrAtlasTextBatch.h" | 8 #include "GrAtlasTextBatch.h" |
| 9 | 9 |
| 10 #include "GrBatchFontCache.h" | 10 #include "GrBatchFontCache.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 fGeoData[i].fColor, | 36 fGeoData[i].fColor, |
| 37 fGeoData[i].fTransX, | 37 fGeoData[i].fTransX, |
| 38 fGeoData[i].fTransY, | 38 fGeoData[i].fTransY, |
| 39 fGeoData[i].fBlob->fRunCount); | 39 fGeoData[i].fBlob->fRunCount); |
| 40 } | 40 } |
| 41 | 41 |
| 42 str.append(INHERITED::dumpInfo()); | 42 str.append(INHERITED::dumpInfo()); |
| 43 return str; | 43 return str; |
| 44 } | 44 } |
| 45 | 45 |
| 46 void GrAtlasTextBatch::getInvariantOutputColor(GrInitInvariantOutput* out) const
{ | 46 void GrAtlasTextBatch::computeBatchToXPOverrides(GrInitInvariantOutput* color, |
| 47 GrInitInvariantOutput* coverage
, |
| 48 bool* usePLSDstRead) const { |
| 47 if (kColorBitmapMask_MaskType == fMaskType) { | 49 if (kColorBitmapMask_MaskType == fMaskType) { |
| 48 out->setUnknownFourComponents(); | 50 color->setUnknownFourComponents(); |
| 49 } else { | 51 } else { |
| 50 out->setKnownFourComponents(fBatch.fColor); | 52 color->setKnownFourComponents(fBatch.fColor); |
| 53 } |
| 54 switch (fMaskType) { |
| 55 case kGrayscaleDistanceField_MaskType: |
| 56 case kGrayscaleCoverageMask_MaskType: |
| 57 coverage->setUnknownSingleComponent(); |
| 58 break; |
| 59 case kLCDCoverageMask_MaskType: |
| 60 case kLCDDistanceField_MaskType: |
| 61 coverage->setUnknownOpaqueFourComponents(); |
| 62 coverage->setUsingLCDCoverage(); |
| 63 break; |
| 64 case kColorBitmapMask_MaskType: |
| 65 coverage->setKnownSingleComponent(0xff); |
| 51 } | 66 } |
| 52 } | 67 } |
| 53 | 68 |
| 54 void GrAtlasTextBatch::getInvariantOutputCoverage(GrInitInvariantOutput* out) co
nst { | |
| 55 switch (fMaskType) { | |
| 56 case kGrayscaleDistanceField_MaskType: | |
| 57 case kGrayscaleCoverageMask_MaskType: | |
| 58 out->setUnknownSingleComponent(); | |
| 59 break; | |
| 60 case kLCDCoverageMask_MaskType: | |
| 61 case kLCDDistanceField_MaskType: | |
| 62 out->setUnknownOpaqueFourComponents(); | |
| 63 out->setUsingLCDCoverage(); | |
| 64 break; | |
| 65 case kColorBitmapMask_MaskType: | |
| 66 out->setKnownSingleComponent(0xff); | |
| 67 } | |
| 68 } | |
| 69 | |
| 70 void GrAtlasTextBatch::initBatchTracker(const GrPipelineOptimizations& opt) { | 69 void GrAtlasTextBatch::initBatchTracker(const GrPipelineOptimizations& opt) { |
| 71 // Handle any color overrides | 70 // Handle any color overrides |
| 72 if (!opt.readsColor()) { | 71 if (!opt.readsColor()) { |
| 73 fGeoData[0].fColor = GrColor_ILLEGAL; | 72 fGeoData[0].fColor = GrColor_ILLEGAL; |
| 74 } | 73 } |
| 75 opt.getOverrideColorIfSet(&fGeoData[0].fColor); | 74 opt.getOverrideColorIfSet(&fGeoData[0].fColor); |
| 76 | 75 |
| 77 // setup batch properties | 76 // setup batch properties |
| 78 fBatch.fColorIgnored = !opt.readsColor(); | 77 fBatch.fColorIgnored = !opt.readsColor(); |
| 79 fBatch.fColor = fGeoData[0].fColor; | 78 fBatch.fColor = fGeoData[0].fColor; |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 return GrDistanceFieldA8TextGeoProc::Create(color, | 497 return GrDistanceFieldA8TextGeoProc::Create(color, |
| 499 viewMatrix, | 498 viewMatrix, |
| 500 texture, | 499 texture, |
| 501 params, | 500 params, |
| 502 flags, | 501 flags, |
| 503 this->usesLocalCoords()); | 502 this->usesLocalCoords()); |
| 504 #endif | 503 #endif |
| 505 } | 504 } |
| 506 | 505 |
| 507 } | 506 } |
| OLD | NEW |