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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 fUseNonVBOVertexAndIndexDynamicData = false; | 47 fUseNonVBOVertexAndIndexDynamicData = false; |
48 fIsCoreProfile = false; | 48 fIsCoreProfile = false; |
49 fBindFragDataLocationSupport = false; | 49 fBindFragDataLocationSupport = false; |
50 fExternalTextureSupport = false; | 50 fExternalTextureSupport = false; |
51 fRectangleTextureSupport = false; | 51 fRectangleTextureSupport = false; |
52 fTextureSwizzleSupport = false; | 52 fTextureSwizzleSupport = false; |
53 fSRGBWriteControl = false; | 53 fSRGBWriteControl = false; |
54 fRGBA8888PixelsOpsAreSlow = false; | 54 fRGBA8888PixelsOpsAreSlow = false; |
55 fPartialFBOReadIsSlow = false; | 55 fPartialFBOReadIsSlow = false; |
56 | 56 |
| 57 fBlitFramebufferSupport = kNone_BlitFramebufferSupport; |
| 58 |
57 fShaderCaps.reset(new GrGLSLCaps(contextOptions)); | 59 fShaderCaps.reset(new GrGLSLCaps(contextOptions)); |
58 | 60 |
59 this->init(contextOptions, ctxInfo, glInterface); | 61 this->init(contextOptions, ctxInfo, glInterface); |
60 } | 62 } |
61 | 63 |
62 void GrGLCaps::init(const GrContextOptions& contextOptions, | 64 void GrGLCaps::init(const GrContextOptions& contextOptions, |
63 const GrGLContextInfo& ctxInfo, | 65 const GrGLContextInfo& ctxInfo, |
64 const GrGLInterface* gli) { | 66 const GrGLInterface* gli) { |
65 GrGLStandard standard = ctxInfo.standard(); | 67 GrGLStandard standard = ctxInfo.standard(); |
66 GrGLVersion version = ctxInfo.version(); | 68 GrGLVersion version = ctxInfo.version(); |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 fMSFBOType = kMixedSamples_MSFBOType; | 761 fMSFBOType = kMixedSamples_MSFBOType; |
760 } else if (ctxInfo.version() >= GR_GL_VER(3,0)) { | 762 } else if (ctxInfo.version() >= GR_GL_VER(3,0)) { |
761 fMSFBOType = GrGLCaps::kES_3_0_MSFBOType; | 763 fMSFBOType = GrGLCaps::kES_3_0_MSFBOType; |
762 } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample"))
{ | 764 } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample"))
{ |
763 // chrome's extension is equivalent to the EXT msaa | 765 // chrome's extension is equivalent to the EXT msaa |
764 // and fbo_blit extensions. | 766 // and fbo_blit extensions. |
765 fMSFBOType = kDesktop_EXT_MSFBOType; | 767 fMSFBOType = kDesktop_EXT_MSFBOType; |
766 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) { | 768 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) { |
767 fMSFBOType = kES_Apple_MSFBOType; | 769 fMSFBOType = kES_Apple_MSFBOType; |
768 } | 770 } |
| 771 |
| 772 // Above determined the preferred MSAA approach, now decide whether glBl
itFramebuffer |
| 773 // is available. |
| 774 if (ctxInfo.version() >= GR_GL_VER(3, 0)) { |
| 775 fBlitFramebufferSupport = kFull_BlitFramebufferSupport; |
| 776 } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample"))
{ |
| 777 // The CHROMIUM extension uses the ANGLE version of glBlitFramebuffe
r and includes its |
| 778 // limitations. |
| 779 fBlitFramebufferSupport = kNoScalingNoMirroring_BlitFramebufferSuppo
rt; |
| 780 } |
769 } else { | 781 } else { |
770 if (fUsesMixedSamples) { | 782 if (fUsesMixedSamples) { |
771 fMSFBOType = kMixedSamples_MSFBOType; | 783 fMSFBOType = kMixedSamples_MSFBOType; |
| 784 fBlitFramebufferSupport = kFull_BlitFramebufferSupport; |
772 } else if ((ctxInfo.version() >= GR_GL_VER(3,0)) || | 785 } else if ((ctxInfo.version() >= GR_GL_VER(3,0)) || |
773 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { | 786 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { |
774 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType; | 787 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType; |
| 788 fBlitFramebufferSupport = kFull_BlitFramebufferSupport; |
775 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") && | 789 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") && |
776 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) { | 790 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) { |
777 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType; | 791 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType; |
| 792 fBlitFramebufferSupport = kFull_BlitFramebufferSupport; |
778 } | 793 } |
779 } | 794 } |
780 } | 795 } |
781 | 796 |
782 void GrGLCaps::initBlendEqationSupport(const GrGLContextInfo& ctxInfo) { | 797 void GrGLCaps::initBlendEqationSupport(const GrGLContextInfo& ctxInfo) { |
783 GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get()); | 798 GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get()); |
784 | 799 |
785 // Disabling advanced blend on various platforms with major known issues. We
also block Chrome | 800 // Disabling advanced blend on various platforms with major known issues. We
also block Chrome |
786 // for now until its own blacklists can be updated. | 801 // for now until its own blacklists can be updated. |
787 if (kAdreno4xx_GrGLRenderer == ctxInfo.renderer() || | 802 if (kAdreno4xx_GrGLRenderer == ctxInfo.renderer() || |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1664 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { | 1679 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { |
1665 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != | 1680 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != |
1666 fConfigTable[i].fFormats.fExternalFormat[j]); | 1681 fConfigTable[i].fFormats.fExternalFormat[j]); |
1667 } | 1682 } |
1668 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); | 1683 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); |
1669 } | 1684 } |
1670 #endif | 1685 #endif |
1671 } | 1686 } |
1672 | 1687 |
1673 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} | 1688 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} |
OLD | NEW |