• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
11 #include "GrRenderTargetProxy.h"
12 
13 /**
14  * Provides info about the pipeline that GrInstancedRendering needs in order to select appropriate
15  * drawing algorithms.
16  */
17 struct GrInstancedPipelineInfo {
GrInstancedPipelineInfoGrInstancedPipelineInfo18     GrInstancedPipelineInfo(const GrRenderTargetProxy* rtp)
19             : fIsMultisampled(GrFSAAType::kNone != rtp->fsaaType())
20             , fIsMixedSampled(GrFSAAType::kMixedSamples == rtp->fsaaType())
21             , fIsRenderingToFloat(GrPixelConfigIsFloatingPoint(rtp->config())) {}
22 
canUseCoverageAAGrInstancedPipelineInfo23     bool canUseCoverageAA() const { return !fIsMultisampled || fIsMixedSampled; }
24 
25     bool fIsMultisampled         : 1;
26     bool fIsMixedSampled         : 1;
27     bool fIsRenderingToFloat     : 1;
28 };
29 
30 #endif
31