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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 if (textureUniqueID != fEffectTextureUniqueID) { | 103 if (textureUniqueID != fEffectTextureUniqueID) { |
104 fCachedEffect.reset(GrCustomCoordsTextureEffect::Create(fCurrTexture
, params)); | 104 fCachedEffect.reset(GrCustomCoordsTextureEffect::Create(fCurrTexture
, params)); |
105 fEffectTextureUniqueID = textureUniqueID; | 105 fEffectTextureUniqueID = textureUniqueID; |
106 } | 106 } |
107 | 107 |
108 // This effect could be stored with one of the cache objects (atlas?) | 108 // This effect could be stored with one of the cache objects (atlas?) |
109 int coordsIdx = drawState->hasColorVertexAttribute() ? kGlyphCoordsWithC
olorAttributeIndex : | 109 int coordsIdx = drawState->hasColorVertexAttribute() ? kGlyphCoordsWithC
olorAttributeIndex : |
110 kGlyphCoordsNoCol
orAttributeIndex; | 110 kGlyphCoordsNoCol
orAttributeIndex; |
111 drawState->setGeometryProcessor(fCachedEffect.get(), coordsIdx); | 111 drawState->setGeometryProcessor(fCachedEffect.get(), coordsIdx); |
112 SkASSERT(NULL != fStrike); | 112 SkASSERT(fStrike); |
113 switch (fStrike->getMaskFormat()) { | 113 switch (fStrike->getMaskFormat()) { |
114 // Color bitmap text | 114 // Color bitmap text |
115 case kARGB_GrMaskFormat: | 115 case kARGB_GrMaskFormat: |
116 SkASSERT(!drawState->hasColorVertexAttribute()); | 116 SkASSERT(!drawState->hasColorVertexAttribute()); |
117 drawState->setBlendFunc(fPaint.getSrcBlendCoeff(), fPaint.getDst
BlendCoeff()); | 117 drawState->setBlendFunc(fPaint.getSrcBlendCoeff(), fPaint.getDst
BlendCoeff()); |
118 drawState->setColor(0xffffffff); | 118 drawState->setColor(0xffffffff); |
119 break; | 119 break; |
120 // LCD text | 120 // LCD text |
121 case kA888_GrMaskFormat: | 121 case kA888_GrMaskFormat: |
122 case kA565_GrMaskFormat: { | 122 case kA565_GrMaskFormat: { |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 } | 601 } |
602 // color comes after position. | 602 // color comes after position. |
603 GrColor* colors = reinterpret_cast<GrColor*>(positions + 1); | 603 GrColor* colors = reinterpret_cast<GrColor*>(positions + 1); |
604 for (int i = 0; i < 4; ++i) { | 604 for (int i = 0; i < 4; ++i) { |
605 *colors = fPaint.getColor(); | 605 *colors = fPaint.getColor(); |
606 colors = reinterpret_cast<GrColor*>(reinterpret_cast<intptr_t>(colors
) + vertSize); | 606 colors = reinterpret_cast<GrColor*>(reinterpret_cast<intptr_t>(colors
) + vertSize); |
607 } | 607 } |
608 } | 608 } |
609 fCurrVertex += 4; | 609 fCurrVertex += 4; |
610 } | 610 } |
OLD | NEW |