csmartdalton | a7f2964 | 2016-07-07 08:49:11 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 Google Inc. |
| 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 | |
| 8 | #ifndef GrGrInstancedPipelineInfo_DEFINED |
| 9 | #define GrGrInstancedPipelineInfo_DEFINED |
| 10 | |
Robert Phillips | c7635fa | 2016-10-28 13:25:24 -0400 | [diff] [blame] | 11 | #include "GrRenderTargetProxy.h" |
csmartdalton | a7f2964 | 2016-07-07 08:49:11 -0700 | [diff] [blame] | 12 | |
| 13 | /** |
| 14 | * Provides info about the pipeline that GrInstancedRendering needs in order to select appropriate |
| 15 | * drawing algorithms. |
| 16 | */ |
| 17 | struct GrInstancedPipelineInfo { |
Robert Phillips | c7635fa | 2016-10-28 13:25:24 -0400 | [diff] [blame] | 18 | GrInstancedPipelineInfo(const GrRenderTargetProxy* rtp) |
Brian Salomon | 7c8460e | 2017-05-12 11:36:10 -0400 | [diff] [blame] | 19 | : fIsMultisampled(GrFSAAType::kNone != rtp->fsaaType()) |
| 20 | , fIsMixedSampled(GrFSAAType::kMixedSamples == rtp->fsaaType()) |
Brian Salomon | 63e7973 | 2017-05-15 21:23:13 -0400 | [diff] [blame^] | 21 | , fIsRenderingToFloat(GrPixelConfigIsFloatingPoint(rtp->config())) {} |
csmartdalton | a7f2964 | 2016-07-07 08:49:11 -0700 | [diff] [blame] | 22 | |
Brian Salomon | 5ff3a5c | 2017-03-01 14:34:41 -0500 | [diff] [blame] | 23 | bool canUseCoverageAA() const { return !fIsMultisampled || fIsMixedSampled; } |
csmartdalton | a7f2964 | 2016-07-07 08:49:11 -0700 | [diff] [blame] | 24 | |
| 25 | bool fIsMultisampled : 1; |
| 26 | bool fIsMixedSampled : 1; |
| 27 | bool fIsRenderingToFloat : 1; |
csmartdalton | a7f2964 | 2016-07-07 08:49:11 -0700 | [diff] [blame] | 28 | }; |
| 29 | |
| 30 | #endif |