skia2/include/private/GrInstancedPipelineInfo.h
Robert Phillips c7635fa374 Make GrDrawContext be GrRenderTargetProxy-backed
This is split out of https://codereview.chromium.org/2215323003/ (Start using RenderTargetProxy (omnibus))

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3841

CQ_INCLUDE_TRYBOTS=master.client.skia.android:Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-GN_Android-Trybot

Change-Id: I1a47f19ed1ac0c249e6ccac8db74095d7f456db4
Reviewed-on: https://skia-review.googlesource.com/3841
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-10-28 18:35:06 +00:00

50 lines
1.7 KiB
C

/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GrGrInstancedPipelineInfo_DEFINED
#define GrGrInstancedPipelineInfo_DEFINED
#include "GrRenderTargetProxy.h"
/**
* Provides info about the pipeline that GrInstancedRendering needs in order to select appropriate
* drawing algorithms.
*/
struct GrInstancedPipelineInfo {
GrInstancedPipelineInfo(const GrRenderTargetProxy* rtp)
: fIsMultisampled(rtp->isStencilBufferMultisampled())
, fIsMixedSampled(rtp->isMixedSampled())
, fIsRenderingToFloat(GrPixelConfigIsFloatingPoint(rtp->desc().fConfig))
, fColorDisabled(false)
, fDrawingShapeToStencil(false)
, fCanDiscard(false) {
}
bool canUseCoverageAA() const {
return !fIsMultisampled || (fIsMixedSampled && !fDrawingShapeToStencil);
}
bool fIsMultisampled : 1;
bool fIsMixedSampled : 1;
bool fIsRenderingToFloat : 1;
bool fColorDisabled : 1;
/**
* Indicates that the instanced renderer should take extra precautions to ensure the shape gets
* drawn correctly to the stencil buffer (e.g. no coverage AA). NOTE: this does not mean a
* stencil test is or is not active.
*/
bool fDrawingShapeToStencil : 1;
/**
* Indicates that the instanced renderer can use processors with discard instructions. This
* should not be set if the shader will use derivatives, automatic mipmap LOD, or other features
* that depend on neighboring pixels. Some draws will fail to create if this is not set.
*/
bool fCanDiscard : 1;
};
#endif