diff options
author | 2017-11-09 12:17:35 -0500 | |
---|---|---|
committer | 2017-11-09 12:56:34 -0500 | |
commit | f1f3c38908f7951745b5c16427e3f50dce6cb662 (patch) | |
tree | 4a53a1e7078e68d4f5d2ed13838d607efb028095 | |
parent | a3e562cd8f0abdeabe05942400dae9e0d8a4e308 (diff) |
Use Skia API to detect if FP16 render buffer is supported
Use Skia GrCaps to detect if we can render into a FP16 buffer.
Exclude Extension class initialization from SkiaGL pipeline.
Bug: 68383159
Test: Passed testWindowProducerCopyToRGBA16F on gce_x86_phone emu
Change-Id: I3355bad891ed5403fbd94d18bb8ba110a3b77325
-rw-r--r-- | libs/hwui/Extensions.cpp | 6 | ||||
-rw-r--r-- | libs/hwui/pipeline/skia/SkiaOpenGLReadback.cpp | 8 |
2 files changed, 2 insertions, 12 deletions
diff --git a/libs/hwui/Extensions.cpp b/libs/hwui/Extensions.cpp index b7f1fb21d8d7..530e82e65a28 100644 --- a/libs/hwui/Extensions.cpp +++ b/libs/hwui/Extensions.cpp @@ -31,11 +31,7 @@ namespace android { namespace uirenderer { Extensions::Extensions() { - if (Properties::getRenderPipelineType() == RenderPipelineType::SkiaVulkan) { - // Extensions class is used only by OpenGL and SkiaGL pipelines - // The code below will crash for SkiaVulkan, because OpenGL is not initialized - // TODO: instantiate Extensions class only for OpenGL pipeline - // TODO: remove the only usage of Extensions by SkiaGL in SkiaOpenGLReadback::copyImageInto + if (Properties::isSkiaEnabled()) { return; } const char* version = (const char*)glGetString(GL_VERSION); diff --git a/libs/hwui/pipeline/skia/SkiaOpenGLReadback.cpp b/libs/hwui/pipeline/skia/SkiaOpenGLReadback.cpp index 6db57cade19b..288d0395370c 100644 --- a/libs/hwui/pipeline/skia/SkiaOpenGLReadback.cpp +++ b/libs/hwui/pipeline/skia/SkiaOpenGLReadback.cpp @@ -66,14 +66,8 @@ CopyResult SkiaOpenGLReadback::copyImageInto(EGLImageKHR eglImage, const Matrix4 break; } - /* Ideally, we would call grContext->caps()->isConfigRenderable(...). We - * currently can't do that since some devices (i.e. SwiftShader) supports all - * the appropriate half float extensions, but only allow the buffer to be read - * back as full floats. We can relax this extension if Skia implements support - * for reading back float buffers (skbug.com/6945). - */ if (pixelConfig == kRGBA_half_GrPixelConfig && - !DeviceInfo::get()->extensions().hasRenderableFloatTextures()) { + !grContext->caps()->isConfigRenderable(kRGBA_half_GrPixelConfig, false)) { ALOGW("Can't copy surface into bitmap, RGBA_F16 config is not supported"); return CopyResult::DestinationInvalid; } |