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