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

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

Issue 1947373003: Fix unit test crash caused by OSMesa not supporting rendering to GL_ALPHA8 (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | src/gpu/gl/GrGLUtil.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 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 } else { 1579 } else {
1580 fConfigTable[kAlpha_8_GrPixelConfig].fFormats.fBaseInternalFormat = GR_G L_ALPHA; 1580 fConfigTable[kAlpha_8_GrPixelConfig].fFormats.fBaseInternalFormat = GR_G L_ALPHA;
1581 fConfigTable[kAlpha_8_GrPixelConfig].fFormats.fSizedInternalFormat = GR_ GL_ALPHA8; 1581 fConfigTable[kAlpha_8_GrPixelConfig].fFormats.fSizedInternalFormat = GR_ GL_ALPHA8;
1582 fConfigTable[kAlpha_8_GrPixelConfig].fFormats.fExternalFormat[kOther_Ext ernalFormatUsage] = 1582 fConfigTable[kAlpha_8_GrPixelConfig].fFormats.fExternalFormat[kOther_Ext ernalFormatUsage] =
1583 GR_GL_ALPHA; 1583 GR_GL_ALPHA;
1584 fConfigTable[kAlpha_8_GrPixelConfig].fSwizzle = GrSwizzle::AAAA(); 1584 fConfigTable[kAlpha_8_GrPixelConfig].fSwizzle = GrSwizzle::AAAA();
1585 } 1585 }
1586 fConfigTable[kAlpha_8_GrPixelConfig].fFormats.fExternalType = GR_GL_UNSIGNED _BYTE; 1586 fConfigTable[kAlpha_8_GrPixelConfig].fFormats.fExternalType = GR_GL_UNSIGNED _BYTE;
1587 fConfigTable[kAlpha_8_GrPixelConfig].fFormatType = kNormalizedFixedPoint_For matType; 1587 fConfigTable[kAlpha_8_GrPixelConfig].fFormatType = kNormalizedFixedPoint_For matType;
1588 fConfigTable[kAlpha_8_GrPixelConfig].fFlags = ConfigInfo::kTextureable_Flag; 1588 fConfigTable[kAlpha_8_GrPixelConfig].fFlags = ConfigInfo::kTextureable_Flag;
1589 if (this->textureRedSupport() || kDesktop_ARB_MSFBOType == this->msFBOType() ) { 1589 if (this->textureRedSupport() ||
1590 (kDesktop_ARB_MSFBOType == this->msFBOType() &&
1591 ctxInfo.renderer() != kOSMesa_GrGLRenderer)) {
1590 // desktop ARB extension/3.0+ supports ALPHA8 as renderable. 1592 // desktop ARB extension/3.0+ supports ALPHA8 as renderable.
1593 // However, osmesa fails if it used even when GL_ARB_framebuffer_object is present.
1591 // Core profile removes ALPHA8 support, but we should have chosen R8 in that case. 1594 // Core profile removes ALPHA8 support, but we should have chosen R8 in that case.
1592 fConfigTable[kAlpha_8_GrPixelConfig].fFlags |= allRenderFlags; 1595 fConfigTable[kAlpha_8_GrPixelConfig].fFlags |= allRenderFlags;
1593 } 1596 }
1594 if (texStorageSupported) { 1597 if (texStorageSupported) {
1595 fConfigTable[kAlpha_8_GrPixelConfig].fFlags |= ConfigInfo::kCanUseTexSto rage_Flag; 1598 fConfigTable[kAlpha_8_GrPixelConfig].fFlags |= ConfigInfo::kCanUseTexSto rage_Flag;
1596 } 1599 }
1597 1600
1598 // Check for [half] floating point texture support 1601 // Check for [half] floating point texture support
1599 // NOTE: We disallow floating point textures on ES devices if linear filteri ng modes are not 1602 // NOTE: We disallow floating point textures on ES devices if linear filteri ng modes are not
1600 // supported. This is for simplicity, but a more granular approach is possib le. Coincidentally, 1603 // supported. This is for simplicity, but a more granular approach is possib le. Coincidentally,
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1903 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { 1906 for (int j = 0; j < kExternalFormatUsageCnt; ++j) {
1904 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != 1907 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] !=
1905 fConfigTable[i].fFormats.fExternalFormat[j]); 1908 fConfigTable[i].fFormats.fExternalFormat[j]);
1906 } 1909 }
1907 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats .fExternalType); 1910 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats .fExternalType);
1908 } 1911 }
1909 #endif 1912 #endif
1910 } 1913 }
1911 1914
1912 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} 1915 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {}
OLDNEW
« no previous file with comments | « no previous file | src/gpu/gl/GrGLUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698