History log of /frameworks/base/libs/hwui/SkiaShader.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
669b15a93548b82135c73196665bcb7f03d87795 31-Mar-2017 Derek Sollenberger <djsollen@google.com> Fix HWUI/Skia Gradients to premultiply the colors prior to interpolation

This is fixed in Skia by passing the appropriate flag when the shader is
generated. The fix in HWUI is to reverse the premultiplication and
interpolation steps.

Test: bit CtsUiRenderingTestCases:.testclasses.ShaderTests
Bug: 34323783
Change-Id: I3417141949f62fcc696b6d8213a4b446d7d0cbf8
/frameworks/base/libs/hwui/SkiaShader.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/SkiaShader.cpp
6183c97e5f317ad52ad16fe50e40129e2c7b2150 16-Mar-2017 Romain Guy <romainguy@google.com> Bowing my head in shame, going back to gamma interpolated gradients

Frankengradients (linearly interpolated RGB, gamma interpolated alpha) look
fantastic but unfortunately create sligh compatibility issues. For instance,
a gradient from 0xffea1030 to 0x00ea1030 (opaque to alpha, with a single
color) blended on top of 0xff101010 would not look the same as a single
opaque gradient from 0xffea1030 to 0xff101010. The difference is hardly
noticeable on simple gradients but it could cause confusion amongst app
developers. Their life is hard enough as it is, let's be good to them.

My crusade against the gamma world is not over and one day I shall
be the victor. I am patience.

Bug: 35485208
Test: UiRendering.ShaderTests, UiRendering.GradientTests, manual testing
Change-Id: I8204e60cdf0a6b12dfe22638d30ca9622687000e
/frameworks/base/libs/hwui/SkiaShader.cpp
dd6f1a70848cc852c215a2e2cb8f9acba4953504 18-Feb-2017 Romain Guy <romainguy@google.com> Fix Rgba16fTests@testTransferFunctionsShader test

RGBA16F bitmaps used as an SkBitmapShader would not set the hasLinearTexture
flag in the program description, causing a shader to be generated without
the proper opto-electronic transfer function.

Bug: 35482305
Test: bit -t CtsUiRenderingTestCases:android.uirendering.cts.testclasses.Rgba16fTests
Change-Id: I23354f8189a6b27b677eac9df82677e91282a31d
/frameworks/base/libs/hwui/SkiaShader.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/SkiaShader.cpp
68a9dd8c88869fa47aa7d3c2e9ecce5077452f57 14-Dec-2016 Sergei Vasilinetc <sergeyv@google.com> Merge "HWUI: set correct sampler for external texture in shaders"
9c97e48fbe389180b4b64845f093c53c92c374f3 13-Dec-2016 sergeyv <sergeyv@google.com> HWUI: set correct sampler for external texture in shaders

Test: hwuimacro hwbitmapcompositeshader
bug:30999911
Change-Id: Ic63f7109a4a7069b62c0b21efae2d4ba7e6d64be
/frameworks/base/libs/hwui/SkiaShader.cpp
a0ed6f03f6f06eb41cbcc15c0a99b4a78fd91bef 13-Dec-2016 Romain Guy <romainguy@google.com> Pre-multiply gradient colors the right way

Alpha pre-multiplication must be done after applying the
opto-electronic transfer function when linear blending is
disabled. The correct way would be to pre-multiply before
gamma encoding but this leads to improper blending which
cannot be corrected without using sRGB frame buffers and
texture sampling.

Bug: 33010587
Test: cts-tradefed run singleCommand cts-dev --module CtsUiRenderingTestCases --test android.uirendering.cts.testclasses.GradientTests
Change-Id: I5f04bda4cb9f63674537aef5931621c14d601884
/frameworks/base/libs/hwui/SkiaShader.cpp
554ffeb8b7c836da43a637c59eedfc617895b19d 16-Nov-2016 sergeyv <sergeyv@google.com> Support hardware bitmaps in bitmap shaders

