| 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 28 matching lines...) Expand all Loading... |
| 39 fTwoFormatLimit = false; | 39 fTwoFormatLimit = false; |
| 40 fVertexArrayObjectSupport = false; | 40 fVertexArrayObjectSupport = false; |
| 41 fInstancedDrawingSupport = false; | 41 fInstancedDrawingSupport = false; |
| 42 fDirectStateAccessSupport = false; | 42 fDirectStateAccessSupport = false; |
| 43 fDebugSupport = false; | 43 fDebugSupport = false; |
| 44 fES2CompatibilitySupport = false; | 44 fES2CompatibilitySupport = false; |
| 45 fMultisampleDisableSupport = false; | 45 fMultisampleDisableSupport = false; |
| 46 fUseNonVBOVertexAndIndexDynamicData = false; | 46 fUseNonVBOVertexAndIndexDynamicData = false; |
| 47 fIsCoreProfile = false; | 47 fIsCoreProfile = false; |
| 48 fBindFragDataLocationSupport = false; | 48 fBindFragDataLocationSupport = false; |
| 49 fExternalTextureSupport = false; |
| 49 fSRGBWriteControl = false; | 50 fSRGBWriteControl = false; |
| 50 fRGBA8888PixelsOpsAreSlow = false; | 51 fRGBA8888PixelsOpsAreSlow = false; |
| 51 fPartialFBOReadIsSlow = false; | 52 fPartialFBOReadIsSlow = false; |
| 52 | 53 |
| 53 fReadPixelsSupportedCache.reset(); | 54 fReadPixelsSupportedCache.reset(); |
| 54 | 55 |
| 55 fShaderCaps.reset(new GrGLSLCaps(contextOptions)); | 56 fShaderCaps.reset(new GrGLSLCaps(contextOptions)); |
| 56 | 57 |
| 57 this->init(contextOptions, ctxInfo, glInterface); | 58 this->init(contextOptions, ctxInfo, glInterface); |
| 58 } | 59 } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 fBindFragDataLocationSupport = true; | 253 fBindFragDataLocationSupport = true; |
| 253 } | 254 } |
| 254 } | 255 } |
| 255 | 256 |
| 256 #if 0 // Disabled due to https://bug.skia.org/4454 | 257 #if 0 // Disabled due to https://bug.skia.org/4454 |
| 257 fBindUniformLocationSupport = ctxInfo.hasExtension("GL_CHROMIUM_bind_uniform
_location"); | 258 fBindUniformLocationSupport = ctxInfo.hasExtension("GL_CHROMIUM_bind_uniform
_location"); |
| 258 #else | 259 #else |
| 259 fBindUniformLocationSupport = false; | 260 fBindUniformLocationSupport = false; |
| 260 #endif | 261 #endif |
| 261 | 262 |
| 263 if (ctxInfo.hasExtension("GL_OES_EGL_image_external")) { |
| 264 if (ctxInfo.glslGeneration() == k110_GrGLSLGeneration) { |
| 265 fExternalTextureSupport = true; |
| 266 } else if (ctxInfo.hasExtension("GL_OES_EGL_image_external_essl3") || |
| 267 ctxInfo.hasExtension("OES_EGL_image_external_essl3")) { |
| 268 // At least one driver has been found that has this extension withou
t the "GL_" prefix. |
| 269 fExternalTextureSupport = true; |
| 270 } |
| 271 } |
| 272 |
| 262 #ifdef SK_BUILD_FOR_WIN | 273 #ifdef SK_BUILD_FOR_WIN |
| 263 // We're assuming that on Windows Chromium we're using ANGLE. | 274 // We're assuming that on Windows Chromium we're using ANGLE. |
| 264 bool isANGLE = kANGLE_GrGLDriver == ctxInfo.driver() || | 275 bool isANGLE = kANGLE_GrGLDriver == ctxInfo.driver() || |
| 265 kChromium_GrGLDriver == ctxInfo.driver(); | 276 kChromium_GrGLDriver == ctxInfo.driver(); |
| 266 // Angle has slow read/write pixel paths for 32bit RGBA (but fast for BGRA).
| 277 // Angle has slow read/write pixel paths for 32bit RGBA (but fast for BGRA).
|
| 267 fRGBA8888PixelsOpsAreSlow = isANGLE; | 278 fRGBA8888PixelsOpsAreSlow = isANGLE; |
| 268 // On DX9 ANGLE reading a partial FBO is slow. TODO: Check whether this is s
till true and | 279 // On DX9 ANGLE reading a partial FBO is slow. TODO: Check whether this is s
till true and |
| 269 // check DX11 ANGLE. | 280 // check DX11 ANGLE. |
| 270 fPartialFBOReadIsSlow = isANGLE; | 281 fPartialFBOReadIsSlow = isANGLE; |
| 271 #endif | 282 #endif |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 kGLES_GrGLStandard != standard && | 592 kGLES_GrGLStandard != standard && |
| 582 (ctxInfo.glslGeneration() >= k150_GrGLSLGeneration || | 593 (ctxInfo.glslGeneration() >= k150_GrGLSLGeneration || |
| 583 ctxInfo.hasExtension("GL_ARB_fragment_coord_conventions"))) { | 594 ctxInfo.hasExtension("GL_ARB_fragment_coord_conventions"))) { |
| 584 glslCaps->fFragCoordConventionsExtensionString = "GL_ARB_fragment_coord_
conventions"; | 595 glslCaps->fFragCoordConventionsExtensionString = "GL_ARB_fragment_coord_
conventions"; |
| 585 } | 596 } |
| 586 | 597 |
| 587 if (kGLES_GrGLStandard == standard) { | 598 if (kGLES_GrGLStandard == standard) { |
| 588 glslCaps->fSecondaryOutputExtensionString = "GL_EXT_blend_func_extended"
; | 599 glslCaps->fSecondaryOutputExtensionString = "GL_EXT_blend_func_extended"
; |
| 589 } | 600 } |
| 590 | 601 |
| 602 if (fExternalTextureSupport) { |
| 603 if (ctxInfo.glslGeneration() == k110_GrGLSLGeneration) { |
| 604 glslCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_extern
al"; |
| 605 } else { |
| 606 glslCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_extern
al_essl3"; |
| 607 } |
| 608 } |
| 609 |
| 591 // The Tegra3 compiler will sometimes never return if we have min(abs(x), 1.
0), so we must do | 610 // The Tegra3 compiler will sometimes never return if we have min(abs(x), 1.
0), so we must do |
| 592 // the abs first in a separate expression. | 611 // the abs first in a separate expression. |
| 593 if (kTegra3_GrGLRenderer == ctxInfo.renderer()) { | 612 if (kTegra3_GrGLRenderer == ctxInfo.renderer()) { |
| 594 glslCaps->fCanUseMinAndAbsTogether = false; | 613 glslCaps->fCanUseMinAndAbsTogether = false; |
| 595 } | 614 } |
| 596 | 615 |
| 597 // On Intel GPU there is an issue where it reads the second arguement to ata
n "- %s.x" as an int | 616 // On Intel GPU there is an issue where it reads the second argument to atan
"- %s.x" as an int |
| 598 // thus must us -1.0 * %s.x to work correctly | 617 // thus must us -1.0 * %s.x to work correctly |
| 599 if (kIntel_GrGLVendor == ctxInfo.vendor()) { | 618 if (kIntel_GrGLVendor == ctxInfo.vendor()) { |
| 600 glslCaps->fMustForceNegatedAtanParamToFloat = true; | 619 glslCaps->fMustForceNegatedAtanParamToFloat = true; |
| 601 } | 620 } |
| 602 } | 621 } |
| 603 | 622 |
| 604 bool GrGLCaps::hasPathRenderingSupport(const GrGLContextInfo& ctxInfo, const GrG
LInterface* gli) { | 623 bool GrGLCaps::hasPathRenderingSupport(const GrGLContextInfo& ctxInfo, const GrG
LInterface* gli) { |
| 605 bool hasChromiumPathRendering = ctxInfo.hasExtension("GL_CHROMIUM_path_rende
ring"); | 624 bool hasChromiumPathRendering = ctxInfo.hasExtension("GL_CHROMIUM_path_rende
ring"); |
| 606 | 625 |
| 607 if (!(ctxInfo.hasExtension("GL_NV_path_rendering") || hasChromiumPathRenderi
ng)) { | 626 if (!(ctxInfo.hasExtension("GL_NV_path_rendering") || hasChromiumPathRenderi
ng)) { |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1315 glslCaps->fConfigSwizzle[kR11_EAC_GrPixelConfig] = "rrrr"; | 1334 glslCaps->fConfigSwizzle[kR11_EAC_GrPixelConfig] = "rrrr"; |
| 1316 glslCaps->fConfigSwizzle[kASTC_12x12_GrPixelConfig] = "rgba"; | 1335 glslCaps->fConfigSwizzle[kASTC_12x12_GrPixelConfig] = "rgba"; |
| 1317 glslCaps->fConfigSwizzle[kRGBA_float_GrPixelConfig] = "rgba"; | 1336 glslCaps->fConfigSwizzle[kRGBA_float_GrPixelConfig] = "rgba"; |
| 1318 glslCaps->fConfigSwizzle[kRGBA_half_GrPixelConfig] = "rgba"; | 1337 glslCaps->fConfigSwizzle[kRGBA_half_GrPixelConfig] = "rgba"; |
| 1319 | 1338 |
| 1320 } | 1339 } |
| 1321 | 1340 |
| 1322 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} | 1341 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} |
| 1323 | 1342 |
| 1324 | 1343 |
| OLD | NEW |