diff options
author | 2015-09-10 08:37:20 -0700 | |
---|---|---|
committer | 2015-09-10 08:37:20 -0700 | |
commit | ff1d547c72b7c70af7bddfba01d4646b2389db7a (patch) | |
tree | a96e9b61d9b2837969825d67e170966ff94e22b0 /src/gpu/gl/GrGLGpu.h | |
parent | 6c6f65885ba20ba9e8d8c36039f1c9eff4cc814b (diff) |
Calculate pixel config and stencil fmt pairs once per pixel config.
We use a temp FB and stencil buffer to test different stencil formats with
a given pixel config. We then keep a map from pixel config to desired stencil
format.
BUG=skia:
Review URL: https://codereview.chromium.org/1317443004
Diffstat (limited to 'src/gpu/gl/GrGLGpu.h')
-rw-r--r-- | src/gpu/gl/GrGLGpu.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h index 8a04467391..eaf762d0e2 100644 --- a/src/gpu/gl/GrGLGpu.h +++ b/src/gpu/gl/GrGLGpu.h @@ -126,6 +126,9 @@ private: bool createStencilAttachmentForRenderTarget(GrRenderTarget* rt, int width, int height) override; bool attachStencilAttachmentToRenderTarget(GrStencilAttachment* sb, GrRenderTarget* rt) override; + // Given a GrPixelConfig return the index into the stencil format array on GrGLCaps to a + // compatible stencil format. + int getCompatibleStencilIndex(GrPixelConfig config); void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override; @@ -489,9 +492,9 @@ private: ///@} - // we record what stencil format worked last time to hopefully exit early - // from our loop that tries stencil formats and calls check fb status. - int fLastSuccessfulStencilFmtIdx; + // Mapping of pixel configs to known supported stencil formats to be used + // when adding a stencil buffer to a framebuffer. + int fPixelConfigToStencilIndex[kGrPixelConfigCnt]; typedef GrGpu INHERITED; friend class GrGLPathRendering; // For accessing setTextureUnit. |