Test: hwuimacro bitmapShaderEglImage --onscreen.
bug:30999911
Change-Id: I9d16a1c217a4474841794cf27ce49e3f7823678e
/frameworks/base/libs/hwui/SkiaShader.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/SkiaShader.cpp
ec4a4b13eae2241d1613890c1c1c096bed891845 21-Oct-2016 sergeyv <sergeyv@google.com> Use Bitmap in DisplayList & RecordedOps instead of SkBitmap
Test: refactoring cl.
bug:32216791

Change-Id: I1d8a9a6e772e2176b6c2409409a910478b45f8db
/frameworks/base/libs/hwui/SkiaShader.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/SkiaShader.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/SkiaShader.cpp
38e0c32852e3b9d8ca4a9d3791577f52536419cb 10-Nov-2015 John Reck <jreck@google.com> Track texture memory globally

Also mostly consolidates texture creation

Change-Id: Ifea01303afda531dcec99b8fe2a0f64cf2f24420
/frameworks/base/libs/hwui/SkiaShader.cpp
f35b989d26bb98900f6c5fa2e586326b30b6e161 31-Jul-2015 Leon Scroggins III <scroggo@google.com> Merge six commits from master-skia to master

Also corrects some code under development behind the HWUI_NEW_OPS flags
to match the updated Skia API.

Include external/skia/include/private
use SrcConstraint for drawBitmapRect
clean up to allow removal of flags for SCALAR_DIV and IMAGEINFO_FIELDS
don't call DEPRECATED getDevice()
update to newer API for drawBitmapRect
asABitmap is deprecated, used isABitmap

previous-Change-Id: I12208855a95948897077b1c1549eb35416cc801e
previous-Change-Id: I5044f0f61315fe48c60d7af5e261a7d0ed574f56
previous-Change-Id: Ic34a3ba77b3f9e091fa7aaba75018a307abacdab
previous-Change-Id: I79f8dd779920565d1204f7fe67b3286b1bbf4e9b
previous-Change-Id: Ic04d1f8274f6a862ea00f8d241363cf31f5ec1ec
previous-Change-Id: I9e4ae257a1976c74302b6a73f17405174ae58cec
previous-Change-Id: I85de3462ad1e4877784df38edc4bcd0acbd24e5e
Change-Id: Ide8e2f669e91a13c32521af3a16efdaa085c81d0
/frameworks/base/libs/hwui/SkiaShader.cpp
d8f904f256b82e48e9a85561eb96e15399b0b2d9 28-Oct-2015 Tom Hudson <tomhudson@google.com> Revert "Merge six commits from master-skia to master"

This reverts commit 550780745fa28ae9a87d02331841ca5ce4f9c763.

Change-Id: Ic71eccea454b26261fe6e9a9a7a24eff56396989
/frameworks/base/libs/hwui/SkiaShader.cpp
550780745fa28ae9a87d02331841ca5ce4f9c763 31-Jul-2015 Leon Scroggins III <scroggo@google.com> Merge six commits from master-skia to master

Include external/skia/include/private
use SrcConstraint for drawBitmapRect
clean up to allow removal of flags for SCALAR_DIV and IMAGEINFO_FIELDS
don't call DEPRECATED getDevice()
update to newer API for drawBitmapRect
asABitmap is deprecated, used isABitmap

Change-Id: I519f54f97321a7a365ea81a3b78cb03b9bdca021
previous-Change-Id: I12208855a95948897077b1c1549eb35416cc801e
previous-Change-Id: I5044f0f61315fe48c60d7af5e261a7d0ed574f56
previous-Change-Id: Ic34a3ba77b3f9e091fa7aaba75018a307abacdab
previous-Change-Id: I79f8dd779920565d1204f7fe67b3286b1bbf4e9b
previous-Change-Id: Ic04d1f8274f6a862ea00f8d241363cf31f5ec1ec
previous-Change-Id: I9e4ae257a1976c74302b6a73f17405174ae58cec
/frameworks/base/libs/hwui/SkiaShader.cpp
216048ffb0a4c41836c6ddb63f9b2e7a64593837 22-Aug-2015 Chris Craik <ccraik@google.com> Add static asserts around assumed-static skia enum values

Protects assumptions around enums value built into LUTs

