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 "GrDrawTarget.h" | 10 #include "GrDrawTarget.h" |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 | 585 |
586 SkASSERT(fStrike); | 586 SkASSERT(fStrike); |
587 switch (fCurrMaskFormat) { | 587 switch (fCurrMaskFormat) { |
588 // Color bitmap text | 588 // Color bitmap text |
589 case kARGB_GrMaskFormat: | 589 case kARGB_GrMaskFormat: |
590 SkASSERT(!drawState->hasColorVertexAttribute()); | 590 SkASSERT(!drawState->hasColorVertexAttribute()); |
591 drawState->setBlendFunc(fPaint.getSrcBlendCoeff(), fPaint.getDst
BlendCoeff()); | 591 drawState->setBlendFunc(fPaint.getSrcBlendCoeff(), fPaint.getDst
BlendCoeff()); |
592 drawState->setAlpha(fSkPaint.getAlpha()); | 592 drawState->setAlpha(fSkPaint.getAlpha()); |
593 break; | 593 break; |
594 // LCD text | 594 // LCD text |
595 case kA888_GrMaskFormat: | |
596 case kA565_GrMaskFormat: { | 595 case kA565_GrMaskFormat: { |
597 if (kOne_GrBlendCoeff != fPaint.getSrcBlendCoeff() || | 596 if (kOne_GrBlendCoeff != fPaint.getSrcBlendCoeff() || |
598 kISA_GrBlendCoeff != fPaint.getDstBlendCoeff() || | 597 kISA_GrBlendCoeff != fPaint.getDstBlendCoeff() || |
599 fPaint.numColorStages()) { | 598 fPaint.numColorStages()) { |
600 SkDebugf("LCD Text will not draw correctly.\n"); | 599 SkDebugf("LCD Text will not draw correctly.\n"); |
601 } | 600 } |
602 SkASSERT(!drawState->hasColorVertexAttribute()); | 601 SkASSERT(!drawState->hasColorVertexAttribute()); |
603 // We don't use the GrPaint's color in this case because it's be
en premultiplied by | 602 // We don't use the GrPaint's color in this case because it's be
en premultiplied by |
604 // alpha. Instead we feed in a non-premultiplied color, and mult
iply its alpha by | 603 // alpha. Instead we feed in a non-premultiplied color, and mult
iply its alpha by |
605 // the mask texture color. The end result is that we get | 604 // the mask texture color. The end result is that we get |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 } | 638 } |
640 } | 639 } |
641 | 640 |
642 inline void GrBitmapTextContext::finish() { | 641 inline void GrBitmapTextContext::finish() { |
643 this->flush(); | 642 this->flush(); |
644 fTotalVertexCount = 0; | 643 fTotalVertexCount = 0; |
645 | 644 |
646 GrTextContext::finish(); | 645 GrTextContext::finish(); |
647 } | 646 } |
648 | 647 |
OLD | NEW |