bsalomon@google.com | af84e74 | 2012-10-05 13:23:24 +0000 | [diff] [blame] | 1 | /* |
egdaniel | 8dd688b | 2015-01-22 10:16:09 -0800 | [diff] [blame] | 2 | * Copyright 2015 Google Inc. |
bsalomon@google.com | af84e74 | 2012-10-05 13:23:24 +0000 | [diff] [blame] | 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
egdaniel | 8dd688b | 2015-01-22 10:16:09 -0800 | [diff] [blame] | 8 | #include "GrPipelineBuilder.h" |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 9 | |
egdaniel | b1cff03 | 2014-11-13 06:19:25 -0800 | [diff] [blame] | 10 | #include "GrBlend.h" |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 11 | #include "GrPaint.h" |
egdaniel | 8dd688b | 2015-01-22 10:16:09 -0800 | [diff] [blame] | 12 | #include "GrPipeline.h" |
egdaniel | b6cbc38 | 2014-11-13 11:00:34 -0800 | [diff] [blame] | 13 | #include "GrProcOptInfo.h" |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 14 | #include "GrXferProcessor.h" |
| 15 | #include "effects/GrPorterDuffXferProcessor.h" |
Brian Salomon | 8952743 | 2016-12-16 09:52:16 -0500 | [diff] [blame] | 16 | #include "ops/GrOp.h" |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 17 | |
Brian Salomon | 82f4431 | 2017-01-11 13:42:54 -0500 | [diff] [blame] | 18 | GrPipelineBuilder::GrPipelineBuilder(GrPaint&& paint, GrAAType aaType) |
Brian Salomon | 0e8fc8b | 2016-12-09 15:10:07 -0500 | [diff] [blame] | 19 | : fFlags(0x0) |
Brian Salomon | 92ce594 | 2017-01-18 11:01:10 -0500 | [diff] [blame] | 20 | , fDrawFace(GrDrawFace::kBoth) |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame^] | 21 | , fUserStencilSettings(&GrUserStencilSettings::kUnused) |
Brian Salomon | 92ce594 | 2017-01-18 11:01:10 -0500 | [diff] [blame] | 22 | , fProcessors(std::move(paint)) { |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame^] | 23 | if (GrAATypeIsHW(aaType)) { |
| 24 | fFlags |= GrPipeline::kHWAntialias_Flag; |
| 25 | } |
| 26 | if (paint.getDisableOutputConversionToSRGB()) { |
| 27 | fFlags |= GrPipeline::kDisableOutputConversionToSRGB_Flag; |
| 28 | } |
| 29 | if (paint.getAllowSRGBInputs()) { |
| 30 | fFlags |= GrPipeline::kAllowSRGBInputs_Flag; |
| 31 | } |
bsalomon@google.com | af84e74 | 2012-10-05 13:23:24 +0000 | [diff] [blame] | 32 | } |
bsalomon@google.com | 5b3e890 | 2012-10-05 20:13:28 +0000 | [diff] [blame] | 33 | |
bsalomon | 6a44c6a | 2015-05-26 09:49:05 -0700 | [diff] [blame] | 34 | bool GrPipelineBuilder::willXPNeedDstTexture(const GrCaps& caps, |
Brian Salomon | 92aee3d | 2016-12-21 09:20:25 -0500 | [diff] [blame] | 35 | const GrPipelineAnalysis& analysis) const { |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame^] | 36 | if (fProcessors.xpFactory()) { |
| 37 | return fProcessors.xpFactory()->willNeedDstTexture(caps, analysis); |
egdaniel | c4b7272 | 2015-11-23 13:20:41 -0800 | [diff] [blame] | 38 | } |
Brian Salomon | 92aee3d | 2016-12-21 09:20:25 -0500 | [diff] [blame] | 39 | return GrPorterDuffXPFactory::SrcOverWillNeedDstTexture(caps, analysis); |
egdaniel | 89af44a | 2014-09-26 06:15:04 -0700 | [diff] [blame] | 40 | } |