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

Side by Side Diff: src/gpu/gl/GrGLCaps.cpp

Issue 1083133002: Rename GrStencilBuffer to GrStencilAttachment (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Align data member Created 5 years, 8 months 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 | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLGpu.h » ('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 2012 Google Inc. 2 * Copyright 2012 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 8
9 #include "GrGLCaps.h" 9 #include "GrGLCaps.h"
10 10
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { 784 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) {
785 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType; 785 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType;
786 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") && 786 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") &&
787 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) { 787 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) {
788 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType; 788 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType;
789 } 789 }
790 } 790 }
791 } 791 }
792 792
793 namespace { 793 namespace {
794 const GrGLuint kUnknownBitCount = GrGLStencilBuffer::kUnknownBitCount; 794 const GrGLuint kUnknownBitCount = GrGLStencilAttachment::kUnknownBitCount;
795 } 795 }
796 796
797 void GrGLCaps::initStencilFormats(const GrGLContextInfo& ctxInfo) { 797 void GrGLCaps::initStencilFormats(const GrGLContextInfo& ctxInfo) {
798 798
799 // Build up list of legal stencil formats (though perhaps not supported on 799 // Build up list of legal stencil formats (though perhaps not supported on
800 // the particular gpu/driver) from most preferred to least. 800 // the particular gpu/driver) from most preferred to least.
801 801
802 // these consts are in order of most preferred to least preferred 802 // these consts are in order of most preferred to least preferred
803 // we don't bother with GL_STENCIL_INDEX1 or GL_DEPTH32F_STENCIL8 803 // we don't bother with GL_STENCIL_INDEX1 or GL_DEPTH32F_STENCIL8
804 804
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 if (fGeometryShaderSupport) { 922 if (fGeometryShaderSupport) {
923 for (int p = 0; p < kGrSLPrecisionCount; ++p) { 923 for (int p = 0; p < kGrSLPrecisionCount; ++p) {
924 fFloatPrecisions[kGeometry_GrShaderType][p] = fFloatPrecisions[kVert ex_GrShaderType][p]; 924 fFloatPrecisions[kGeometry_GrShaderType][p] = fFloatPrecisions[kVert ex_GrShaderType][p];
925 } 925 }
926 } 926 }
927 } 927 }
928 928
929 929
930 void GrGLCaps::markColorConfigAndStencilFormatAsVerified( 930 void GrGLCaps::markColorConfigAndStencilFormatAsVerified(
931 GrPixelConfig config, 931 GrPixelConfig config,
932 const GrGLStencilBuffer::Format& format) { 932 const GrGLStencilAttachment::Format& format) {
933 #if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT 933 #if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT
934 return; 934 return;
935 #endif 935 #endif
936 SkASSERT((unsigned)config < (unsigned)kGrPixelConfigCnt); 936 SkASSERT((unsigned)config < (unsigned)kGrPixelConfigCnt);
937 SkASSERT(fStencilFormats.count() == fStencilVerifiedColorConfigs.count()); 937 SkASSERT(fStencilFormats.count() == fStencilVerifiedColorConfigs.count());
938 int count = fStencilFormats.count(); 938 int count = fStencilFormats.count();
939 // we expect a really small number of possible formats so linear search 939 // we expect a really small number of possible formats so linear search
940 // should be OK 940 // should be OK
941 SkASSERT(count < 16); 941 SkASSERT(count < 16);
942 for (int i = 0; i < count; ++i) { 942 for (int i = 0; i < count; ++i) {
943 if (format.fInternalFormat == 943 if (format.fInternalFormat ==
944 fStencilFormats[i].fInternalFormat) { 944 fStencilFormats[i].fInternalFormat) {
945 fStencilVerifiedColorConfigs[i].markVerified(config); 945 fStencilVerifiedColorConfigs[i].markVerified(config);
946 return; 946 return;
947 } 947 }
948 } 948 }
949 SkFAIL("Why are we seeing a stencil format that " 949 SkFAIL("Why are we seeing a stencil format that "
950 "GrGLCaps doesn't know about."); 950 "GrGLCaps doesn't know about.");
951 } 951 }
952 952
953 bool GrGLCaps::isColorConfigAndStencilFormatVerified( 953 bool GrGLCaps::isColorConfigAndStencilFormatVerified(
954 GrPixelConfig config, 954 GrPixelConfig config,
955 const GrGLStencilBuffer::Format& format) const { 955 const GrGLStencilAttachment::Format& format) con st {
956 #if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT 956 #if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT
957 return false; 957 return false;
958 #endif 958 #endif
959 SkASSERT((unsigned)config < (unsigned)kGrPixelConfigCnt); 959 SkASSERT((unsigned)config < (unsigned)kGrPixelConfigCnt);
960 int count = fStencilFormats.count(); 960 int count = fStencilFormats.count();
961 // we expect a really small number of possible formats so linear search 961 // we expect a really small number of possible formats so linear search
962 // should be OK 962 // should be OK
963 SkASSERT(count < 16); 963 SkASSERT(count < 16);
964 for (int i = 0; i < count; ++i) { 964 for (int i = 0; i < count; ++i) {
965 if (format.fInternalFormat == 965 if (format.fInternalFormat ==
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); 1050 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO"));
1051 r.appendf("Fragment coord conventions support: %s\n", 1051 r.appendf("Fragment coord conventions support: %s\n",
1052 (fFragCoordsConventionSupport ? "YES": "NO")); 1052 (fFragCoordsConventionSupport ? "YES": "NO"));
1053 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO")); 1053 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO"));
1054 r.appendf("Use non-VBO for dynamic data: %s\n", 1054 r.appendf("Use non-VBO for dynamic data: %s\n",
1055 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); 1055 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO"));
1056 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO ")); 1056 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO "));
1057 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES" : "NO")); 1057 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES" : "NO"));
1058 return r; 1058 return r;
1059 } 1059 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698