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

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

Issue 1531283002: Don't allow BGRA rendertargets on iOS w/ES 3.0+. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: 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 | 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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 // we no longer support 444 as a render target 723 // we no longer support 444 as a render target
724 fConfigRenderSupport[kRGBA_4444_GrPixelConfig][kNo_MSAA] = false; 724 fConfigRenderSupport[kRGBA_4444_GrPixelConfig][kNo_MSAA] = false;
725 fConfigRenderSupport[kRGBA_4444_GrPixelConfig][kYes_MSAA] = false; 725 fConfigRenderSupport[kRGBA_4444_GrPixelConfig][kYes_MSAA] = false;
726 726
727 if (this->fRGBA8RenderbufferSupport) { 727 if (this->fRGBA8RenderbufferSupport) {
728 fConfigRenderSupport[kRGBA_8888_GrPixelConfig][kNo_MSAA] = true; 728 fConfigRenderSupport[kRGBA_8888_GrPixelConfig][kNo_MSAA] = true;
729 fConfigRenderSupport[kRGBA_8888_GrPixelConfig][kYes_MSAA] = true; 729 fConfigRenderSupport[kRGBA_8888_GrPixelConfig][kYes_MSAA] = true;
730 } 730 }
731 731
732 if (this->isConfigTexturable(kBGRA_8888_GrPixelConfig)) { 732 if (this->isConfigTexturable(kBGRA_8888_GrPixelConfig)) {
733 fConfigRenderSupport[kBGRA_8888_GrPixelConfig][kNo_MSAA] = true; 733 // On iOS, BGRA is not supported as a renderable target on ES 3.0+
734 // The GL_EXT_texture_format_BGRA8888 extension does not add BGRA to the list of 734 if (!ctxInfo.hasExtension("GL_APPLE_texture_format_BGRA8888") ||
735 // configs that are color-renderable and can be passed to glRenderBuffer StorageMultisample. 735 ctxInfo.version() < GR_GL_VER(3,0)) {
736 // Chromium may have an extension to allow BGRA renderbuffers to work on desktop platforms. 736 fConfigRenderSupport[kBGRA_8888_GrPixelConfig][kNo_MSAA] = true;
737 if (ctxInfo.hasExtension("GL_CHROMIUM_renderbuffer_format_BGRA8888")) { 737 // The GL_EXT_texture_format_BGRA8888 extension does not add BGRA to the list of
738 fConfigRenderSupport[kBGRA_8888_GrPixelConfig][kYes_MSAA] = true; 738 // configs that are color-renderable and can be passed to glRenderBu fferStorageMultisample.
739 } else { 739 // Chromium may have an extension to allow BGRA renderbuffers to wor k on desktop platforms.
740 fConfigRenderSupport[kBGRA_8888_GrPixelConfig][kYes_MSAA] = 740 if (ctxInfo.hasExtension("GL_CHROMIUM_renderbuffer_format_BGRA8888") ) {
741 !fBGRAIsInternalFormat || !this->usesMSAARenderBuffers(); 741 fConfigRenderSupport[kBGRA_8888_GrPixelConfig][kYes_MSAA] = true ;
742 } else {
743 fConfigRenderSupport[kBGRA_8888_GrPixelConfig][kYes_MSAA] =
744 !fBGRAIsInternalFormat || !this->usesMSAARenderBuffers();
745 }
742 } 746 }
743 } 747 }
744 748
745 if (this->fRGBA8RenderbufferSupport && srgbSupport) { 749 if (this->fRGBA8RenderbufferSupport && srgbSupport) {
746 fConfigRenderSupport[kSRGBA_8888_GrPixelConfig][kNo_MSAA] = true; 750 fConfigRenderSupport[kSRGBA_8888_GrPixelConfig][kNo_MSAA] = true;
747 fConfigRenderSupport[kSRGBA_8888_GrPixelConfig][kYes_MSAA] = true; 751 fConfigRenderSupport[kSRGBA_8888_GrPixelConfig][kYes_MSAA] = true;
748 } 752 }
749 753
750 if (this->isConfigTexturable(kRGBA_float_GrPixelConfig)) { 754 if (this->isConfigTexturable(kRGBA_float_GrPixelConfig)) {
751 if (kGL_GrGLStandard == standard) { 755 if (kGL_GrGLStandard == standard) {
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
1348 glslCaps->fConfigSwizzle[kR11_EAC_GrPixelConfig] = "rrrr"; 1352 glslCaps->fConfigSwizzle[kR11_EAC_GrPixelConfig] = "rrrr";
1349 glslCaps->fConfigSwizzle[kASTC_12x12_GrPixelConfig] = "rgba"; 1353 glslCaps->fConfigSwizzle[kASTC_12x12_GrPixelConfig] = "rgba";
1350 glslCaps->fConfigSwizzle[kRGBA_float_GrPixelConfig] = "rgba"; 1354 glslCaps->fConfigSwizzle[kRGBA_float_GrPixelConfig] = "rgba";
1351 glslCaps->fConfigSwizzle[kRGBA_half_GrPixelConfig] = "rgba"; 1355 glslCaps->fConfigSwizzle[kRGBA_half_GrPixelConfig] = "rgba";
1352 1356
1353 } 1357 }
1354 1358
1355 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} 1359 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {}
1356 1360
1357 1361
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