History log of /frameworks/base/libs/hwui/GlopBuilder.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
5462b79d9fd787ab189bcd29b591ca72f900220f 28-Jun-2017 John Reck <jreck@google.com> Selectively disable filtering if estimated safe

If the output matches the source rect then use
GL_NEAREST instead of GL_FILTER. This is a more
pixel-exact capture.

Bug: 38242146
Test: CtsUiRendering & CtsViewTestCases:.PixelCopyTest passes on fugu
Change-Id: I9f57a4124374568f83d45fdc8f83cc767ded888a
(cherry picked from commit 7bf96a0a6f4824f2d15ec95249b8ff038fe02239)
/frameworks/base/libs/hwui/GlopBuilder.cpp
55455181233cadcd6d2e28d28d0dfc9a653f7787 16-Apr-2017 Romain Guy <romainguy@google.com> Properly decode colors spaces in BitmapRegionDecoder

Reusing a bitmap with BitmapRegionDecoder would preserve the
previous color space. This change also tweaks color space
matching to make sure we pick Display P3 with parameter d=0.039
or d=0.04045

Bug: 36905374
Test: CtsGraphicsTestCases
Change-Id: I4d2d66e5babebb0b5ce5cbdc7e8244177b4b7f9c
/frameworks/base/libs/hwui/GlopBuilder.cpp
caaaa66e57293e4a6f312649bf472eab84d5c7fe 27-Mar-2017 Romain Guy <romainguy@google.com> Convert bitmaps to sRGB/scRGB when they have a color profile

This change also fixes an issue with RGBA16F bitmaps when modulated
with a color (for instance by setting an alpha on the Paint object).

The color space conversion is currently done entirely in the shader,
by doing these operations in order:

1. Sample the texture
2. Un-premultiply alpha
3. Apply the EOTF
4. Multiply by the 3x3 color space matrix
5. Apply the OETF
6. Premultiply alpha

