summaryrefslogtreecommitdiffstats
path: root/graphics/java/android/graphics/BitmapShader.java
Commit message (Collapse)AuthorAgeFilesLines
* Workaround shader crashChris Craik2015-06-101-1/+3
| | | | | | bug:21706035 Change-Id: Ia1cd4824c742b2d6fc0feb2861ccfde0b6ac2189
* A bunch more cleanupsJohn Reck2015-04-301-3/+2
| | | | | | | | Switch a few places to using android::canvas instead of SkCanvas as well which eliminated some JNI Change-Id: I8f98b56442a06362b82b984cd1bd3a92398d8dbc
* Revert "A bunch more cleanups"John Reck2015-04-171-2/+3
| | | | | | This reverts commit c294d128d03bc9a9982b273a82516c04583438cc. Change-Id: Id1ebb236950f7c36c6d86e1dd95566d3a200748d
* A bunch more cleanupsJohn Reck2015-04-141-3/+2
| | | | | | | | Switch a few places to using android::canvas instead of SkCanvas as well which eliminated some JNI Change-Id: I8f98b56442a06362b82b984cd1bd3a92398d8dbc
* Cleanup Bitmap JNI attempt #2John Reck2015-03-051-1/+1
| | | | | | | | Original version missed a spot This reverts commit c02977e3bbfaaedcb1b1d67e1692becc7dddd59b. Change-Id: I56244ce10d709fcdef42a001fe4c6ba7b6bbb04d
* Revert "Cleanup Bitmap JNI"Chad Jones2015-03-051-1/+1
| | | | | | This reverts commit b2915245b74b3b5541b123e38403f8e26426b4b7. Change-Id: Idd7d7f33eec4ea5024c83de6b10d3d1a6ab2b17a
* Cleanup Bitmap JNIJohn Reck2015-03-051-1/+1
| | | | | | | | Fix a bunch of places where mNativeBitmap was being poked at directly, switch them either to the NDK API or to GraphicsJNI where it made sense Change-Id: I6b3df3712d6497cba828c2d3012e725cb4ebb64d
* Make updateLocalMatrix replace the current Matrix.Leon Scroggins III2014-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a bug introduced in I3c3316377874e89fccc85afb864bc038b0ef3890. CreateLocalMatrixShader combines the existing matrix with the new matrix, which is not what we want. Keep track of the original SkShader at all times, and always create the local matrix shader with the original. Store the SkShader with a local matrix as Shader.native_with_local_matrix. Make Shader.native_instance private. Instead of allowing direct access, add an init() method which sets it, and getNativeInstance(), which returns either native_instance or native_with_local_matrix, as appropriate. Make Shader subclasses call init(), instead of setting native_instance directly. Pass native_with_local_matrix pointer to nativeSetLocalMatrix and nativeDestructor, which unrefs it (if not null). Since nativeSetLocalMatrix no longer replaces the original, do not unref it. Add a comment to Shader.updateLocalMatrix that it does not affect ComposeShaders created with this Shader. (This should have been a part of I3c3316377874e89fccc85afb864bc038b0ef3890.) BUG:16293121 Change-Id: Ieb31c7e1fe99081f6b81493178f4a18d3c5df643
* Inspect SkShader to determine hw shader.Leon Scroggins III2014-05-221-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* AArch64: Make graphics classes 64-bit compatibleAshok Bhat2014-01-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This a merger of two commits submitted to AOSP by the following authors: ashok.bhat@arm.com, david.butcher@arm.coma craig.barber@arm.com, kevin.petit@arm.com and marcus.oakland@arm.com Due to the very large number of internal conflicts, I have chosen to cherry-pick this change instead of letting it merge through AOSP because the merge conflict resolution would be very hard to review. Commit messages below: ================================================ AArch64: Make graphics classes 64-bit compatible Changes in this patch include [x] Long is used to store native pointers as they can be 64-bit. [x] Some minor changes have been done to conform with standard JNI practice (e.g. use of jint instead of int in JNI function prototypes) [x] AssetAtlasManager is not completely 64-bit compatible yet. Specifically mAtlasMap member has to be converted to hold native pointer using long. Added a TODO to AssetAtlasManager.java to indicate the change required. Signed-off-by: Ashok Bhat <ashok.bhat@arm.com> Signed-off-by: Craig Barber <craig.barber@arm.com> Signed-off-by: Kévin PETIT <kevin.petit@arm.com> Signed-off-by: Marcus Oakland <marcus.oakland@arm.com> ================================================================== AArch64: Use long for pointers in graphics/Camera For storing pointers, long is used in android/graphics/Camera class, as native pointers can be 64-bit. In addition, some minor changes have been done to conform with standard JNI practice (e.g. use of jint instead of int in JNI function prototypes) Signed-off-by: Ashok Bhat <ashok.bhat@arm.com> Signed-off-by: Marcus Oakland <marcus.oakland@arm.com> =================================================================== Change-Id: Id5793fa0ebc17ee8b1eecf4b3f327977fdccff71
* Revert "AArch64: Make graphics classes 64-bit compatible"Narayan Kamath2014-01-271-3/+3
| | | | | | This reverts commit 18b4cbeedef21c1fa666a110a157bab66edff976. Change-Id: I0c52983a3ab1ace3ff743de546a43eca28e5cb0e
* AArch64: Make graphics classes 64-bit compatibleAshok Bhat2014-01-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This a merger of two commits submitted to AOSP by the following authors: ashok.bhat@arm.com, david.butcher@arm.coma craig.barber@arm.com, kevin.petit@arm.com and marcus.oakland@arm.com Due to the very large number of internal conflicts, I have chosen to cherry-pick this change instead of letting it merge through AOSP because the merge conflict resolution would be very hard to review. Commit messages below: ================================================ AArch64: Make graphics classes 64-bit compatible Changes in this patch include [x] Long is used to store native pointers as they can be 64-bit. [x] Some minor changes have been done to conform with standard JNI practice (e.g. use of jint instead of int in JNI function prototypes) [x] AssetAtlasManager is not completely 64-bit compatible yet. Specifically mAtlasMap member has to be converted to hold native pointer using long. Added a TODO to AssetAtlasManager.java to indicate the change required. Signed-off-by: Ashok Bhat <ashok.bhat@arm.com> Signed-off-by: Craig Barber <craig.barber@arm.com> Signed-off-by: Kévin PETIT <kevin.petit@arm.com> Signed-off-by: Marcus Oakland <marcus.oakland@arm.com> ================================================================== AArch64: Use long for pointers in graphics/Camera For storing pointers, long is used in android/graphics/Camera class, as native pointers can be 64-bit. In addition, some minor changes have been done to conform with standard JNI practice (e.g. use of jint instead of int in JNI function prototypes) Signed-off-by: Ashok Bhat <ashok.bhat@arm.com> Signed-off-by: Marcus Oakland <marcus.oakland@arm.com> =================================================================== Change-Id: Ib3eab85ed97ea3e3c227617c20f8d213f17d4ba0
* Fix Paint Shader copyFabrice Di Meglio2013-08-011-0/+15
| | | | | | | | | | - Paint.setClassVariablesFrom(Paint paint) was using the same Shader for the copy as the initial Paint. Make sure that we are using a copy. - implement a copy() API for shaders See bug #7034321 Need Drawable RTL support Change-Id: I4b9cee386edc72ad670723266333b85f4d2b0ab8
* Ensure bitmaps aren't freed while referenced from a display listPatrick Dubroy2010-12-201-1/+2
| | | | | Also removes the reference queue finalizers. They aren't necessary anymore now that Bitmaps are allocated in the heap.
* Fix GC issue, fix local shader transformations.Romain Guy2010-08-121-0/+7
| | | | Change-Id: I208bdf89815dcd18dcadd43df932a77362918435
* Refactor Skia shaders handling.Romain Guy2010-07-301-20/+6
| | | | | | | | 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
* Correctly support pre-multiplied alpha, optimizations, more stuff.Romain Guy2010-07-121-9/+23
| | | | | | | | | | | | | | Add support for the following drawing functions: - drawBitmap(int[]...) - drawPaint() Optimizes shader state changes by enabling/disabling attribute arrays only when needed. Adds quick rejects when drawing trivial shapes to avoid unnecessary OpenGL operations. Change-Id: Ic2c6c2ed1523d08a63a8c95601a1ec40b6c7fbc9
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+41
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-41/+0
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+41