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

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

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase 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/GrDefaultPathRenderer.cpp ('k') | src/gpu/GrDrawState.h » ('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 "GrDistanceFieldTextContext.h" 8 #include "GrDistanceFieldTextContext.h"
9 #include "GrAtlas.h" 9 #include "GrAtlas.h"
10 #include "SkColorFilter.h" 10 #include "SkColorFilter.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 GrDrawState::AutoRestoreEffects are(drawState); 181 GrDrawState::AutoRestoreEffects are(drawState);
182 drawState->setFromPaint(fPaint, fContext->getMatrix(), fContext->getRenderTa rget()); 182 drawState->setFromPaint(fPaint, fContext->getMatrix(), fContext->getRenderTa rget());
183 183
184 if (fCurrVertex > 0) { 184 if (fCurrVertex > 0) {
185 // setup our sampler state for our text texture/atlas 185 // setup our sampler state for our text texture/atlas
186 SkASSERT(SkIsAlign4(fCurrVertex)); 186 SkASSERT(SkIsAlign4(fCurrVertex));
187 187
188 // get our current color 188 // get our current color
189 SkColor filteredColor; 189 SkColor filteredColor;
190 SkColorFilter* colorFilter = fSkPaint.getColorFilter(); 190 SkColorFilter* colorFilter = fSkPaint.getColorFilter();
191 if (NULL != colorFilter) { 191 if (colorFilter) {
192 filteredColor = colorFilter->filterColor(fSkPaint.getColor()); 192 filteredColor = colorFilter->filterColor(fSkPaint.getColor());
193 } else { 193 } else {
194 filteredColor = fSkPaint.getColor(); 194 filteredColor = fSkPaint.getColor();
195 } 195 }
196 this->setupCoverageEffect(filteredColor); 196 this->setupCoverageEffect(filteredColor);
197 197
198 // Effects could be stored with one of the cache objects (atlas?) 198 // Effects could be stored with one of the cache objects (atlas?)
199 int coordsIdx = drawState->hasColorVertexAttribute() ? kGlyphCoordsWithC olorAttributeIndex : 199 int coordsIdx = drawState->hasColorVertexAttribute() ? kGlyphCoordsWithC olorAttributeIndex :
200 kGlyphCoordsNoCol orAttributeIndex; 200 kGlyphCoordsNoCol orAttributeIndex;
201 drawState->addCoverageEffect(fCachedEffect.get(), coordsIdx); 201 drawState->addCoverageEffect(fCachedEffect.get(), coordsIdx);
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 SkScalarToFixed(x) - (glyph.fAdvanceX >> a lignShift), 652 SkScalarToFixed(x) - (glyph.fAdvanceX >> a lignShift),
653 SkScalarToFixed(y) - (glyph.fAdvanceY >> a lignShift), 653 SkScalarToFixed(y) - (glyph.fAdvanceY >> a lignShift),
654 fontScaler); 654 fontScaler);
655 } 655 }
656 pos += scalarsPerPosition; 656 pos += scalarsPerPosition;
657 } 657 }
658 } 658 }
659 659
660 this->finish(); 660 this->finish();
661 } 661 }
OLDNEW
« no previous file with comments | « src/gpu/GrDefaultPathRenderer.cpp ('k') | src/gpu/GrDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698