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

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

Issue 740463002: fix for use of uninit variable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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/GrBitmapTextContext.cpp ('k') | no next file » | 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 "GrBitmapTextContext.h" 10 #include "GrBitmapTextContext.h"
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 drawState->setVertexAttribs<gTextVertexAttribs>( 628 drawState->setVertexAttribs<gTextVertexAttribs>(
629 SK_ARRAY_COUNT(gTextVertexAttribs), kTextVAS ize); 629 SK_ARRAY_COUNT(gTextVertexAttribs), kTextVAS ize);
630 } 630 }
631 } 631 }
632 632
633 void GrDistanceFieldTextContext::flush() { 633 void GrDistanceFieldTextContext::flush() {
634 if (NULL == fDrawTarget) { 634 if (NULL == fDrawTarget) {
635 return; 635 return;
636 } 636 }
637 637
638 GrDrawState drawState; 638 if (fCurrVertex > 0) {
639 drawState.setFromPaint(fPaint, fContext->getMatrix(), fContext->getRenderTar get()); 639 GrDrawState drawState;
640 bool useColorVerts = !fUseLCDText; 640 drawState.setFromPaint(fPaint, fContext->getMatrix(), fContext->getRende rTarget());
tfarina 2014/11/18 17:35:31 is fContext NULL if fCurrVertex is < 0? Otherwise
641 set_vertex_attributes(&drawState, useColorVerts); 641 bool useColorVerts = !fUseLCDText;
642 set_vertex_attributes(&drawState, useColorVerts);
642 643
643 if (fCurrVertex > 0) {
644 // setup our sampler state for our text texture/atlas 644 // setup our sampler state for our text texture/atlas
645 SkASSERT(SkIsAlign4(fCurrVertex)); 645 SkASSERT(SkIsAlign4(fCurrVertex));
646 646
647 // get our current color 647 // get our current color
648 SkColor filteredColor; 648 SkColor filteredColor;
649 SkColorFilter* colorFilter = fSkPaint.getColorFilter(); 649 SkColorFilter* colorFilter = fSkPaint.getColorFilter();
650 if (colorFilter) { 650 if (colorFilter) {
651 filteredColor = colorFilter->filterColor(fSkPaint.getColor()); 651 filteredColor = colorFilter->filterColor(fSkPaint.getColor());
652 } else { 652 } else {
653 filteredColor = fSkPaint.getColor(); 653 filteredColor = fSkPaint.getColor();
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 } 702 }
703 } 703 }
704 704
705 inline void GrDistanceFieldTextContext::finish() { 705 inline void GrDistanceFieldTextContext::finish() {
706 this->flush(); 706 this->flush();
707 fTotalVertexCount = 0; 707 fTotalVertexCount = 0;
708 708
709 GrTextContext::finish(); 709 GrTextContext::finish();
710 } 710 }
711 711
OLDNEW
« no previous file with comments | « src/gpu/GrBitmapTextContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698