OLD | NEW |
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 Loading... |
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. |
632 return this->caps()->dualSourceBlendingSupport() || | 619 return this->caps()->dualSourceBlendingSupport() || |
633 GrDrawState::kNone_BlendOpt != this->getDrawState().getBlendOpts(true
); | 620 GrDrawState::kNone_BlendOpt != this->getDrawState().getBlendOpts(true
); |
634 } | 621 } |
635 | 622 |
636 //////////////////////////////////////////////////////////////////////////////// | 623 //////////////////////////////////////////////////////////////////////////////// |
637 | 624 |
638 void GrDrawTarget::drawIndexedInstances(GrPrimitiveType type, | 625 void GrDrawTarget::drawIndexedInstances(GrPrimitiveType type, |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); | 1143 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); |
1157 | 1144 |
1158 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 1145 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
1159 r.appendf("%s is uploadable to a texture: %s\n", | 1146 r.appendf("%s is uploadable to a texture: %s\n", |
1160 kConfigNames[i], | 1147 kConfigNames[i], |
1161 gNY[fConfigTextureSupport[i]]); | 1148 gNY[fConfigTextureSupport[i]]); |
1162 } | 1149 } |
1163 | 1150 |
1164 return r; | 1151 return r; |
1165 } | 1152 } |
OLD | NEW |