History log of /frameworks/base/libs/hwui/tests/unit/SkiaBehaviorTests.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e07a91a8dbcadd9898fdea0bc19ddb55014f3eeb 19-Apr-2017 Matt Sarett <msarett@google.com> Add unit test for Skia path behavior

Test: This is a test.
Bug: 35369941

Change-Id: Iaf21d3a903702f81a20e08e8b50b782f311ce7f3
/frameworks/base/libs/hwui/tests/unit/SkiaBehaviorTests.cpp
ab582b762ad6f0fbb2b087cff4472ab60e85474d 14-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Replace bitmap shaders with image shaders in test code"
c54b76e97d00497e4fea1aa08ae404bfd4ae875d 13-Feb-2017 Matt Sarett <msarett@google.com> Replace bitmap shaders with image shaders in test code

Test: Verified that unit tests still pass.

Change-Id: I67d8046e49b9469e73caa9fe2a44ef2602c95d59
/frameworks/base/libs/hwui/tests/unit/SkiaBehaviorTests.cpp
89ddb1f1644e0b47de060d2c9aaf6d5387c38f2f 10-Feb-2017 Matt Sarett <msarett@google.com> Update framework to use new SkColorSpace API

Test: This compiles with SK_USE_LEGACY_NAMED_COLOR_SPACE
turned off.

Change-Id: Ie573f59e0aa475bab06b38589db3c6158ad82c5a
/frameworks/base/libs/hwui/tests/unit/SkiaBehaviorTests.cpp
ab12c1fe73734a18ac19a06b97f276528f6d027a 03-Nov-2016 Mike Reed <reed@google.com> update callers to newer Skia APIs

Test: refactoring CL. Existing unit tests still pass.

Change-Id: I47e73e00f14f78dd9d4c48a142ac9853e7e4cad7
/frameworks/base/libs/hwui/tests/unit/SkiaBehaviorTests.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/tests/unit/SkiaBehaviorTests.cpp
7ca5ad1d06c94d99f17b2f1f27cd853d47b5bcf4 19-Oct-2016 Sergei Vasilinetc <sergeyv@google.com> Merge "Move allocatePixelRef methods to hwui. This patch also makes tests to use SkBitmap backed by hwui/PixelRef, Test: refactoring cl. bug:27762775"
c36bd6c16ddfc160732ff7e4518564714c8aa66e 12-Oct-2016 sergeyv <sergeyv@google.com> Move allocatePixelRef methods to hwui.
This patch also makes tests to use SkBitmap backed by hwui/PixelRef,
Test: refactoring cl.
bug:27762775

Change-Id: Ib936e81877790849118420f5e565fc8f4466c1be
/frameworks/base/libs/hwui/tests/unit/SkiaBehaviorTests.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/tests/unit/SkiaBehaviorTests.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/tests/unit/SkiaBehaviorTests.cpp
d4babda3aa0af4d9a060b588f082e2f29192fd60 20-Sep-2016 Matt Sarett <msarett@google.com> Merge "Use SkMakeBitmapShader, avoid bitmap copy"
62feb3a0b4690144a067080ab17beae160ea6320 20-Sep-2016 Matt Sarett <msarett@google.com> Use SkMakeBitmapShader, avoid bitmap copy

CreateBitmapShader now forces a copy. This updates the call sites
to use SkMakeBitmapShader (in SkImagePriv.h) with
kNever_SkCopyPixelsMode.

This maintains the behavior where apps can modify the bitmap in
the shader after creating the shader.

This also ensures that the texture cache will work (since it's
based off of SkPixelRefs).

BUG:31594626
Change-Id: Ic75cb6cdc05c750b7946208e48a8127838d9c2f8
/frameworks/base/libs/hwui/tests/unit/SkiaBehaviorTests.cpp
5d31a293ad0a832c7b8b445c1a67fb1800e5da32 15-Sep-2016 John Reck <jreck@google.com> Cleanup Xfermode

We only support PorterDuff Xfermodes

Removes some unneeded JNI and finalizers()

Change-Id: I4988d6b05c6fd113a8ed8f7dcbf95abe0de95060
/frameworks/base/libs/hwui/tests/unit/SkiaBehaviorTests.cpp
36ce80d5301664b4839ebd2f4570f062cbabf862 13-May-2016 Chris Craik <ccraik@google.com> Fix Skia filter behavior test

Fixes: 28751534

Change-Id: Ie5e2ee946b21702539fc0cc7358d0f9550e7d095
/frameworks/base/libs/hwui/tests/unit/SkiaBehaviorTests.cpp
20136f31941e3b036bf25537f1dac364a58483c9 30-Apr-2016 Chris Craik <ccraik@google.com> Add LightingFilter behavior test

bug:28519669

Change-Id: I81ca4109bae04387f2eb73374d0f11821745fea1
/frameworks/base/libs/hwui/tests/unit/SkiaBehaviorTests.cpp
bee6092dbef81ff724624c4dd630efa8657817f8 25-Mar-2016 Chris Craik <ccraik@google.com> Add a couple more tests around bitmap uploads

Change-Id: I36138238b7e6cce8dab62fb56eaa1be15091a412
/frameworks/base/libs/hwui/tests/unit/SkiaBehaviorTests.cpp
07d8d59e21125fe7cba09b10e3dd7ecb9c49e8d8 04-Feb-2016 Chris Craik <ccraik@google.com> Add SkiaBehaviorTests

Change-Id: Ie2983f7a0c9e8bdd8c8de507d70ecf3aefdd9425
/frameworks/base/libs/hwui/tests/unit/SkiaBehaviorTests.cpp