Change-Id: Ica0692e4309d50b4d3897e0f3f47809d14f786fe
/frameworks/base/libs/hwui/SkiaShader.cpp
011550e1f2f20e66c429c2d854dcaf18c1f6c30c 18-Jul-2015 Chris Craik <ccraik@google.com> am 3699c603: am 62a2696c: am fbd2d949: am b6e41a08: am 0bb5c26b: Merge "Fix AssetAtlas usage in BitmapShaders" into mnc-dev

* commit '3699c60323aca45eb0e385d6b4a27bd5861fadf2':
Fix AssetAtlas usage in BitmapShaders
6ad690e16f8e139bfd29a035b52ab616d813a74b 18-Jul-2015 Chris Craik <ccraik@google.com> Fix AssetAtlas usage in BitmapShaders

bug:22521999

Change-Id: I60859748ceee19ebc89ec98845e550ea26e36ecd
/frameworks/base/libs/hwui/SkiaShader.cpp
1d5d34624bedbbe8f5ff60d81490da81301ebe7e 16-Jul-2015 Chris Craik <ccraik@google.com> Merge "Clean up unncessary defines"
5a4690bf26932c0d6940e4af8516d920e09ae81a 14-Jul-2015 Chris Craik <ccraik@google.com> Clean up unncessary defines

LOG_TAG and TRACE_TAG are already defined in the makefile

Change-Id: I9e53e3dacbe018441edd74cb7c8c90846defee74
/frameworks/base/libs/hwui/SkiaShader.cpp
e310f83d591dc3fb7bd5c684239481a586f00662 13-Jul-2015 Chris Craik <ccraik@google.com> Fix unsafety in SkiaShader storage, and texture unit accounting

bug:22390304

Fixes two issues:

1) The max texture unit wasn't large enough to handle the most complex
ComposeShader case (1 for draw primitive, 2 for gradient shader, 1 for
bitmap shader).

2) If a shader isn't supported by SkiaShader::store, the shader data
needs to be explicitly disabled, so we won't read uninitilized data
from it when trying to read shader information out.

Change-Id: I29ee7b7c1e07f67db88c1707bdc857daa305e713
/frameworks/base/libs/hwui/SkiaShader.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/SkiaShader.cpp
828407356dd5c34a3e441604aaf895cbec7c7e66 03-Apr-2015 Chris Craik <ccraik@google.com> Delete pre-glop path

bug:19014311

Change-Id: I06376b6f625455892d8eafe2727b78025a64c4bf
/frameworks/base/libs/hwui/SkiaShader.cpp
36a35e366a65980843b96759f863643f17ca1ee7 18-Feb-2015 Chris Craik <ccraik@google.com> Fix layer shader to store layer pointer

bug:19419672

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

Change-Id: I894a0b62701bd02367ab970813e4c332147351a2
/frameworks/base/libs/hwui/SkiaShader.cpp
6c15ffa196fc9b7724c189d833c3435d8db12266 02-Feb-2015 Chris Craik <ccraik@google.com> Refactoring of Program ownership/lifecycle, and WIP Glop rendering path

Change-Id: I2549032790bddbc048b0bccc224ed8f386b4517c
/frameworks/base/libs/hwui/SkiaShader.cpp
44eb2c00861098dd3e2950d923646814b4cc57c2 29-Jan-2015 Chris Craik <ccraik@google.com> Refactor blending and texture gl state

Change-Id: Ia6b3c8b2afd3dfcee7f3ce401d846b789612054a
/frameworks/base/libs/hwui/SkiaShader.cpp
d41c4d8c732095ae99c955b6b82f7306633004b1 06-Jan-2015 Chris Craik <ccraik@google.com> Add overrides and switch to nullptr keyword for all files

Adds remaining missing overrides and nullptr usages, missed due to
an extreme failure in tool usage.

Change-Id: I56abd72975a3999ad13330003c348db40f59aebf
/frameworks/base/libs/hwui/SkiaShader.cpp
64bb413a664001c95c8439cf097dc3033f4ed733 22-Nov-2014 Andreas Gampe <agampe@google.com> Revert "resolved conflicts for merge of 220c3f4f to master"

