diff options
| author | 2022-04-13 01:29:37 +0000 | |
|---|---|---|
| committer | 2022-04-13 01:29:37 +0000 | |
| commit | ec839b2eb8cf7c34935a2f0cce085cfd9701c719 (patch) | |
| tree | f42ac0f43d80413c127b6ad7a8157e77cc077692 | |
| parent | 43f42ced370338f4139c42a6aed3493d5ddcdb5e (diff) | |
| parent | c63c5b21e8a7495d116b0ba87b25cd02a7dd4f7a (diff) | |
Merge "GLFunctorDrawable: skip alpha filtering" into tm-dev
| -rw-r--r-- | libs/hwui/pipeline/skia/GLFunctorDrawable.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp b/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp index ab00dd5a487c..dc72aead4873 100644 --- a/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp +++ b/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp @@ -61,6 +61,17 @@ void GLFunctorDrawable::onDraw(SkCanvas* canvas) { return; } + // canvas may be an AlphaFilterCanvas, which is intended to draw with a + // modified alpha. We do not have a way to do this without drawing into an + // extra layer, which would have a performance cost. Draw directly into the + // underlying gpu canvas. This matches prior behavior and the behavior in + // Vulkan. + { + auto* gpuCanvas = SkAndroidFrameworkUtils::getBaseWrappedCanvas(canvas); + LOG_ALWAYS_FATAL_IF(!gpuCanvas, "GLFunctorDrawable::onDraw is using an invalid canvas!"); + canvas = gpuCanvas; + } + // flush will create a GrRenderTarget if not already present. canvas->flush(); |