OLD | NEW |
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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 GR_GL_IMPLEMENTATION_COLOR_READ_TYPE, | 742 GR_GL_IMPLEMENTATION_COLOR_READ_TYPE, |
743 &otherType); | 743 &otherType); |
744 | 744 |
745 return (GrGLenum)otherFormat == format && (GrGLenum)otherType == type; | 745 return (GrGLenum)otherFormat == format && (GrGLenum)otherType == type; |
746 } | 746 } |
747 | 747 |
748 bool GrGLCaps::readPixelsSupported(const GrGLInterface* intf, | 748 bool GrGLCaps::readPixelsSupported(const GrGLInterface* intf, |
749 GrGLenum format, | 749 GrGLenum format, |
750 GrGLenum type, | 750 GrGLenum type, |
751 GrGLenum currFboFormat) const { | 751 GrGLenum currFboFormat) const { |
752 | 752 ReadPixelsSupportedFormat key = {format, type, currFboFormat}; |
753 ReadPixelsSupportedFormats::Key key = {format, type, currFboFormat}; | 753 if (const bool* supported = fReadPixelsSupportedCache.find(key)) { |
754 | 754 return *supported; |
755 ReadPixelsSupportedFormats* cachedValue = fReadPixelsSupportedCache.find(key
); | |
756 | |
757 if (NULL == cachedValue) { | |
758 bool value = doReadPixelsSupported(intf, format, type); | |
759 ReadPixelsSupportedFormats newValue(key, value); | |
760 fReadPixelsSupportedCache.add(newValue); | |
761 | |
762 return newValue.value(); | |
763 } | 755 } |
764 | 756 bool supported = this->doReadPixelsSupported(intf, format, type); |
765 return cachedValue->value(); | 757 fReadPixelsSupportedCache.set(key, supported); |
| 758 return supported; |
766 } | 759 } |
767 | 760 |
768 void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa
ce* gli) { | 761 void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa
ce* gli) { |
769 | 762 |
770 fMSFBOType = kNone_MSFBOType; | 763 fMSFBOType = kNone_MSFBOType; |
771 if (kGL_GrGLStandard != ctxInfo.standard()) { | 764 if (kGL_GrGLStandard != ctxInfo.standard()) { |
772 // We prefer the EXT/IMG extension over ES3 MSAA because we've observed | 765 // We prefer the EXT/IMG extension over ES3 MSAA because we've observed |
773 // ES3 driver bugs on at least one device with a tiled GPU (N10). | 766 // ES3 driver bugs on at least one device with a tiled GPU (N10). |
774 if (ctxInfo.hasExtension("GL_EXT_multisampled_render_to_texture")) { | 767 if (ctxInfo.hasExtension("GL_EXT_multisampled_render_to_texture")) { |
775 fMSFBOType = kES_EXT_MsToTexture_MSFBOType; | 768 fMSFBOType = kES_EXT_MsToTexture_MSFBOType; |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 1048 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
1056 r.appendf("Fragment coord conventions support: %s\n", | 1049 r.appendf("Fragment coord conventions support: %s\n", |
1057 (fFragCoordsConventionSupport ? "YES": "NO")); | 1050 (fFragCoordsConventionSupport ? "YES": "NO")); |
1058 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); | 1051 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); |
1059 r.appendf("Use non-VBO for dynamic data: %s\n", | 1052 r.appendf("Use non-VBO for dynamic data: %s\n", |
1060 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 1053 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
1061 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); | 1054 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); |
1062 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); | 1055 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); |
1063 return r; | 1056 return r; |
1064 } | 1057 } |
OLD | NEW |