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

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: Fix comiple bug 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
« no previous file with comments | « src/gpu/GrBitmapTextContext.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 "GrBitmapTextContext.h" 10 #include "GrBitmapTextContext.h"
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 filteredColor = fSkPaint.getColor(); 624 filteredColor = fSkPaint.getColor();
625 } 625 }
626 this->setupCoverageEffect(filteredColor); 626 this->setupCoverageEffect(filteredColor);
627 627
628 // Effects could be stored with one of the cache objects (atlas?) 628 // Effects could be stored with one of the cache objects (atlas?)
629 drawState.setGeometryProcessor(fCachedGeometryProcessor.get()); 629 drawState.setGeometryProcessor(fCachedGeometryProcessor.get());
630 630
631 // Set draw state 631 // Set draw state
632 if (fUseLCDText) { 632 if (fUseLCDText) {
633 GrColor colorNoPreMul = skcolor_to_grcolor_nopremultiply(filteredCol or); 633 GrColor colorNoPreMul = skcolor_to_grcolor_nopremultiply(filteredCol or);
634 if (kOne_GrBlendCoeff != fPaint.getSrcBlendCoeff() || 634
635 kISA_GrBlendCoeff != fPaint.getDstBlendCoeff() || 635 // TODO: move supportsRGBCoverage check to setupCoverageEffect and o nly add LCD
636 fPaint.numColorStages()) { 636 // processor if the xp can support it. For now we will simply assume that if
637 // fUseLCDText is true, then we have a known color output.
638 if (!drawState.getXPFactory()->supportsRGBCoverage(0, kRGBA_GrColorC omponentFlags)) {
637 SkDebugf("LCD Text will not draw correctly.\n"); 639 SkDebugf("LCD Text will not draw correctly.\n");
638 } 640 }
639 SkASSERT(!drawState.hasColorVertexAttribute()); 641 SkASSERT(!drawState.hasColorVertexAttribute());
640 // We don't use the GrPaint's color in this case because it's been p remultiplied by 642 // We don't use the GrPaint's color in this case because it's been p remultiplied by
641 // alpha. Instead we feed in a non-premultiplied color, and multiply its alpha by 643 // alpha. Instead we feed in a non-premultiplied color, and multiply its alpha by
642 // the mask texture color. The end result is that we get 644 // the mask texture color. The end result is that we get
643 // mask*paintAlpha*paintColor + (1-mask*paintAlpha)*dstCo lor 645 // mask*paintAlpha*paintColor + (1-mask*paintAlpha)*dstCo lor
644 int a = SkColorGetA(fSkPaint.getColor()); 646 int a = SkColorGetA(fSkPaint.getColor());
645 // paintAlpha 647 // paintAlpha
646 drawState.setColor(SkColorSetARGB(a, a, a, a)); 648 drawState.setColor(SkColorSetARGB(a, a, a, a));
(...skipping 26 matching lines...) Expand all
673 } 675 }
674 } 676 }
675 677
676 inline void GrDistanceFieldTextContext::finish() { 678 inline void GrDistanceFieldTextContext::finish() {
677 this->flush(); 679 this->flush();
678 fTotalVertexCount = 0; 680 fTotalVertexCount = 0;
679 681
680 GrTextContext::finish(); 682 GrTextContext::finish();
681 } 683 }
682 684
OLDNEW
« no previous file with comments | « src/gpu/GrBitmapTextContext.cpp ('k') | src/gpu/GrDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698