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 "GrDistanceFieldTextContext.h" | 8 #include "GrDistanceFieldTextContext.h" |
9 #include "GrAtlas.h" | 9 #include "GrAtlas.h" |
10 #include "GrBitmapTextContext.h" | 10 #include "GrBitmapTextContext.h" |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 return true; | 661 return true; |
662 } | 662 } |
663 | 663 |
664 void GrDistanceFieldTextContext::flush() { | 664 void GrDistanceFieldTextContext::flush() { |
665 if (NULL == fDrawTarget) { | 665 if (NULL == fDrawTarget) { |
666 return; | 666 return; |
667 } | 667 } |
668 | 668 |
669 if (fCurrVertex > 0) { | 669 if (fCurrVertex > 0) { |
670 GrPipelineBuilder pipelineBuilder; | 670 GrPipelineBuilder pipelineBuilder; |
671 pipelineBuilder.setFromPaint(fPaint, fRenderTarget); | 671 pipelineBuilder.setFromPaint(fPaint, fRenderTarget, fClip); |
672 | 672 |
673 // setup our sampler state for our text texture/atlas | 673 // setup our sampler state for our text texture/atlas |
674 SkASSERT(SkIsAlign4(fCurrVertex)); | 674 SkASSERT(SkIsAlign4(fCurrVertex)); |
675 | 675 |
676 // get our current color | 676 // get our current color |
677 SkColor filteredColor; | 677 SkColor filteredColor; |
678 SkColorFilter* colorFilter = fSkPaint.getColorFilter(); | 678 SkColorFilter* colorFilter = fSkPaint.getColorFilter(); |
679 if (colorFilter) { | 679 if (colorFilter) { |
680 filteredColor = colorFilter->filterColor(fSkPaint.getColor()); | 680 filteredColor = colorFilter->filterColor(fSkPaint.getColor()); |
681 } else { | 681 } else { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 } | 715 } |
716 } | 716 } |
717 | 717 |
718 inline void GrDistanceFieldTextContext::finish() { | 718 inline void GrDistanceFieldTextContext::finish() { |
719 this->flush(); | 719 this->flush(); |
720 fTotalVertexCount = 0; | 720 fTotalVertexCount = 0; |
721 | 721 |
722 GrTextContext::finish(); | 722 GrTextContext::finish(); |
723 } | 723 } |
724 | 724 |
OLD | NEW |