Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Unified Diff: src/gpu/gl/GrGLGpu.h

Issue 1526253007: Move the GrGLGpu config stencil format index into ConfigTable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update comments Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.h
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index 409aae8f43da64a3d11f35f7af5002b344ea43ca..4f3b37ee9dfac7de1612bf91b7e50d48d4b8c52b 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -153,7 +153,7 @@ private:
GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&,
GrWrapOwnership) override;
// Given a GrPixelConfig return the index into the stencil format array on GrGLCaps to a
- // compatible stencil format.
+ // compatible stencil format, or negative if there is no compatible stencil format.
egdaniel 2015/12/16 21:52:11 Not a big issue, I can go either way, but would it
bsalomon 2015/12/17 16:56:45 My feeling is that kUnsupported and kUnimplemented
int getCompatibleStencilIndex(GrPixelConfig config);
void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override;
@@ -541,18 +541,27 @@ private:
struct ConfigEntry {
// Default constructor inits to known bad GL enum values.
- ConfigEntry() { memset(this, 0xAB, sizeof(ConfigEntry)); }
+ ConfigEntry() {
+ memset(this, 0xAB, sizeof(ConfigEntry));
+ fStencilFormatIndex = kUnknown_StencilIndex;
+ }
GrGLenum fBaseInternalFormat;
GrGLenum fSizedInternalFormat;
GrGLenum fExternalFormat;
GrGLenum fExternalType;
- };
- ConfigEntry fConfigTable[kLast_GrPixelConfig + 1];
+ // Index into GrGLCaps's list of stencil formats. Support is determined experimentally and
+ // lazily.
+ int fStencilFormatIndex;
+ enum {
+ // This indicates that a stencil format has not yet been determined for the config.
+ kUnknown_StencilIndex = -1,
+ // This indicates that there is no supported stencil format for the config.
+ kUnsupported_StencilFormatIndex = -2
+ };
+ };
- // Mapping of pixel configs to known supported stencil formats to be used
- // when adding a stencil buffer to a framebuffer.
- int fPixelConfigToStencilIndex[kGrPixelConfigCnt];
+ ConfigEntry fConfigTable[kGrPixelConfigCnt];
typedef GrGpu INHERITED;
friend class GrGLPathRendering; // For accessing setTextureUnit.
« no previous file with comments | « no previous file | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698