diff options
author | Greg Daniel <egdaniel@google.com> | 2018-03-21 10:50:24 -0400 |
---|---|---|
committer | Greg Daniel <egdaniel@google.com> | 2018-03-21 18:09:59 +0000 |
commit | c9da8e8b4b1bcf1954661ebb384ecf4c7200221f (patch) | |
tree | 59119e8ddd8ea6c8aed3b5d9ec13ef844f499faf /libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp | |
parent | 1d748402a9c3d59d697c3a9c1fb06cbccf293d71 (diff) |
Convert Skia calls to use SkColorType/BackendFormats instead of GrPixelConfig.
Test: manual testing
Change-Id: I645bcea55f49292309cf0bb5de21891bb5b62dda
Diffstat (limited to 'libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp')
-rw-r--r-- | libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp b/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp index 365d7403e046..b258bbdf289c 100644 --- a/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp +++ b/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp @@ -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, @@ -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; |