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

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

Issue 1615833002: Make BGRA8888 renderable on CHROMIUM_framebuffer_mixed_samples (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 | no next file » | 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 **************************************************************************/ 286 **************************************************************************/
287 287
288 // We need dual source blending and the ability to disable multisample in or der to support mixed 288 // We need dual source blending and the ability to disable multisample in or der to support mixed
289 // samples in every corner case. 289 // samples in every corner case.
290 if (fMultisampleDisableSupport && 290 if (fMultisampleDisableSupport &&
291 glslCaps->dualSourceBlendingSupport() && 291 glslCaps->dualSourceBlendingSupport() &&
292 fShaderCaps->pathRenderingSupport()) { 292 fShaderCaps->pathRenderingSupport()) {
293 fUsesMixedSamples = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_sample s") || 293 fUsesMixedSamples = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_sample s") ||
294 ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_mixed_samples"); 294 ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_mixed_samples");
295 // Workaround NVIDIA bug related to glInvalidateFramebuffer and mixed sa mples. 295 // Workaround NVIDIA bug related to glInvalidateFramebuffer and mixed sa mples.
296 if (fUsesMixedSamples && kNVIDIA_GrGLDriver == ctxInfo.driver()) { 296 if (fUsesMixedSamples && (kNVIDIA_GrGLDriver == ctxInfo.driver() ||
297 kChromium_GrGLDriver == ctxInfo.driver())) {
297 fDiscardRenderTargetSupport = false; 298 fDiscardRenderTargetSupport = false;
298 fInvalidateFBType = kNone_InvalidateFBType; 299 fInvalidateFBType = kNone_InvalidateFBType;
299 } 300 }
300 } 301 }
301 302
302 // fUsesMixedSamples must be set before calling initFSAASupport. 303 // fUsesMixedSamples must be set before calling initFSAASupport.
303 this->initFSAASupport(ctxInfo, gli); 304 this->initFSAASupport(ctxInfo, gli);
304 this->initBlendEqationSupport(ctxInfo); 305 this->initBlendEqationSupport(ctxInfo);
305 this->initStencilFormats(ctxInfo); 306 this->initStencilFormats(ctxInfo);
306 307
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 // On ES2 the internal format of a BGRA texture is RGBA with the APPLE extension. 1195 // On ES2 the internal format of a BGRA texture is RGBA with the APPLE extension.
1195 // Though, that seems to not be the case if the texture storage extension is 1196 // Though, that seems to not be the case if the texture storage extension is
1196 // present. The specs don't exactly make that clear. 1197 // present. The specs don't exactly make that clear.
1197 fConfigTable[kBGRA_8888_GrPixelConfig].fFormats.fBaseInternalFor mat = GR_GL_RGBA; 1198 fConfigTable[kBGRA_8888_GrPixelConfig].fFormats.fBaseInternalFor mat = GR_GL_RGBA;
1198 fConfigTable[kBGRA_8888_GrPixelConfig].fFormats.fSizedInternalFo rmat = GR_GL_RGBA8; 1199 fConfigTable[kBGRA_8888_GrPixelConfig].fFormats.fSizedInternalFo rmat = GR_GL_RGBA8;
1199 } 1200 }
1200 } else if (ctxInfo.hasExtension("GL_EXT_texture_format_BGRA8888")) { 1201 } else if (ctxInfo.hasExtension("GL_EXT_texture_format_BGRA8888")) {
1201 fConfigTable[kBGRA_8888_GrPixelConfig].fFlags = ConfigInfo::kTexture able_Flag | 1202 fConfigTable[kBGRA_8888_GrPixelConfig].fFlags = ConfigInfo::kTexture able_Flag |
1202 ConfigInfo::kRendera ble_Flag; 1203 ConfigInfo::kRendera ble_Flag;
1203 if (ctxInfo.hasExtension("GL_CHROMIUM_renderbuffer_format_BGRA8888") && 1204 if (ctxInfo.hasExtension("GL_CHROMIUM_renderbuffer_format_BGRA8888") &&
1204 this->usesMSAARenderBuffers()) { 1205 (this->usesMSAARenderBuffers() || this->fMSFBOType == kMixedSamp les_MSFBOType)) {
1205 fConfigTable[kBGRA_8888_GrPixelConfig].fFlags |= 1206 fConfigTable[kBGRA_8888_GrPixelConfig].fFlags |=
1206 ConfigInfo::kRenderableWithMSAA_Flag; 1207 ConfigInfo::kRenderableWithMSAA_Flag;
1207 } 1208 }
1208 } 1209 }
1209 } 1210 }
1210 fConfigTable[kBGRA_8888_GrPixelConfig].fSwizzle = GrSwizzle::RGBA(); 1211 fConfigTable[kBGRA_8888_GrPixelConfig].fSwizzle = GrSwizzle::RGBA();
1211 1212
1212 // We only enable srgb support if both textures and FBOs support srgb. 1213 // We only enable srgb support if both textures and FBOs support srgb.
1213 bool srgbSupport = false; 1214 bool srgbSupport = false;
1214 if (kGL_GrGLStandard == standard) { 1215 if (kGL_GrGLStandard == standard) {
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
1586 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { 1587 for (int j = 0; j < kExternalFormatUsageCnt; ++j) {
1587 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != 1588 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] !=
1588 fConfigTable[i].fFormats.fExternalFormat[j]); 1589 fConfigTable[i].fFormats.fExternalFormat[j]);
1589 } 1590 }
1590 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats .fExternalType); 1591 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats .fExternalType);
1591 } 1592 }
1592 #endif 1593 #endif
1593 } 1594 }
1594 1595
1595 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} 1596 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {}
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698