Reverted as hwui doesn't agree.

This reverts commit 8a902d9f24e83c87b054adb5836b4a5b8a257be9.

Change-Id: I109e7b02bee2921e2155ded6df36f52e6f574b5a
/frameworks/base/libs/hwui/SkiaShader.cpp
8a902d9f24e83c87b054adb5836b4a5b8a257be9 22-Nov-2014 Andreas Gampe <agampe@google.com> resolved conflicts for merge of 220c3f4f to master

Change-Id: I37ecce8fddecdff82b0eace16f1ee75152f7171e
42ddc18d108f789705ad4eb697ce9599ad322507 21-Nov-2014 Andreas Gampe <agampe@google.com> Frameworks/base: Unused parameters in hwui

Remove Clang cutout for unused parameters. Fix warnings.

Remove Clang cutout for deprecated Skia function usage. Has been
fixed in the L push.

Change-Id: I7ea073ff67127cc1e14e798b655e2c50615fe8e7
/frameworks/base/libs/hwui/SkiaShader.cpp
2dc236b2bae13b9a0ed9b3f7320502aecd7983b3 15-Oct-2014 Tom Hudson <tomhudson@google.com> Clean up physical coupling

Narrow the use of #include directives in hwui, replacing with forward
declarations where straightforward. Speeds compiles; doesn't do any
restructuring of code.

Change-Id: Icac2baffb5896f55d8c6718e9bd9d4bfa02d3ca0
/frameworks/base/libs/hwui/SkiaShader.cpp
d1ad5e62fda248c6d185cde3cb6d9f01a223066c 05-May-2014 Leon Scroggins III <scroggo@google.com> Inspect SkShader to determine hw shader.

Instead of duplicating internal info about SkShader, inspect the
SkShader installed on the SkPaint.

core/java/android/view/GLES20Canvas.java:
Remove setupModifiers, nResetModifiers, and nSetupShader.

core/jni/android/graphics/Shader.cpp:
Remove calls to create/destroy the (previously) attached SkiaShader.

core/jni/android_view_GLES20Canvas.cpp:
Remove native code for setupShader and resetModifiers.

graphics/java/android/graphics/BitmapShader.java:
graphics/java/android/graphics/ComposeShader.java:
graphics/java/android/graphics/LinearGradient.java:
graphics/java/android/graphics/RadialGradient.java:
graphics/java/android/graphics/Shader.java:
graphics/java/android/graphics/SweepGradient.java:
Remove code keeping track of native SkiaShader.

libs/hwui/Caches.h:
Include Extensions.h.

libs/hwui/DeferredDisplayList.cpp:
Compare shaders on the paint, instead of on DrawModifiers.

libs/hwui/DisplayList.cpp:
libs/hwui/DisplayList.h:
Remove vector of SkiaShaders.

libs/hwui/DisplayListOp.h:
Access the SkShader on mPaint.
Remove SetupShaderOp and ResetShaderOp.

libs/hwui/DisplayListRenderer.cpp:
libs/hwui/DisplayListRenderer.h:
Remove resetShader, setupShader, refShader, and mShaderMap.

libs/hwui/FontRenderer.cpp:
Pass SkShader to setupDrawShader and setupDrawShaderUniforms.

libs/hwui/OpenGLRenderer.cpp:
libs/hwui/OpenGLRenderer.h:
Add LayerShader, a class inheriting from SkShader, to mimic the
behavior of SkiaLayerShader. Unlike SkiaLayerShader, it can be set on
the SkPaint so it can be inspected later.
Set a LayerShader instead of a SkiaLayerShader.
setupDrawShader and setupDrawShaderUniforms now inspect an SkShader
passed in.
Inspect SkShader instead of mDrawModifiers.mShader.
Remove resetShader and setupShader.
setupDrawColorUniforms now takes a boolean indicating whether there is
a shader.
Add an inline function for accessing the SkShader on an SkPaint.
In setupDrawBlending(Layer*, bool), do not check the shader (which will
never be set), but do check whether the color filter may change the
alpha (newly fixed behavior).
In setupDrawBlending(SkPaint, ...), check the SkShader and whether the
color filter affects alpha (the latter is new behavior).

