Implement support for mixed sampled render targets
Adds a new FBO type kStencil_MSFBOType that is selected whenever
NV_framebuffer_mixed_samples extension is available. In this new
FBO type a non-msaa color buffer is created with a multisampled
stencil buffer attachment.
Replaces numSamples() with separate numColorSamples and numStencilSamples
methods in RenderTarget.
In mixed samples mode non-MSAA codepaths are used to draw simple shapes,
while NVPR-rendered paths and text are rendered with a multisampled
stencil.
BUG=skia:3177
Review URL: https://codereview.chromium.org/1001503002
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index e924c60..b04bf34 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -67,8 +67,12 @@
* GL_MAX_SAMPLES value.
*/
kES_EXT_MsToTexture_MSFBOType,
+ /**
+ * GL_NV_framebuffer_mixed_samples.
+ */
+ kMixedSamples_MSFBOType,
- kLast_MSFBOType = kES_EXT_MsToTexture_MSFBOType
+ kLast_MSFBOType = kMixedSamples_MSFBOType
};
enum InvalidateFBType {
@@ -141,7 +145,8 @@
bool usesMSAARenderBuffers() const {
return kNone_MSFBOType != fMSFBOType &&
kES_IMG_MsToTexture_MSFBOType != fMSFBOType &&
- kES_EXT_MsToTexture_MSFBOType != fMSFBOType;
+ kES_EXT_MsToTexture_MSFBOType != fMSFBOType &&
+ kMixedSamples_MSFBOType != fMSFBOType;
}
/**
@@ -153,8 +158,6 @@
kES_EXT_MsToTexture_MSFBOType == fMSFBOType;
}
- bool fbMixedSamplesSupport() const { return fFBMixedSamplesSupport; }
-
InvalidateFBType invalidateFBType() const { return fInvalidateFBType; }
/// What type of buffer mapping is supported?
@@ -225,7 +228,9 @@
bool ES2CompatibilitySupport() const { return fES2CompatibilitySupport; }
/// Can we call glDisable(GL_MULTISAMPLE)?
- bool multisampleDisableSupport() const { return fMultisampleDisableSupport; }
+ bool multisampleDisableSupport() const {
+ return fMultisampleDisableSupport;
+ }
/// Use indices or vertices in CPU arrays rather than VBOs for dynamic content.
bool useNonVBOVertexAndIndexDynamicData() const {
@@ -349,7 +354,6 @@
bool fUseNonVBOVertexAndIndexDynamicData : 1;
bool fIsCoreProfile : 1;
bool fFullClearIsFree : 1;
- bool fFBMixedSamplesSupport : 1;
struct ReadPixelsSupportedFormat {
GrGLenum fFormat;