OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "GrBitmapTextContext.h" | 8 #include "GrBitmapTextContext.h" |
9 #include "GrAtlas.h" | 9 #include "GrAtlas.h" |
10 #include "GrDefaultGeoProcFactory.h" | 10 #include "GrDefaultGeoProcFactory.h" |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 } | 579 } |
580 break; | 580 break; |
581 } | 581 } |
582 // Grayscale/BW text | 582 // Grayscale/BW text |
583 case kA8_GrMaskFormat: | 583 case kA8_GrMaskFormat: |
584 break; | 584 break; |
585 default: | 585 default: |
586 SkFAIL("Unexpected mask format."); | 586 SkFAIL("Unexpected mask format."); |
587 } | 587 } |
588 | 588 |
589 GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kNon
e_FilterMode); | 589 GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kNone
_FilterMode); |
590 uint32_t textureUniqueID = fCurrTexture->getUniqueID(); | 590 uint32_t textureUniqueID = fCurrTexture->getUniqueID(); |
591 if (textureUniqueID != fEffectTextureUniqueID || | 591 if (textureUniqueID != fEffectTextureUniqueID || |
592 fCachedGeometryProcessor->color() != color || | 592 fCachedGeometryProcessor->color() != color || |
593 !fCachedGeometryProcessor->localMatrix().cheapEqualTo(fLocalMatrix))
{ | 593 !fCachedGeometryProcessor->localMatrix().cheapEqualTo(fLocalMatrix))
{ |
594 // This will be ignored in the non A8 case | 594 // This will be ignored in the non A8 case |
595 bool opaqueVertexColors = GrColorIsOpaque(fPaint.getColor()); | 595 bool opaqueVertexColors = GrColorIsOpaque(fPaint.getColor()); |
596 fCachedGeometryProcessor.reset(GrBitmapTextGeoProc::Create(color, | 596 fCachedGeometryProcessor.reset(GrBitmapTextGeoProc::Create(color, |
597 fCurrText
ure, | 597 fCurrText
ure, |
598 params, | 598 params, |
599 fCurrMask
Format, | 599 fCurrMask
Format, |
(...skipping 23 matching lines...) Expand all Loading... |
623 } | 623 } |
624 } | 624 } |
625 | 625 |
626 inline void GrBitmapTextContext::finish() { | 626 inline void GrBitmapTextContext::finish() { |
627 this->flush(); | 627 this->flush(); |
628 fTotalVertexCount = 0; | 628 fTotalVertexCount = 0; |
629 | 629 |
630 GrTextContext::finish(); | 630 GrTextContext::finish(); |
631 } | 631 } |
632 | 632 |
OLD | NEW |