libs/hwui/Renderer.h:
Remove pure virtual functions setupShader and resetShader.

libs/hwui/ResourceCache.cpp:
libs/hwui/ResourceCache.h:
Remove functions for refing/unrefing shaders.

libs/hwui/SkiaShader.cpp:
libs/hwui/SkiaShader.h:
Much of this code was redundant and has been removed.
Convert structs into class with nothing but static functions for
calling describe/setupProgram.

libs/hwui/TextureCache.cpp:
libs/hwui/TextureCache.h:
Use the SkPixelRef as the key to the bitmap Lru cache, since shader
inspection will provide a different SkBitmap pointer (though it will
hold the correct SkPixelRef with the correct generation ID).

tests/CanvasCompare/src/com/android/test/hwuicompare/DisplayModifier.java:
tests/CanvasCompare/src/com/android/test/hwuicompare/ResourceModifiers.java:
Update manual test to have more shaders: radial, sweep, compose,
invalid compose.

BUG:10650594

Change-Id: Iaa7189178bda1c55f96da044d2a9fa602ba36034
/frameworks/base/libs/hwui/SkiaShader.cpp
3f085429fd47ebd32ac2463b3eae2a5a6c17be25 16-Apr-2014 Chris Craik <ccraik@google.com> Clip TouchFeedbackDrawable effect to receiver Outline

Projected RenderNodes are now wrapped with a ClipRect or masked
SaveLayer, so that they are clipped to the outline of the projection
receiver surface.

Change-Id: I1d4afc1bb5d638d650bc0b1dac51a498f216773e
/frameworks/base/libs/hwui/SkiaShader.cpp
e63f7c622a2086aefa80983c6f41b74fb166bb42 17-Oct-2013 Chris Craik <ccraik@google.com> Clean unused parameters, disable warnings

Change-Id: Iddb872f53075dd022eeef45265594d1c6a9e2bc0
/frameworks/base/libs/hwui/SkiaShader.cpp
8aa195d7081b889f3a7b1f426cbd8556377aae5e 05-Jun-2013 Romain Guy <romainguy@google.com> Introduce Caches::bindTexture() to reduce glBindTexture calls

Change-Id: Ic345422567c020c0a9035ff51dcf2ae2a1fc59f4
/frameworks/base/libs/hwui/SkiaShader.cpp
d4289922ce772ed8e170a27d1c9521672b315698 19-Mar-2013 Romain Guy <romainguy@google.com> Apply ComposeShader's local matrix to children

Change-Id: Idf9b8e7d7b30f8fcd8ba1fd4bfe8991e9ca148e2
/frameworks/base/libs/hwui/SkiaShader.cpp
d679b57ef279239cf11bb6c9bd14fb99b07971c9 30-Aug-2012 Romain Guy <romainguy@google.com> Pre-multiply color components for 2-stop gradients
Bug #7033344

Change-Id: Ia168501f1dc56ba7a1bb0c55078320432309a66a
/frameworks/base/libs/hwui/SkiaShader.cpp
211efea7376371ee755edd2ad03e83ef6eea464e 01-Aug-2012 Romain Guy <romainguy@google.com> Add dithering to gradients

Change-Id: Ic1208855bde3a254eca2fd7cef43e0f1318ce419
/frameworks/base/libs/hwui/SkiaShader.cpp
42e1e0d482d774cf18a55773e434f02edb9e4462 30-Jul-2012 Romain Guy <romainguy@google.com> Improve gradients

Avoid using textures for common gradients (two stops from 0.0 to 1.0)

Change-Id: Iff55d21b126c8cfc4cfb701669f2339c8f6b131a
/frameworks/base/libs/hwui/SkiaShader.cpp
a1d3c91afbd52c7e8b01f4a9060c5459f02ae7a5 13-Dec-2011 Romain Guy <romainguy@google.com> Further reduce the number of GL commands sent to the driver

