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

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

Issue 751283002: Add XferProcessor factory in GrPaint and GrDrawState. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update gyp Created 6 years 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 "GrDistanceFieldTextContext.h" 8 #include "GrDistanceFieldTextContext.h"
9 #include "GrAtlas.h" 9 #include "GrAtlas.h"
10 #include "GrBitmapTextContext.h" 10 #include "GrBitmapTextContext.h"
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 filteredColor = fSkPaint.getColor(); 653 filteredColor = fSkPaint.getColor();
654 } 654 }
655 this->setupCoverageEffect(filteredColor); 655 this->setupCoverageEffect(filteredColor);
656 656
657 // Effects could be stored with one of the cache objects (atlas?) 657 // Effects could be stored with one of the cache objects (atlas?)
658 drawState.setGeometryProcessor(fCachedGeometryProcessor.get()); 658 drawState.setGeometryProcessor(fCachedGeometryProcessor.get());
659 659
660 // Set draw state 660 // Set draw state
661 if (fUseLCDText) { 661 if (fUseLCDText) {
662 GrColor colorNoPreMul = skcolor_to_grcolor_nopremultiply(filteredCol or); 662 GrColor colorNoPreMul = skcolor_to_grcolor_nopremultiply(filteredCol or);
663 if (kOne_GrBlendCoeff != fPaint.getSrcBlendCoeff() || 663 SkASSERT(drawState.hasXPFactory());
664 kISA_GrBlendCoeff != fPaint.getDstBlendCoeff() || 664 if (!drawState.getXPFactory()->supportsLCDText(drawState)) {
665 fPaint.numColorStages()) {
666 SkDebugf("LCD Text will not draw correctly.\n"); 665 SkDebugf("LCD Text will not draw correctly.\n");
667 } 666 }
668 SkASSERT(!drawState.hasColorVertexAttribute()); 667 SkASSERT(!drawState.hasColorVertexAttribute());
669 // We don't use the GrPaint's color in this case because it's been p remultiplied by 668 // We don't use the GrPaint's color in this case because it's been p remultiplied by
670 // alpha. Instead we feed in a non-premultiplied color, and multiply its alpha by 669 // alpha. Instead we feed in a non-premultiplied color, and multiply its alpha by
671 // the mask texture color. The end result is that we get 670 // the mask texture color. The end result is that we get
672 // mask*paintAlpha*paintColor + (1-mask*paintAlpha)*dstCo lor 671 // mask*paintAlpha*paintColor + (1-mask*paintAlpha)*dstCo lor
673 int a = SkColorGetA(fSkPaint.getColor()); 672 int a = SkColorGetA(fSkPaint.getColor());
674 // paintAlpha 673 // paintAlpha
675 drawState.setColor(SkColorSetARGB(a, a, a, a)); 674 drawState.setColor(SkColorSetARGB(a, a, a, a));
(...skipping 26 matching lines...) Expand all
702 } 701 }
703 } 702 }
704 703
705 inline void GrDistanceFieldTextContext::finish() { 704 inline void GrDistanceFieldTextContext::finish() {
706 this->flush(); 705 this->flush();
707 fTotalVertexCount = 0; 706 fTotalVertexCount = 0;
708 707
709 GrTextContext::finish(); 708 GrTextContext::finish();
710 } 709 }
711 710
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698