summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Stan Iliev <stani@google.com> 2017-10-31 11:47:54 -0400
committer Stan Iliev <stani@google.com> 2017-10-31 11:47:54 -0400
commit7475d0f8dba8040dfeaf5278dbf83d4f964f8a65 (patch)
tree19bee9db12d4fcf6cc18bec4c69a179315e40c9a
parent1eb19a3b87836af92fc989c1afa56ad4febd716b (diff)
Fix testWindowProducerCopyToRGBA16F test on x86 emulator
Fix readback to return correct error code on X86 emulator, when half float pixel format is not supported. Test: Ran and passed all CtsViewTestCases tests on x86 emulator Bug: 68383159 Change-Id: Id66484b73488e2c8d29fbecbd45a97af285a0710
-rw-r--r--libs/hwui/Extensions.cpp5
-rw-r--r--libs/hwui/pipeline/skia/SkiaOpenGLReadback.cpp2
2 files changed, 4 insertions, 3 deletions
diff --git a/libs/hwui/Extensions.cpp b/libs/hwui/Extensions.cpp
index 6b8006cc5a33..115dcb656f66 100644
--- a/libs/hwui/Extensions.cpp
+++ b/libs/hwui/Extensions.cpp
@@ -31,10 +31,11 @@ namespace android {
namespace uirenderer {
Extensions::Extensions() {
- if (Properties::getRenderPipelineType() != RenderPipelineType::OpenGL) {
- //Extensions class is used only by OpenGL pipeline
+ 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
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 75967e9f6503..9982a0cfe2bf 100644
--- a/libs/hwui/pipeline/skia/SkiaOpenGLReadback.cpp
+++ b/libs/hwui/pipeline/skia/SkiaOpenGLReadback.cpp
@@ -73,7 +73,7 @@ CopyResult SkiaOpenGLReadback::copyImageInto(EGLImageKHR eglImage, const Matrix4
* for reading back float buffers (skbug.com/6945).
*/
if (pixelConfig == kRGBA_half_GrPixelConfig &&
- !grContext->caps()->isConfigTexturable(kRGBA_half_GrPixelConfig)) {
+ !DeviceInfo::get()->extensions().hasFloatTextures()) {
ALOGW("Can't copy surface into bitmap, RGBA_F16 config is not supported");
return CopyResult::DestinationInvalid;
}