Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: src/gpu/GrBitmapTextContext.cpp

Issue 509153002: Initial change to create GeometryProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixing mac compiler warning Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 uint32_t textureUniqueID = currTexture->getUniqueID(); 98 uint32_t textureUniqueID = currTexture->getUniqueID();
99 99
100 if (textureUniqueID != fEffectTextureUniqueID) { 100 if (textureUniqueID != fEffectTextureUniqueID) {
101 fCachedEffect.reset(GrCustomCoordsTextureEffect::Create(currTexture, params)); 101 fCachedEffect.reset(GrCustomCoordsTextureEffect::Create(currTexture, params));
102 fEffectTextureUniqueID = textureUniqueID; 102 fEffectTextureUniqueID = textureUniqueID;
103 } 103 }
104 104
105 // This effect could be stored with one of the cache objects (atlas?) 105 // This effect could be stored with one of the cache objects (atlas?)
106 int coordsIdx = drawState->hasColorVertexAttribute() ? kGlyphCoordsWithC olorAttributeIndex : 106 int coordsIdx = drawState->hasColorVertexAttribute() ? kGlyphCoordsWithC olorAttributeIndex :
107 kGlyphCoordsNoCol orAttributeIndex; 107 kGlyphCoordsNoCol orAttributeIndex;
108 drawState->addCoverageEffect(fCachedEffect.get(), coordsIdx); 108 drawState->setGeometryProcessor(fCachedEffect.get(), coordsIdx);
109 SkASSERT(NULL != fStrike); 109 SkASSERT(NULL != fStrike);
110 switch (fStrike->getMaskFormat()) { 110 switch (fStrike->getMaskFormat()) {
111 // Color bitmap text 111 // Color bitmap text
112 case kARGB_GrMaskFormat: 112 case kARGB_GrMaskFormat:
113 SkASSERT(!drawState->hasColorVertexAttribute()); 113 SkASSERT(!drawState->hasColorVertexAttribute());
114 drawState->setBlendFunc(fPaint.getSrcBlendCoeff(), fPaint.getDst BlendCoeff()); 114 drawState->setBlendFunc(fPaint.getSrcBlendCoeff(), fPaint.getDst BlendCoeff());
115 drawState->setColor(0xffffffff); 115 drawState->setColor(0xffffffff);
116 break; 116 break;
117 // LCD text 117 // LCD text
118 case kA888_GrMaskFormat: 118 case kA888_GrMaskFormat:
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 } 585 }
586 // color comes after position. 586 // color comes after position.
587 GrColor* colors = reinterpret_cast<GrColor*>(positions + 1); 587 GrColor* colors = reinterpret_cast<GrColor*>(positions + 1);
588 for (int i = 0; i < 4; ++i) { 588 for (int i = 0; i < 4; ++i) {
589 *colors = fPaint.getColor(); 589 *colors = fPaint.getColor();
590 colors = reinterpret_cast<GrColor*>(reinterpret_cast<intptr_t>(colors ) + vertSize); 590 colors = reinterpret_cast<GrColor*>(reinterpret_cast<intptr_t>(colors ) + vertSize);
591 } 591 }
592 } 592 }
593 fCurrVertex += 4; 593 fCurrVertex += 4;
594 } 594 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698