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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrGLGpu_DEFINED 8 #ifndef GrGLGpu_DEFINED
9 #define GrGLGpu_DEFINED 9 #define GrGLGpu_DEFINED
10 10
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, 146 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc,
147 GrGpuResource::LifeCycle lifeCycle, 147 GrGpuResource::LifeCycle lifeCycle,
148 const void* srcData) override; 148 const void* srcData) override;
149 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override; 149 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override;
150 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override; 150 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override;
151 GrTransferBuffer* onCreateTransferBuffer(size_t size, TransferType type) ove rride; 151 GrTransferBuffer* onCreateTransferBuffer(size_t size, TransferType type) ove rride;
152 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership ) override; 152 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership ) override;
153 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, 153 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&,
154 GrWrapOwnership) override; 154 GrWrapOwnership) override;
155 // Given a GrPixelConfig return the index into the stencil format array on G rGLCaps to a 155 // Given a GrPixelConfig return the index into the stencil format array on G rGLCaps to a
156 // compatible stencil format. 156 // 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
157 int getCompatibleStencilIndex(GrPixelConfig config); 157 int getCompatibleStencilIndex(GrPixelConfig config);
158 158
159 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override; 159 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override;
160 160
161 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli p) override; 161 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli p) override;
162 162
163 bool onReadPixels(GrSurface*, 163 bool onReadPixels(GrSurface*,
164 int left, int top, 164 int left, int top,
165 int width, int height, 165 int width, int height,
166 GrPixelConfig, 166 GrPixelConfig,
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 if (target == GR_GL_TEXTURE_2D) { 534 if (target == GR_GL_TEXTURE_2D) {
535 return 0; 535 return 0;
536 } else { 536 } else {
537 SkASSERT(target == GR_GL_TEXTURE_EXTERNAL); 537 SkASSERT(target == GR_GL_TEXTURE_EXTERNAL);
538 return 1; 538 return 1;
539 } 539 }
540 } 540 }
541 541
542 struct ConfigEntry { 542 struct ConfigEntry {
543 // Default constructor inits to known bad GL enum values. 543 // Default constructor inits to known bad GL enum values.
544 ConfigEntry() { memset(this, 0xAB, sizeof(ConfigEntry)); } 544 ConfigEntry() {
545 memset(this, 0xAB, sizeof(ConfigEntry));
546 fStencilFormatIndex = kUnknown_StencilIndex;
547 }
545 GrGLenum fBaseInternalFormat; 548 GrGLenum fBaseInternalFormat;
546 GrGLenum fSizedInternalFormat; 549 GrGLenum fSizedInternalFormat;
547 GrGLenum fExternalFormat; 550 GrGLenum fExternalFormat;
548 GrGLenum fExternalType; 551 GrGLenum fExternalType;
552
553 // Index into GrGLCaps's list of stencil formats. Support is determined experimentally and
554 // lazily.
555 int fStencilFormatIndex;
556 enum {
557 // This indicates that a stencil format has not yet been determined for the config.
558 kUnknown_StencilIndex = -1,
559 // This indicates that there is no supported stencil format for the config.
560 kUnsupported_StencilFormatIndex = -2
561 };
549 }; 562 };
550 563
551 ConfigEntry fConfigTable[kLast_GrPixelConfig + 1]; 564 ConfigEntry fConfigTable[kGrPixelConfigCnt];
552
553 // Mapping of pixel configs to known supported stencil formats to be used
554 // when adding a stencil buffer to a framebuffer.
555 int fPixelConfigToStencilIndex[kGrPixelConfigCnt];
556 565
557 typedef GrGpu INHERITED; 566 typedef GrGpu INHERITED;
558 friend class GrGLPathRendering; // For accessing setTextureUnit. 567 friend class GrGLPathRendering; // For accessing setTextureUnit.
559 }; 568 };
560 569
561 #endif 570 #endif
OLDNEW
« 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