Allow chrome to limit the number of FBO status checks
Review URL: https://codereview.appspot.com/5635052
git-svn-id: http://skia.googlecode.com/svn/trunk@3144 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrGpuGL.h b/src/gpu/GrGpuGL.h
index 6ac4809..e111432 100644
--- a/src/gpu/GrGpuGL.h
+++ b/src/gpu/GrGpuGL.h
@@ -61,8 +61,41 @@
, fPackFlipYSupport(false)
, fTextureUsageSupport(false)
, fTexStorageSupport(false) {
+ memset(&fVerifiedColorAttachmentConfigs, 0,
+ sizeof(fVerifiedColorAttachmentConfigs));
}
- SkTArray<GrGLStencilBuffer::Format, true> fStencilFormats;
+
+ // Call to note that a color config has been verified as a valid
+ // color attachment. This may save future calls to
+ // CheckFramebufferStatus
+ void markConfigAsValidColorAttachment(GrPixelConfig config);
+
+ // Call to check whether a config has been verified as a valid color
+ // attachment.
+ bool isConfigVerifiedColorAttachment(GrPixelConfig config) const;
+
+ // Call to note that a color config / stencil format pair passed
+ // FBO status check. We may skip calling CheckFramebufferStatus for
+ // this combination in the future.
+ void markColorConfigAndStencilFormatAsVerified(
+ GrPixelConfig config,
+ const GrGLStencilBuffer::Format& format);
+
+ // Call to check whether color config / stencil format pair has already
+ // passed FBO status check.
+ bool isColorConfigAndStencilFormatVerified(
+ GrPixelConfig config,
+ const GrGLStencilBuffer::Format& format) const;
+
+ void print() const;
+
+ struct StencilFormat {
+ GrGLStencilBuffer::Format fFormat;
+ uint32_t fVerifiedColorConfigs[(kGrPixelConfigCount + 31) / 32];
+ };
+
+ SkTArray<StencilFormat, true> fStencilFormats;
+
enum {
/**
@@ -118,9 +151,10 @@
// Is there support for glTexStorage
bool fTexStorageSupport;
- void print() const;
+ private:
+ uint32_t fVerifiedColorAttachmentConfigs[(kGrPixelConfigCount + 31) / 32];
} fGLCaps;
-
+
struct {
size_t fVertexOffset;
GrVertexLayout fVertexLayout;