From a6359365887048ef055196de75591311d7a015f0 Mon Sep 17 00:00:00 2001 From: brianosman Date: Mon, 21 Mar 2016 06:55:37 -0700 Subject: sRGB support in Ganesh. Several pieces: sRGB support now also requires GL_EXT_texture_sRGB_decode, which allows us to disable sRGB -> Linear conversion when reading textures. This gives us an easy way to support "legacy" L32 mode. We disable decoding based on the pixel config of the render target. Textures can override that behavior (specifically for format-conversion draws where we want that behavior). Added sBGRA pixel config, which is not-really-a-format. It's just sRGBA internally, and the external format is BGR order, so TexImage calls will swizzle correctly. This lets us interact with sRGB raster surfaces on BGR platforms. Devices without sRGB support behave like they always have: conversion from color type and profile type ignores sRGB and always returns linear pixel configs. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1789663002 Review URL: https://codereview.chromium.org/1789663002 --- example/HelloWorld.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'example/HelloWorld.cpp') diff --git a/example/HelloWorld.cpp b/example/HelloWorld.cpp index bb29a0c3f5..892dce1c80 100644 --- a/example/HelloWorld.cpp +++ b/example/HelloWorld.cpp @@ -157,7 +157,8 @@ void HelloWorldWindow::draw(SkCanvas* canvas) { fRenderTarget->writePixels(0, 0, snap->width(), snap->height(), SkImageInfo2GrPixelConfig(info.colorType(), info.alphaType(), - info.profileType()), + info.profileType(), + *fContext->caps()), pmap.addr(), pmap.rowBytes(), GrContext::kFlushWrites_PixelOp); -- cgit v1.2.3