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

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: last 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
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 uint32_t textureUniqueID = fCurrTexture->getUniqueID(); 101 uint32_t textureUniqueID = fCurrTexture->getUniqueID();
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->addCoverageEffect(fCachedEffect.get(), coordsIdx); 111 drawState->setGeometryProcessor(fCachedEffect.get(), coordsIdx);
112 SkASSERT(NULL != fStrike); 112 SkASSERT(NULL != 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:
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698