summaryrefslogtreecommitdiffstats
path: root/libs/hwui/SkiaShader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Inspect SkShader to determine hw shader.Leon Scroggins III2014-05-221-282/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Clip TouchFeedbackDrawable effect to receiver OutlineChris Craik2014-04-231-1/+44
| | | | | | | | 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
* Clean unused parameters, disable warningsChris Craik2013-10-171-4/+5
| | | | Change-Id: Iddb872f53075dd022eeef45265594d1c6a9e2bc0
* Introduce Caches::bindTexture() to reduce glBindTexture callsRomain Guy2013-06-041-12/+10
| | | | Change-Id: Ic345422567c020c0a9035ff51dcf2ae2a1fc59f4
* Apply ComposeShader's local matrix to childrenRomain Guy2013-03-181-2/+8
| | | | Change-Id: Idf9b8e7d7b30f8fcd8ba1fd4bfe8991e9ca148e2
* Pre-multiply color components for 2-stop gradientsRomain Guy2012-08-291-30/+5
| | | | | | Bug #7033344 Change-Id: Ia168501f1dc56ba7a1bb0c55078320432309a66a
* Add dithering to gradientsRomain Guy2012-08-011-0/+4
| | | | Change-Id: Ic1208855bde3a254eca2fd7cef43e0f1318ce419
* Improve gradientsRomain Guy2012-07-311-14/+51
| | | | | | Avoid using textures for common gradients (two stops from 0.0 to 1.0) Change-Id: Iff55d21b126c8cfc4cfb701669f2339c8f6b131a
* Further reduce the number of GL commands sent to the driverRomain Guy2011-12-131-9/+4
| | | | Change-Id: Id922b2a166ea4573b767c27d3195e11c70320b23
* Optimize away unnecessary state changesRomain Guy2011-11-301-2/+2
| | | | Change-Id: I0f6816f9f6234853575ecee5033186ad19e76380
* Reduce the amount of data cached by the gradients cache.Romain Guy2011-08-011-8/+2
| | | | Change-Id: I8546f5a5ecf38031c9a40bdcc434d4c7f22da63d
* Correctly apply linear filter to drawBitmap(Rect, Rect)Romain Guy2011-07-281-2/+5
| | | | Change-Id: I1049282e1996b1020c92cb7bec46e9f28e94e967
* Improve rendering performance on some GPUsRomain Guy2011-07-251-8/+4
| | | | | | | | 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
* Don't crash Launcher on config change.Romain Guy2011-01-141-10/+26
| | | | Change-Id: Ibbbd7146c5ff69e9639b433f39041053654d808c
* Copy shaders when recording them in display lists.Romain Guy2011-01-141-0/+56
| | | | Change-Id: I3f22dd35f1e31c9e5102955d76548098b7b0cd8d
* Reduce number of GL calls when drawing with shaders.Romain Guy2010-11-111-5/+4
| | | | Change-Id: I27aca9f6d381d5c7e363d90a93225d185f2ff4e3
* Don't change textures wrap modes on every draw.Romain Guy2010-10-251-9/+15
| | | | Change-Id: If6d3f313778cc7f3e803a063338539c8b3e165e3
* Add 3D transforms support to all gradients.Romain Guy2010-10-071-65/+38
| | | | Change-Id: I61409edd00dab3a11684a3f5e4f7df0afc734758
* Apply 3D transformations to gradient shaders.Romain Guy2010-10-061-19/+41
| | | | | | | This fixes only linear gradients. Sweep and radial gradients, as well as bitmap shaders, will be fixed in a future commit. Change-Id: I4eee4ff62e9bbf3b9339fc111a780167449ecfef
* Fix OpenGL errors in various places.Romain Guy2010-09-221-1/+6
| | | Change-Id: I3a4e115d8fb13b6c443e65460d92987b16f2524c
* Add support for circular gradients to the GL renderer.Romain Guy2010-09-211-1/+38
| | | | | | | This change also adds full support for local transformation matrices on sweep and radial gradients. Change-Id: Id8773bc0766575190e3f3d51984fc5e57b266c3f
* Add support for SweepGradient in the GL renderer.Romain Guy2010-09-201-2/+60
| | | | Change-Id: I7aa397ed4e34655ead9ba1f5b4ce087665e0f022
* Add support for drawLines(), with anti-aliasingRomain Guy2010-09-161-0/+23
| | | | Change-Id: I16c0593c5671490909dec13a85df601e1428a1a6
* Add support for Canvas flags on save.Romain Guy2010-09-011-2/+2
| | | | | | This is required for the rewrite of layers support. Change-Id: I5c0867dcf5aeb0392c8d0fbab05febb0eaff70d9
* Fix GC issue, fix local shader transformations.Romain Guy2010-08-121-1/+2
| | | | Change-Id: I208bdf89815dcd18dcadd43df932a77362918435
* Fast text selection drawing.Romain Guy2010-08-101-3/+0
| | | | Change-Id: I93fb1312b47bc05345defa9b6cfe47c0658bb329
* Fix tons of bugs and add new text rendering support.Romain Guy2010-08-101-1/+5
| | | | Change-Id: I326c66b10784006f6df2f12d38e120cef94cd0d7
* Enforce maximum texture size.Romain Guy2010-08-071-2/+8
| | | | | | | | | | | | 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
* Fix incorrect memory cleanup in SkiaShader.Romain Guy2010-08-061-3/+3
| | | | | | Bug #2895037 Change-Id: Id233c2a8a5b709dc9f26ff60aad989e9583a2382
* Fix native crash in SkiaShader.Romain Guy2010-08-041-8/+0
| | | | | | Bug #2893733 Change-Id: I7feb9ab113fe0012cf9eb271f2b044f12a5c9c4e
* Refactor Skia shaders handling.Romain Guy2010-07-301-0/+220
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