skia2/include/gpu
brianosman 33f6b3f6ee Manually generated sRGB mipmaps, with successively smaller draws.
Dirty GL-generated mipmaps whenever an sRGB texture is used with a new
value for TEXTURE_SRGB_DECODE. Add a new test rectangle to the gamma GM
that tests that textures are correctly converted to linear before
filtering when generating mipmaps.

Added a new unit test that alternates how a texture is interpreted (sRGB
or not), to verify that we rebuild mipmaps when needed, and that we get
the correct results out in both modes.

This test originally failed on four of our bots producing incorrect mips
in three different ways. I'm not real surprised, but it looks like
we can't rely on glGenerateMipmap to do the right thing, in conjunction
with TEXTURE_SRGB_DECODE.

Instead, actually create mip-chains using a series of draw calls.
(My first attempt used glBlitFramebuffer, and that still had bugs on
several bots). This approach appears to work correctly on any device
that fully supports sRGB.

Because the mipmap draws are fairly destructive to state, I had to
hoist them out of bindTexture. That means adding a second pass over
the texture accesses in the processor, at the very beginning of flush.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1840473002

Review-Url: https://codereview.chromium.org/2007973002
2016-06-02 05:49:21 -07:00
..
effects Remove hasMixedSamples() from GrPipelineBuilder 2016-05-06 09:41:16 -07:00
gl Enable NV_path_rendering in the Null GL. 2016-04-20 00:36:53 -07:00
vk Add offset to memory allocations 2016-06-01 09:39:15 -07:00
GrBlend.h Create fragment processor for performing input color blend with child processor 2015-09-15 15:33:27 -07:00
GrBuffer.h Refactor to separate backend object lifecycle and GpuResource budget decision 2016-04-22 01:48:29 -07:00
GrBufferAccess.h Implement texel buffers 2016-04-11 14:47:28 -07:00
GrCaps.h Simplify GrSWMaskHelper 2016-05-13 05:47:23 -07:00
GrClip.h Make GrAppliedClip friendless 2016-05-19 11:36:25 -07:00
GrColor.h sRGB support in Ganesh. Several pieces: 2016-03-21 06:55:37 -07:00
GrConfig.h Repurpose Release_Developer BUILDTYPE and remove SK_DEVELOPER. 2016-04-29 06:41:35 -07:00
GrContext.h Retract GrRenderTarget from GrTestTarget 2016-05-20 11:14:33 -07:00
GrContextOptions.h Simplify GrSWMaskHelper 2016-05-13 05:47:23 -07:00
GrCoordTransform.h some utils for rect and matrix 2015-03-13 06:08:28 -07:00
GrDrawContext.h Retract GrRenderTarget from GrTestTarget 2016-05-20 11:14:33 -07:00
GrFragmentProcessor.h Implement texel buffers 2016-04-11 14:47:28 -07:00
GrGpuResource.h Refactor to separate backend object lifecycle and GpuResource budget decision 2016-04-22 01:48:29 -07:00
GrGpuResourceRef.h apply mozilla patch 2015-11-10 04:55:08 -08:00
GrInvariantOutput.h Make skpaint->grpaint flow work for composing draws (verts and atlas) 2015-09-28 06:26:29 -07:00
GrPaint.h Tweak distance field path renderer behavior in gamma-correct mode to match 2016-04-13 13:56:21 -07:00
GrProcessor.h remove non-static uses of SkOncePtr 2016-05-02 07:19:41 -07:00
GrProcessorUnitTest.h Retract GrRenderTarget from GLProgramsTest 2016-05-19 14:01:05 -07:00
GrProgramElement.h Move SkTArray to include/private. 2016-02-17 13:13:44 -08:00
GrRenderTarget.h Add Gr*Proxy classes 2016-05-04 12:47:41 -07:00
GrResourceKey.h Modernize and trim down SkOnce. 2016-04-18 08:09:11 -07:00
GrShaderVar.h Refactor how we store and use samplers in Ganesh 2016-04-20 07:09:46 -07:00
GrSurface.h Added --deepColor option to SampleApp, triggers creation of a ten-bit/channel 2016-05-05 12:24:31 -07:00
GrTestUtils.h Replace GrStrokeInfo with GrStyle. 2016-05-10 09:14:17 -07:00
GrTexture.h Manually generated sRGB mipmaps, with successively smaller draws. 2016-06-02 05:49:21 -07:00
GrTextureAccess.h Infer sampler precision from pixel config 2016-04-11 12:03:08 -07:00
GrTextureParams.h Remove sRGB overrides on GrTextureParams. Use GrPaint flags instead. 2016-05-24 06:18:48 -07:00
GrTextureProvider.h Remove some unnecessary #includes of SkImageFilter.h 2016-04-22 07:36:12 -07:00
GrTypes.h Remove GrTextureStorageAllocator. This was added from Chromium but never used and not expected to be used. 2016-04-13 14:29:25 -07:00
GrTypesPriv.h Convert GrClip to an abstract base class 2016-05-13 10:25:00 -07:00
GrXferProcessor.h Remove hasMixedSamples() from GrPipelineBuilder 2016-05-06 09:41:16 -07:00
SkGr.h sRGB support in Ganesh. Several pieces: 2016-03-21 06:55:37 -07:00
SkGrPixelRef.h Make SkBitmap::CopyTo respect requested dst color type when bitmap is texture backed. 2016-01-11 11:14:17 -08:00
SkGrTexturePixelRef.h Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00