Change-Id: Id922b2a166ea4573b767c27d3195e11c70320b23
/frameworks/base/libs/hwui/SkiaShader.cpp
d21b6e1fe337b35f62cf2028e9bd0637fd009a75 01-Dec-2011 Romain Guy <romainguy@google.com> Optimize away unnecessary state changes

Change-Id: I0f6816f9f6234853575ecee5033186ad19e76380
/frameworks/base/libs/hwui/SkiaShader.cpp
6203f6c8147069976342be8f42add797a50f9557 02-Aug-2011 Romain Guy <romainguy@google.com> Reduce the amount of data cached by the gradients cache.

Change-Id: I8546f5a5ecf38031c9a40bdcc434d4c7f22da63d
/frameworks/base/libs/hwui/SkiaShader.cpp
b50149825fae95b2918bcf67b2ddb773b9797068 29-Jul-2011 Romain Guy <romainguy@google.com> Correctly apply linear filter to drawBitmap(Rect, Rect)

Change-Id: I1049282e1996b1020c92cb7bec46e9f28e94e967
/frameworks/base/libs/hwui/SkiaShader.cpp
e3c26851dc315b730ea0fe5ef35bb1db81f6d675 26-Jul-2011 Romain Guy <romainguy@google.com> Improve rendering performance on some GPUs

This change sets textures filtering to GL_NEAREST by default. GL_LINEAR
filtering is only used when textures are transformed with a scale or
a rotation. This helps save a couple of fps on some GPUs.

Change-Id: I1efaa452c2c79905f00238e54d886a37203a2ac1
/frameworks/base/libs/hwui/SkiaShader.cpp
43ccf4663c822ddd435b7683cc05221f6169c6c3 15-Jan-2011 Romain Guy <romainguy@google.com> Don't crash Launcher on config change.

Change-Id: Ibbbd7146c5ff69e9639b433f39041053654d808c
/frameworks/base/libs/hwui/SkiaShader.cpp
24c00216687ac87fe531dc4d4168ac0c0ca04ea6 15-Jan-2011 Romain Guy <romainguy@google.com> Copy shaders when recording them in display lists.

Change-Id: I3f22dd35f1e31c9e5102955d76548098b7b0cd8d
/frameworks/base/libs/hwui/SkiaShader.cpp
01d065795794fa56be660d6346e4830eb7e90a41 11-Nov-2010 Romain Guy <romainguy@google.com> Reduce number of GL calls when drawing with shaders.

Change-Id: I27aca9f6d381d5c7e363d90a93225d185f2ff4e3
/frameworks/base/libs/hwui/SkiaShader.cpp
8164c2d338781c3a3c4a443941070dca5d88f2a7 26-Oct-2010 Romain Guy <romainguy@google.com> Don't change textures wrap modes on every draw.

Change-Id: If6d3f313778cc7f3e803a063338539c8b3e165e3
/frameworks/base/libs/hwui/SkiaShader.cpp
14830948d02f768c41b97b7a8d15e1b3cab78267 08-Oct-2010 Romain Guy <romainguy@google.com> Add 3D transforms support to all gradients.

Change-Id: I61409edd00dab3a11684a3f5e4f7df0afc734758
/frameworks/base/libs/hwui/SkiaShader.cpp
e3095e0c1e2a4a4f34f741aa386eae56536ca5aa 07-Oct-2010 Romain Guy <romainguy@google.com> Apply 3D transformations to gradient shaders.

This fixes only linear gradients. Sweep and radial gradients, as well as
bitmap shaders, will be fixed in a future commit.

Change-Id: I4eee4ff62e9bbf3b9339fc111a780167449ecfef
/frameworks/base/libs/hwui/SkiaShader.cpp
29d8997bd43b7c4ad37fc3d6f91eaafa74913c88 23-Sep-2010 Romain Guy <romainguy@android.com> Fix OpenGL errors in various places.

Change-Id: I3a4e115d8fb13b6c443e65460d92987b16f2524c
/frameworks/base/libs/hwui/SkiaShader.cpp
ddb80bebb0776e6d852aab6e8bba5d5591847a55 21-Sep-2010 Romain Guy <romainguy@google.com> Add support for circular gradients to the GL renderer.