Optimizations:
- Steps 2 & 6 are skipped for opaque (common) bitmaps
- Step 3 is skipped when the color space's EOTF is close
to sRGB (Display P3 for instance). Instead, we use
a hardware sRGB fetch (when the GPU supports it)
- When step 3 is necessary, we use one of four standard
EOTF implementations, to save cycles when possible:
+ Linear (doesn't do anything)
+ Full parametric (ICC parametric curve type 4 as defined
in ICC.1:2004-10, section 10.15)
+ Limited parametric (ICC parametric curve type 3)
+ Gamma (ICC parametric curve type 0)

Color space conversion could be done using texture samplers
instead, for instance 3D LUTs, with or without transfer
functions baked in, or 1D LUTs for transfer functions. This
would result in dependent texture fetches which may or may
not be an advantage over an ALU based implementation. The
current solution favor the use of ALUs to save precious
bandwidth.

Test: CtsUiRenderingTests, CtsGraphicsTests
Bug: 32984164
Change-Id: I10bc3db515e13973b45220f129c66b23f0f7f8fe
/frameworks/base/libs/hwui/GlopBuilder.cpp
636afc1877882dc9cf73b49f8a68c73cc418d8cd 07-Feb-2017 Romain Guy <romainguy@google.com> Apply transfer function when rendering with linear textures

RGBA16F bitmaps are always encoded in linear space, which means we must
apply the opto-electronic transfer function before we can render them
in the framebuffer.

Since our linear bitmaps are assumed to be scRGB, values can be negative.
The OETF is a slightly modified sRGB OETF:

sign(x) * OETF_sRGB(abs(x))

This effectively mirrors the OETF over the negative domain.

This CL also removes the "optimized" shader generation path. With
current compilers, the optimized path doesn't do anything of value
and makes ProgramCache difficult to maintain. Shader compilers inline
everything and are really good at folding expressions and removing
unused code.

Bug: 32984164
Test: CtsUiRenderingTestCases
Change-Id: Ieb458ad53574e3a8959aa6bccbbd2d1fe203cbc5
/frameworks/base/libs/hwui/GlopBuilder.cpp
8cd3edfa15cc9cdbffa935d19ab894426b08d174 09-Jan-2017 Greg Daniel <egdaniel@google.com> Break Layer class into Gl and Vulkan subclasses

Test: manual testing
Change-Id: Ibd2beed39de3ac6da7448e96496253cfe427dfbb
/frameworks/base/libs/hwui/GlopBuilder.cpp
c2f31df8b3b9a237e9abffc59c61804ad8495073 28-Oct-2016 Mike Reed <reed@google.com> use SkBlendMode

skbug.com/5814

Test: compile only
Change-Id: Ibbaff43df1117b2ca77fd8f917f03d88cc476330
(cherry picked from commit 26edbcba8a2ed4cb300e7f87e679e3b73cec2772)
/frameworks/base/libs/hwui/GlopBuilder.cpp
2a38c42e921451abebb4ee5f5ecd738f1b6b04ed 26-Oct-2016 sergeyv <sergeyv@google.com> Add target to texture

Test: refactoring cl.
bug:32413624

Change-Id: I94b1c31cd4e0712dfcfd7777a0012424c1bf0dca
/frameworks/base/libs/hwui/GlopBuilder.cpp
260ab726486317496bc12a57d599ea96dcde3284 07-Oct-2016 Mike Reed <reed@google.com> use SkBlendMode instead of SkXfermode
use sk_sp versions of paint setters/getters

Change-Id: I86591a0a8ec92e6039776cbf00424ea24f585b28
/frameworks/base/libs/hwui/GlopBuilder.cpp
8762e332e3797fb41929a1c6069207f4906ca329 12-Oct-2016 Romain Guy <romainguy@google.com> Various fixes for linear blending and gradients

With linear blending turned off some textures were still
created as sRGB textures instead of linear textures.
Multi-stop gradients were not behaving properly on devices
with no support for float textures.
Gradients are now always interpolated in linear space
even if linear blending is off.
New functions to always force sRGB->linear->sRGB conversions.

Test: Manual testing
Bug: 29940137
Change-Id: Ie2f84ee2a65fd85570e88af813e841e0e625df6c
/frameworks/base/libs/hwui/GlopBuilder.cpp
253f2c213f6ecda63b6872aee77bd30d5ec07c82 29-Sep-2016 Romain Guy <romainguy@google.com> Linear blending, step 1

NOTE: Linear blending is currently disabled in this CL as the
feature is still a work in progress

Android currently performs all blending (any kind of linear math
on colors really) on gamma-encoded colors. Since Android assumes
that the default color space is sRGB, all bitmaps and colors
are encoded with the sRGB Opto-Electronic Conversion Function
(OECF, which can be approximated with a power function). Since
the power curve is not linear, our linear math is incorrect.
The result is that we generate colors that tend to be too dark;
this affects blending but also anti-aliasing, gradients, blurs,
etc.

The solution is to convert gamma-encoded colors back to linear
space before doing any math on them, using the sRGB Electo-Optical
Conversion Function (EOCF). This is achieved in different
ways in different parts of the pipeline:

- Using hardware conversions when sampling from OpenGL textures
or writing into OpenGL frame buffers
- Using software conversion functions, to translate app-supplied
colors to and from sRGB
- Using Skia's color spaces

Any type of processing on colors must roughly ollow these steps:

[sRGB input]->EOCF->[linear data]->[processing]->OECF->[sRGB output]

For the sRGB color space, the conversion functions are defined as
follows:

OECF(linear) :=
linear <= 0.0031308 ? linear * 12.92 : (pow(linear, 1/2.4) * 1.055) - 0.055

EOCF(srgb) :=
srgb <= 0.04045 ? srgb / 12.92 : pow((srgb + 0.055) / 1.055, 2.4)

The EOCF is simply the reciprocal of the OECF.
While it is highly recommended to use the exact sRGB conversion
functions everywhere possible, it is sometimes useful or beneficial
to rely on approximations:

- pow(x,2.2) and pow(x,1/2.2)
- x^2 and sqrt(x)

The latter is particularly useful in fragment shaders (for instance
to apply dithering in sRGB space), especially if the sqrt() can be
replaced with an inversesqrt().

Here is a fairly exhaustive list of modifications implemented
in this CL:

- Set TARGET_ENABLE_LINEAR_BLENDING := false in BoardConfig.mk
to disable linear blending. This is only for GLES 2.0 GPUs
with no hardware sRGB support. This flag is currently assumed
to be false (see note above)
- sRGB writes are disabled when entering a functor (WebView).
This will need to be fixed at some point
- Skia bitmaps are created with the sRGB color space
- Bitmaps using a 565 config are expanded to 888
- Linear blending is disabled when entering a functor
- External textures are not properly sampled (see below)
- Gradients are interpolated in linear space
- Texture-based dithering was replaced with analytical dithering
- Dithering is done in the quantization color space, which is
why we must do EOCF(OECF(color)+dither)
- Text is now gamma corrected differently depending on the luminance
of the source pixel. The asumption is that a bright pixel will be
blended on a dark background and the other way around. The source
alpha is gamma corrected to thicken dark on bright and thin
bright on dark to match the intended design of fonts. This also
matches the behavior of popular design/drawing applications
- Removed the asset atlas. It did not contain anything useful and
could not be sampled in sRGB without a yet-to-be-defined GL
extension
- The last column of color matrices is converted to linear space
because its value are added to linear colors

Missing features:
- Resource qualifier?
- Regeneration of goldeng images for automated tests
- Handle alpha8/grey8 properly
- Disable sRGB write for layers with external textures

Test: Manual testing while work in progress
Bug: 29940137

Change-Id: I6a07b15ab49b554377cd33a36b6d9971a15e9a0b
/frameworks/base/libs/hwui/GlopBuilder.cpp
5e00c7ce063116c11315639f0035aca8ad73e8cc 07-Jul-2016 Chris Craik <ccraik@google.com> Delete old rendering pipeline

fixes: 30002246

Change-Id: I45df0e924708526cee045b14c291bd23aa1a92db
/frameworks/base/libs/hwui/GlopBuilder.cpp
b2e36d7939610de538a6ec95a821b61b365b3073 04-May-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Use LUT for computing final shadow alpha" into nyc-dev
138c21fbec12bead3c7ca1f181c3fd35542ccb00 29-Apr-2016 Chris Craik <ccraik@google.com> Use LUT for computing final shadow alpha

bug:27415250

Significantly reduces shadow fragment shader computation.

Change-Id: Ie9b3c712700754b3734d0ae9cda8751c298fc59e
/frameworks/base/libs/hwui/GlopBuilder.cpp
2f69d6d4fdd4994912e5515016421625d1e1c4ec 28-Apr-2016 John Reck <jreck@google.com> Support transform'd GraphicBuffers

Bug: 28428955
Change-Id: I23e2fc9b96a67c7cfda42d9d7319e478194a7fa7
/frameworks/base/libs/hwui/GlopBuilder.cpp
2f78327cfcd4c7b23aae9bb0262e64050d093a64 19-Apr-2016 John Reck <jreck@google.com> PixelCopy fixes

Bug: 27708453

Fixes some issues with camera sources. Previously
it was using GL_TEXTURE_2D target which doesn't
work properly if the source is YUV. It is critical
to ensure GL_TEXTURE_EXTERNAL_OES is used throughout
so the right sampler is used.

Change-Id: I0dcd8941ba08331f24809467b0e828663a38e93b
/frameworks/base/libs/hwui/GlopBuilder.cpp
70969ccde405ea410fc7ccfe869999a03f056686 31-Mar-2016 Chris Craik <ccraik@google.com> Fix layer damage and clipping for Text shadows

Fixes: 27787426

Change-Id: I4c65cca0cfcd343a9cfbaedd3a32b83f90df2ecf
/frameworks/base/libs/hwui/GlopBuilder.cpp
701b3cc0db71d01dd5df21edcb09813334e7205b 12-Mar-2016 Chris Craik <ccraik@google.com> Dump full Glop in GlopBuilder::dump

Change-Id: I022b3c8c265998fd97d41f13964f4703025b338a
/frameworks/base/libs/hwui/GlopBuilder.cpp
e5b50197e870aa6d22c3893f5d25f4279f06e5c3 05-Jan-2016 Chris Craik <ccraik@google.com> Support for stencil clipping in layers

bug:22480459

Change-Id: Ic9e8652379524ccc46d8722ce49f9190b08a2abc
/frameworks/base/libs/hwui/GlopBuilder.cpp
5430ab220b231a96b71c3e030d0303d9ce008b05 11-Dec-2015 Chris Craik <ccraik@google.com> Avoid unneeded rect params

Change-Id: I2d8dcf6b09fdc554a403ac74763bf856b5f5d9fa
/frameworks/base/libs/hwui/GlopBuilder.cpp
8d2cf943d9c7292e54726399faefdec4a01c084b 02-Nov-2015 Chris Craik <ccraik@google.com> Add region-tracking to OffscreenBuffers

Change-Id: I024c7219c080b9a89888517f5a89d49dfe8065ba
/frameworks/base/libs/hwui/GlopBuilder.cpp
b565df13a9e5c7b1d7d93bdfa4a793752d66d3cc 05-Oct-2015 Chris Craik <ccraik@google.com> Initial commit of new Canvas operation recording / replay

Done:
- drawRect, drawBitmap, drawColor, drawPaint, drawRenderNode, drawRegion
- Recording with new DisplayList format
- batching & reordering
- Stateless op reorder
- Stateless op rendering
- Frame lifecycle (clear, geterror, cleanup)

Not done:
- SaveLayer (clipped and unclipped)
- HW layers
- Complex clipping
- Ripple projection
- Z reordering
- Z shadows
- onDefer prefetching (text + task kickoff)
- round rect clip
- linear allocation for std collections
- AssetAtlas support

Change-Id: Iaf98c1a3aeab5fa47cc8f9c6d964420abc0e7691
/frameworks/base/libs/hwui/GlopBuilder.cpp
12efe649d3f5df8e81f4b78179939c1d488673a0 29-Sep-2015 Chris Craik <ccraik@google.com> Move ortho matrix out of glop

It's fbo-global, so don't bother stashing/restoring it repeatedly.

Change-Id: Icb32e3eda5d2086aaae07140f8ff40e038dad5fe
/frameworks/base/libs/hwui/GlopBuilder.cpp
6c2c62c1eddd9ff076cc13616c2a185cf074c786 22-Sep-2015 Chris Craik <ccraik@google.com> Remove unnecessary glop color storage

Change-Id: I68817449d2e0d593dccb7e9be8c8ca45b7ab2fc2
/frameworks/base/libs/hwui/GlopBuilder.cpp
b9ce116dac378b4cf4490f265dcbd5704a1dd43c 21-Aug-2015 Chris Craik <ccraik@google.com> Switch several enums to enum classes

Change-Id: I00ecd0b61657196b51704f70ca31a9d1c1ac254e
/frameworks/base/libs/hwui/GlopBuilder.cpp
7c85c54499994c687a833644f7f213e747fadb98 20-Aug-2015 Chris Craik <ccraik@google.com> Remove Matrix4::load(Matrix4&)

bug:22320446

Change-Id: Id6d1cc9b4aea828b0cdf622ad672064d72671f8d
/frameworks/base/libs/hwui/GlopBuilder.cpp
b1f990de4075866ad8f40849c01d58b2dac8b1e5 12-Jun-2015 Chris Craik <ccraik@google.com> Fix roundrect clipping / blending ordering

bug:21803918

Also, don't consider rr clipped ops opaque, and put stage
checking behind a debug flag.

Change-Id: I9304ae571337a7cf835524682d1a590a21d30fa4
/frameworks/base/libs/hwui/GlopBuilder.cpp
53e51e4aa933f9603587e1780f446c18816bf9be 01-Jun-2015 Chris Craik <ccraik@google.com> Handle shader matrix correctly when ignoring canvas transform

bug:20063841

Restores old SkShader matrix behavior from before the Glop refactor.

Many drawing operations draw without sending the canvas transform to
the GL shader. In such cases, we need to adapt the matrix sent to the
SkShader logic to invert the canvas transform that's built into
the mesh.

Change-Id: I42b6f59df36ce46436322b95bf9ad2140795ee58
/frameworks/base/libs/hwui/GlopBuilder.cpp
2507c34d91bb0d722b6012e85cb47387b2aa6873 04-May-2015 Chris Craik <ccraik@google.com> Cleanup properties

bug:19967854

Separate properties from Caches, into static, RenderThread-only class.

Also rewrites the means for java to set properties to correctly handle
threading, and adds an override for profile bars so that SysUi doesn't clutter
the screen with them.

Change-Id: I6e21a96065f52b9ecc49d1a126244804ba106fa9
/frameworks/base/libs/hwui/GlopBuilder.cpp
828407356dd5c34a3e441604aaf895cbec7c7e66 03-Apr-2015 Chris Craik <ccraik@google.com> Delete pre-glop path

bug:19014311

Change-Id: I06376b6f625455892d8eafe2727b78025a64c4bf
/frameworks/base/libs/hwui/GlopBuilder.cpp
48f650cb24e5b028deaff01baddc1d154f78d91a 10-Mar-2015 Chris Craik <ccraik@google.com> Track down unsupported texture target

bug:19641517

Change-Id: Idc2e413abef5bb1438ffb3f52efb001504d3e89f
/frameworks/base/libs/hwui/GlopBuilder.cpp
edacf22ca132ac48207a68aa30998f5b43d893b8 10-Mar-2015 Chris Craik <ccraik@google.com> Merge "Glop based composeLayerRegion/Rect"
182952f5eeefc2a21d76d4664ada0e2d78c1105c 09-Mar-2015 Chris Craik <ccraik@google.com> Glop based composeLayerRegion/Rect

Change-Id: I69440cabca84948e8aaead9479d616ebc2496517
/frameworks/base/libs/hwui/GlopBuilder.cpp
eb911c2b0e8edeb7595a98af4b9f1bd47de1381e 07-Mar-2015 Chris Craik <ccraik@google.com> Rewrite glop texture asserts

bug:19641517

Also switch Glop VertexAttribFlags to use int for group of flags.

Change-Id: Ib7b1934197a62206a55baa6ab484ac59f5bec816
/frameworks/base/libs/hwui/GlopBuilder.cpp
8820fd1d82acaefda98ae73ccf61413d5044f9f3 03-Mar-2015 Chris Craik <ccraik@google.com> Patch cleanup, reenable Patch Glops

bug:19597454

Change-Id: If12b95e83588b81a553210cd8c2437c6c771073a
/frameworks/base/libs/hwui/GlopBuilder.cpp
0556d90253902ae797e4fcea79602a30ff16f82c 03-Mar-2015 Chris Craik <ccraik@google.com> Glop DrawPatch support

Change-Id: Icaa78bdb2cf52c1fc2194ec4016634967d17fb6a
/frameworks/base/libs/hwui/GlopBuilder.cpp
a6b52198b9e73a4b7f80103116feeace74433246 28-Feb-2015 Chris Craik <ccraik@google.com> Glop drawBitmaps, drawPatches

Change-Id: I3f1cd3f47f97d2e0c9b9d153732e26ee0b1c58c2
/frameworks/base/libs/hwui/GlopBuilder.cpp
26bf34200e40a0fa8c66366559aa016380cd8c6f 27-Feb-2015 Chris Craik <ccraik@google.com> Glop TextureLayer support

Change-Id: I348a926bd4a2f47be9fdbe74058c0aa2f8dc6276
/frameworks/base/libs/hwui/GlopBuilder.cpp
ef2507439c08f4e9c4c9bba1c6243ca9df2ee827 26-Feb-2015 Chris Craik <ccraik@google.com> Glop mesh reorg, support for drawBitmapMesh

Change-Id: Iaf5550bdd93da93e59a5b838234ab5612e067387
/frameworks/base/libs/hwui/GlopBuilder.cpp
14100ac9f8efc1a2407e3f5a5c8b2532a49585db 24-Feb-2015 Chris Craik <ccraik@google.com> Glop support for custom textured UVs, simplify drawBitmap(src,dst)

Front load the scaling-to-support-shaders to record time.

Change-Id: I861c82d9d16d3c5e063cf87230127eed0b3f9b54
/frameworks/base/libs/hwui/GlopBuilder.cpp
f27133df2d179c99d6bc1ae644af09e9153a0071 19-Feb-2015 Chris Craik <ccraik@google.com> Glop layer mesh rendering

Change-Id: I2d902819d5d77f496b67d4d25a298782903e410d
/frameworks/base/libs/hwui/GlopBuilder.cpp
2bb8f5606d4a28549d95005304305b3aff1ce090 18-Feb-2015 Chris Craik <ccraik@google.com> Glop text shadows, clearLayerRegions, and rectangleList

Change-Id: I83b36d1ee5d8f05f41acf244639019f9b8da79cd
/frameworks/base/libs/hwui/GlopBuilder.cpp
922d3a7f6f8c1c05a996ee3e91e8cbadfff560c9 14-Feb-2015 Chris Craik <ccraik@google.com> Glop SkiaShader support

Change-Id: I894a0b62701bd02367ab970813e4c332147351a2
/frameworks/base/libs/hwui/GlopBuilder.cpp
30036092b40badecbe64d9c2bff4850132147f78 12-Feb-2015 Chris Craik <ccraik@google.com> Glop path texture support

Change-Id: I505eb05991ca4c9b2e01e49988b8f962fad51462
/frameworks/base/libs/hwui/GlopBuilder.cpp
0519c810a56bded1284fcb2ae40f438878c6585f 11-Feb-2015 Chris Craik <ccraik@google.com> Glop Bitmap and RoundRect clipping support

Change-Id: I4577546a5d2e5f084cc03f39a89db9231b8111ee
/frameworks/base/libs/hwui/GlopBuilder.cpp
08fa43fdeb646f56edcd8b33d06ee7d79b203426 10-Feb-2015 Chris Craik <ccraik@google.com> Fix Glop vertex alpha blending

Need to force blending if vertices have alpha attribute

Change-Id: I821792db6b613b4d0243cf9c7a045cba014acdc1
/frameworks/base/libs/hwui/GlopBuilder.cpp
2ab95d780b023152556d9f8659de734ec7b55047 07-Feb-2015 Chris Craik <ccraik@google.com> Glop support for indexed quads

bug:19014311
Change-Id: If35a873421b41cc4508b0d8ac1b4d900c9bb3717
/frameworks/base/libs/hwui/GlopBuilder.cpp
117bdbcfa3e8306dad21e7e01fa71b00cdfa7265 05-Feb-2015 Chris Craik <ccraik@google.com> Glop ColorFilter & VertexBuffer support, initial enable

Enables Glop rendering for supported Rects and VertexBuffers
Also removes unused Query object

Change-Id: Ibe227bc362685a153159f75077664f0947764e06
/frameworks/base/libs/hwui/GlopBuilder.cpp
031888744e24b5c7243ac99ec98b78aff5db1c78 03-Feb-2015 Chris Craik <ccraik@google.com> GlopBuilder, and test app refactor

Change-Id: I2cd299ccf178007fd5f83bab6c3448f03aec7843
/frameworks/base/libs/hwui/GlopBuilder.cpp