[canvaskit] Disable getError calls for webGL

getError is known to be problematic for performance on Chrome
because it is synchronous. Disabling this should improve
performance in several cases.

Change-Id: I0d4a68ddb9625f09d7427e3c5f36883352c4f995
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289779
Reviewed-by: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Kevin Lubick 2020-05-14 09:04:30 -04:00
parent 0c8884b6b4
commit c2e80e132e
2 changed files with 6 additions and 1 deletions

View File

@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- CanvasKit colors are now represented with a TypedArray of four floats.
- Safari now defaults to using WebGL1 instead of WebGL2 (skbug.com/10171)
- Calls to `getError` should be disabled. This may cause a performance improvement in some scenarios.
### Removed
- SkPaint.setColorf is obsolete and removed. setColor accepts a CanvasKit color which is
@ -30,7 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Deprecated
- `SkCanvas.concat44` has been folded into concat (which now takes 3x2, 3x3, or 4x4 matrices). It will
be removed soon.
### Fixed
- Memory leak in paragraph binding code (https://github.com/flutter/flutter/issues/56938)

View File

@ -335,6 +335,10 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
} // No WebGL support
fSkipErrorChecks = ctxInfo.driver() == kChromium_GrGLDriver;
if (GR_IS_GR_WEBGL(standard)) {
// Error checks are quite costly in webgl, especially in Chrome.
fSkipErrorChecks = true;
}
/**************************************************************************
* GrShaderCaps fields