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

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

Issue 423943003: Remove gpu support for willUseHWAALines. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Nits Created 6 years, 4 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/GrDrawTarget.h ('k') | src/gpu/gl/GrGpuGL.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 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 10
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 if (this->caps()->gpuTracingSupport()) { 606 if (this->caps()->gpuTracingSupport()) {
607 SkASSERT(fGpuTraceMarkerCount >= 1); 607 SkASSERT(fGpuTraceMarkerCount >= 1);
608 this->fActiveTraceMarkers.remove(*marker); 608 this->fActiveTraceMarkers.remove(*marker);
609 this->didRemoveGpuTraceMarker(); 609 this->didRemoveGpuTraceMarker();
610 --fGpuTraceMarkerCount; 610 --fGpuTraceMarkerCount;
611 } 611 }
612 } 612 }
613 613
614 //////////////////////////////////////////////////////////////////////////////// 614 ////////////////////////////////////////////////////////////////////////////////
615 615
616 bool GrDrawTarget::willUseHWAALines() const {
617 // There is a conflict between using smooth lines and our use of premultipli ed alpha. Smooth
618 // lines tweak the incoming alpha value but not in a premul-alpha way. So we only use them when
619 // our alpha is 0xff and tweaking the color for partial coverage is OK
620 if (!this->caps()->hwAALineSupport() ||
621 !this->getDrawState().isHWAntialiasState()) {
622 return false;
623 }
624 GrDrawState::BlendOptFlags opts = this->getDrawState().getBlendOpts();
625 return (GrDrawState::kDisableBlend_BlendOptFlag & opts) &&
626 (GrDrawState::kCoverageAsAlpha_BlendOptFlag & opts);
627 }
628
629 bool GrDrawTarget::canApplyCoverage() const { 616 bool GrDrawTarget::canApplyCoverage() const {
630 // we can correctly apply coverage if a) we have dual source blending 617 // we can correctly apply coverage if a) we have dual source blending
631 // or b) one of our blend optimizations applies. 618 // or b) one of our blend optimizations applies
619 // or c) the src/dst coefficients are 1, 0 respectively.
620 GrBlendCoeff srcCoeff;
621 GrBlendCoeff dstCoeff;
632 return this->caps()->dualSourceBlendingSupport() || 622 return this->caps()->dualSourceBlendingSupport() ||
633 GrDrawState::kNone_BlendOpt != this->getDrawState().getBlendOpts(true ); 623 GrDrawState::kNone_BlendOpt != this->getDrawState().getBlendOpts(true , &srcCoeff,
624 &dst Coeff) ||
625 (kOne_GrBlendCoeff == srcCoeff && kZero_GrBlendCoeff == dstCoeff);
634 } 626 }
635 627
636 //////////////////////////////////////////////////////////////////////////////// 628 ////////////////////////////////////////////////////////////////////////////////
637 629
638 void GrDrawTarget::drawIndexedInstances(GrPrimitiveType type, 630 void GrDrawTarget::drawIndexedInstances(GrPrimitiveType type,
639 int instanceCount, 631 int instanceCount,
640 int verticesPerInstance, 632 int verticesPerInstance,
641 int indicesPerInstance, 633 int indicesPerInstance,
642 const SkRect* devBounds) { 634 const SkRect* devBounds) {
643 if (!verticesPerInstance || !indicesPerInstance) { 635 if (!verticesPerInstance || !indicesPerInstance) {
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); 1148 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]);
1157 1149
1158 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { 1150 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) {
1159 r.appendf("%s is uploadable to a texture: %s\n", 1151 r.appendf("%s is uploadable to a texture: %s\n",
1160 kConfigNames[i], 1152 kConfigNames[i],
1161 gNY[fConfigTextureSupport[i]]); 1153 gNY[fConfigTextureSupport[i]]);
1162 } 1154 }
1163 1155
1164 return r; 1156 return r;
1165 } 1157 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | src/gpu/gl/GrGpuGL.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698