This change also adds full support for local transformation matrices on
sweep and radial gradients.

Change-Id: Id8773bc0766575190e3f3d51984fc5e57b266c3f
/frameworks/base/libs/hwui/SkiaShader.cpp
ee916f14cbd1fe1422c063ce2ef7b185e2bc5c6f 21-Sep-2010 Romain Guy <romainguy@google.com> Add support for SweepGradient in the GL renderer.

Change-Id: I7aa397ed4e34655ead9ba1f5b4ce087665e0f022
/frameworks/base/libs/hwui/SkiaShader.cpp
759ea80dca64ad652110a129e0d8bf93fea79f61 17-Sep-2010 Romain Guy <romainguy@google.com> Add support for drawLines(), with anti-aliasing

Change-Id: I16c0593c5671490909dec13a85df601e1428a1a6
/frameworks/base/libs/hwui/SkiaShader.cpp
8aef54fa17f2a3753d9a8f2027629bc480088f69 02-Sep-2010 Romain Guy <romainguy@android.com> Add support for Canvas flags on save.

This is required for the rewrite of layers support.

Change-Id: I5c0867dcf5aeb0392c8d0fbab05febb0eaff70d9
/frameworks/base/libs/hwui/SkiaShader.cpp
0ba681bce12d522c5575dfccb5a6ca12f0fba746 13-Aug-2010 Romain Guy <romainguy@google.com> Fix GC issue, fix local shader transformations.

Change-Id: I208bdf89815dcd18dcadd43df932a77362918435
/frameworks/base/libs/hwui/SkiaShader.cpp
a48a1a87ba17f20f7006eaab21dcedf86c015c13 10-Aug-2010 Romain Guy <romainguy@google.com> Fast text selection drawing.

Change-Id: I93fb1312b47bc05345defa9b6cfe47c0658bb329
/frameworks/base/libs/hwui/SkiaShader.cpp
61c8c9c5b2006d18e9310b6521c65b36ffe75ce4 10-Aug-2010 Romain Guy <romainguy@google.com> Fix tons of bugs and add new text rendering support.

Change-Id: I326c66b10784006f6df2f12d38e120cef94cd0d7
/frameworks/base/libs/hwui/SkiaShader.cpp
9cccc2b9bdd4850a3f9679569aaec3ab98477a5d 08-Aug-2010 Romain Guy <romainguy@android.com> Enforce maximum texture size.

When an app tries to render a bitmap or path larger than the GPU's maximum
texture size, the drawing command is ignored and a warning is logged. This
change also makes texture drawing more robust by catching potential errors
during texture creation.

This change also fixes a crash in the FontRenderer. The destructor would
sometimes try to free an uninitialized array.

Change-Id: I95ae0939c52192d97b340aa02417bf6d0c962c57
/frameworks/base/libs/hwui/SkiaShader.cpp
25ee037fee1607e8a77b1f2e259356e74dd6f645 06-Aug-2010 Romain Guy <romainguy@google.com> Fix incorrect memory cleanup in SkiaShader.

Bug #2895037

Change-Id: Id233c2a8a5b709dc9f26ff60aad989e9583a2382
/frameworks/base/libs/hwui/SkiaShader.cpp
6c07daf86c0d3824e1cd88fea455e2dd7b88cbcd 05-Aug-2010 Romain Guy <romainguy@google.com> Fix native crash in SkiaShader.

Bug #2893733

Change-Id: I7feb9ab113fe0012cf9eb271f2b044f12a5c9c4e
/frameworks/base/libs/hwui/SkiaShader.cpp
06f96e2652e4855b6520ad9dd70583677605b79a 31-Jul-2010 Romain Guy <romainguy@google.com> Refactor Skia shaders handling.

With this change, Skia shaders can easily be applied to any mesh. This change also
supports ComposeShader. For instance, this can be used to blend a gradient and a
bitmap togehter and paint a string of text with the result.

Change-Id: I701c2f9cf7f89b2ff58005e8a1d0d80ccf4a4aea
/frameworks/base/libs/hwui/SkiaShader.cpp