Loading libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp +12 −6 Original line number Diff line number Diff line Loading @@ -66,20 +66,26 @@ bool SkiaOpenGLPipeline::draw(const Frame& frame, const SkRect& screenDirty, con FrameInfoVisualizer* profiler) { mEglManager.damageFrame(frame, dirty); SkColorType colorType; // setup surface for fbo0 GrGLFramebufferInfo fboInfo; fboInfo.fFBOID = 0; GrPixelConfig pixelConfig = wideColorGamut ? kRGBA_half_GrPixelConfig : kRGBA_8888_GrPixelConfig; if (wideColorGamut) { fboInfo.fFormat = GL_RGBA16F; colorType = kRGBA_F16_SkColorType; } else { fboInfo.fFormat = GL_RGBA8; colorType = kN32_SkColorType; } GrBackendRenderTarget backendRT(frame.width(), frame.height(), 0, STENCIL_BUFFER_SIZE, pixelConfig, fboInfo); GrBackendRenderTarget backendRT(frame.width(), frame.height(), 0, STENCIL_BUFFER_SIZE, fboInfo); SkSurfaceProps props(0, kUnknown_SkPixelGeometry); SkASSERT(mRenderThread.getGrContext() != nullptr); sk_sp<SkSurface> surface(SkSurface::MakeFromBackendRenderTarget( mRenderThread.getGrContext(), backendRT, kBottomLeft_GrSurfaceOrigin, nullptr, &props)); mRenderThread.getGrContext(), backendRT, kBottomLeft_GrSurfaceOrigin, colorType, nullptr, &props)); SkiaPipeline::updateLighting(lightGeometry, lightInfo); renderFrame(*layerUpdateQueue, dirty, renderNodes, opaque, wideColorGamut, contentDrawBounds, Loading Loading @@ -285,7 +291,7 @@ sk_sp<Bitmap> SkiaOpenGLPipeline::allocateHardwareBitmap(renderthread::RenderThr type = GL_UNSIGNED_BYTE; break; case kRGBA_F16_SkColorType: isSupported = grContext->caps()->isConfigTexturable(kRGBA_half_GrPixelConfig); isSupported = grContext->colorTypeSupportedAsImage(kRGBA_F16_SkColorType); if (isSupported) { type = GL_HALF_FLOAT; pixelFormat = PIXEL_FORMAT_RGBA_FP16; Loading libs/hwui/pipeline/skia/SkiaOpenGLReadback.cpp +11 −12 Original line number Diff line number Diff line Loading @@ -50,32 +50,31 @@ CopyResult SkiaOpenGLReadback::copyImageInto(EGLImageKHR eglImage, const Matrix4 grContext->resetContext(); } if (bitmap->colorType() == kRGBA_F16_SkColorType && !grContext->colorTypeSupportedAsSurface(bitmap->colorType())) { ALOGW("Can't copy surface into bitmap, RGBA_F16 config is not supported"); return CopyResult::DestinationInvalid; } GrGLTextureInfo externalTexture; externalTexture.fTarget = GL_TEXTURE_EXTERNAL_OES; externalTexture.fID = sourceTexId; GrPixelConfig pixelConfig; switch (bitmap->colorType()) { case kRGBA_F16_SkColorType: pixelConfig = kRGBA_half_GrPixelConfig; externalTexture.fFormat = GL_RGBA16F; break; case kN32_SkColorType: default: pixelConfig = kRGBA_8888_GrPixelConfig; externalTexture.fFormat = GL_RGBA8; break; } if (pixelConfig == kRGBA_half_GrPixelConfig && !grContext->caps()->isConfigRenderable(kRGBA_half_GrPixelConfig, false)) { ALOGW("Can't copy surface into bitmap, RGBA_F16 config is not supported"); return CopyResult::DestinationInvalid; } GrBackendTexture backendTexture(imgWidth, imgHeight, pixelConfig, externalTexture); GrBackendTexture backendTexture(imgWidth, imgHeight, GrMipMapped::kNo, externalTexture); CopyResult copyResult = CopyResult::UnknownError; sk_sp<SkImage> image(SkImage::MakeFromAdoptedTexture(grContext.get(), backendTexture, kTopLeft_GrSurfaceOrigin)); kTopLeft_GrSurfaceOrigin, bitmap->colorType())); if (image) { int displayedWidth = imgWidth, displayedHeight = imgHeight; // If this is a 90 or 270 degree rotation we need to swap width/height to get the device Loading libs/hwui/renderthread/VulkanManager.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -320,7 +320,8 @@ void VulkanManager::createBuffers(VulkanSurface* surface, VkFormat format, VkExt VulkanSurface::ImageInfo& imageInfo = surface->mImageInfos[i]; imageInfo.mSurface = SkSurface::MakeFromBackendRenderTarget( mRenderThread.getGrContext(), backendRT, kTopLeft_GrSurfaceOrigin, nullptr, &props); mRenderThread.getGrContext(), backendRT, kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType, nullptr, &props); } SkASSERT(mCommandPool != VK_NULL_HANDLE); Loading Loading
libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp +12 −6 Original line number Diff line number Diff line Loading @@ -66,20 +66,26 @@ bool SkiaOpenGLPipeline::draw(const Frame& frame, const SkRect& screenDirty, con FrameInfoVisualizer* profiler) { mEglManager.damageFrame(frame, dirty); SkColorType colorType; // setup surface for fbo0 GrGLFramebufferInfo fboInfo; fboInfo.fFBOID = 0; GrPixelConfig pixelConfig = wideColorGamut ? kRGBA_half_GrPixelConfig : kRGBA_8888_GrPixelConfig; if (wideColorGamut) { fboInfo.fFormat = GL_RGBA16F; colorType = kRGBA_F16_SkColorType; } else { fboInfo.fFormat = GL_RGBA8; colorType = kN32_SkColorType; } GrBackendRenderTarget backendRT(frame.width(), frame.height(), 0, STENCIL_BUFFER_SIZE, pixelConfig, fboInfo); GrBackendRenderTarget backendRT(frame.width(), frame.height(), 0, STENCIL_BUFFER_SIZE, fboInfo); SkSurfaceProps props(0, kUnknown_SkPixelGeometry); SkASSERT(mRenderThread.getGrContext() != nullptr); sk_sp<SkSurface> surface(SkSurface::MakeFromBackendRenderTarget( mRenderThread.getGrContext(), backendRT, kBottomLeft_GrSurfaceOrigin, nullptr, &props)); mRenderThread.getGrContext(), backendRT, kBottomLeft_GrSurfaceOrigin, colorType, nullptr, &props)); SkiaPipeline::updateLighting(lightGeometry, lightInfo); renderFrame(*layerUpdateQueue, dirty, renderNodes, opaque, wideColorGamut, contentDrawBounds, Loading Loading @@ -285,7 +291,7 @@ sk_sp<Bitmap> SkiaOpenGLPipeline::allocateHardwareBitmap(renderthread::RenderThr type = GL_UNSIGNED_BYTE; break; case kRGBA_F16_SkColorType: isSupported = grContext->caps()->isConfigTexturable(kRGBA_half_GrPixelConfig); isSupported = grContext->colorTypeSupportedAsImage(kRGBA_F16_SkColorType); if (isSupported) { type = GL_HALF_FLOAT; pixelFormat = PIXEL_FORMAT_RGBA_FP16; Loading
libs/hwui/pipeline/skia/SkiaOpenGLReadback.cpp +11 −12 Original line number Diff line number Diff line Loading @@ -50,32 +50,31 @@ CopyResult SkiaOpenGLReadback::copyImageInto(EGLImageKHR eglImage, const Matrix4 grContext->resetContext(); } if (bitmap->colorType() == kRGBA_F16_SkColorType && !grContext->colorTypeSupportedAsSurface(bitmap->colorType())) { ALOGW("Can't copy surface into bitmap, RGBA_F16 config is not supported"); return CopyResult::DestinationInvalid; } GrGLTextureInfo externalTexture; externalTexture.fTarget = GL_TEXTURE_EXTERNAL_OES; externalTexture.fID = sourceTexId; GrPixelConfig pixelConfig; switch (bitmap->colorType()) { case kRGBA_F16_SkColorType: pixelConfig = kRGBA_half_GrPixelConfig; externalTexture.fFormat = GL_RGBA16F; break; case kN32_SkColorType: default: pixelConfig = kRGBA_8888_GrPixelConfig; externalTexture.fFormat = GL_RGBA8; break; } if (pixelConfig == kRGBA_half_GrPixelConfig && !grContext->caps()->isConfigRenderable(kRGBA_half_GrPixelConfig, false)) { ALOGW("Can't copy surface into bitmap, RGBA_F16 config is not supported"); return CopyResult::DestinationInvalid; } GrBackendTexture backendTexture(imgWidth, imgHeight, pixelConfig, externalTexture); GrBackendTexture backendTexture(imgWidth, imgHeight, GrMipMapped::kNo, externalTexture); CopyResult copyResult = CopyResult::UnknownError; sk_sp<SkImage> image(SkImage::MakeFromAdoptedTexture(grContext.get(), backendTexture, kTopLeft_GrSurfaceOrigin)); kTopLeft_GrSurfaceOrigin, bitmap->colorType())); if (image) { int displayedWidth = imgWidth, displayedHeight = imgHeight; // If this is a 90 or 270 degree rotation we need to swap width/height to get the device Loading
libs/hwui/renderthread/VulkanManager.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -320,7 +320,8 @@ void VulkanManager::createBuffers(VulkanSurface* surface, VkFormat format, VkExt VulkanSurface::ImageInfo& imageInfo = surface->mImageInfos[i]; imageInfo.mSurface = SkSurface::MakeFromBackendRenderTarget( mRenderThread.getGrContext(), backendRT, kTopLeft_GrSurfaceOrigin, nullptr, &props); mRenderThread.getGrContext(), backendRT, kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType, nullptr, &props); } SkASSERT(mCommandPool != VK_NULL_HANDLE); Loading