summaryrefslogtreecommitdiffstats
path: root/libs/hwui
Commit message (Collapse)AuthorAgeFilesLines
* Draw stroked rectangle as meshes instead of texturesRomain Guy2012-10-021-4/+21
| | | | | | | | | | | Bug #7233734 Stroked rectangles were rendered using software generated textures which would lead to slightly misaligned results. Instead, let's use the new convex path rendering code that will do the right thing (and save a lot of bandwidth.) Change-Id: Ib95ff581e56c1ecead97e4919298e6fd146ca167
* Quick reject empty pathsChris Craik2012-10-012-1/+11
| | | | | | | | | bug:7260035 Adding a circle of radius 0 to a path is a no-op in skia, so detect this case both in the PathRenderer, and in quickReject(). Change-Id: I7a172db49a5d5351b4734b39d4e4ca6379658096
* Fix texture corruptionChet Haase2012-09-303-34/+36
| | | | | | | | | | | | | | | | | | | | | | When memory gets low on a device, activities flush everything they can. Hardware-accelerated activites, such as Launcher, flush GL resources and destroy the GL context. However, some resources were still hanging around, due to deferred destruction policies (we don't delete layers until the DisplayLists they are in are finalized, to ensure we don't deref deleted objects). This meant that we were referring to obsolete GL data in these objects. in particular, it meant that we might come around later, after a new GL context was created, and delete a texture object that was incorrect. We use the layer's "texture id" to refer to the texture underlying the layer. But if there's a new GL context, then this texture ID is no longer valid, and we may be deleting the texture that a different object (layer, icon, whatever) is referring to, because the driver may return that same ID under the new GL context. The fix is to more aggressively delete things that we know will not be used again when the GL context is destroyed. In particular, we delete all resources being used by all DisplayLists at GL context destruction time. Issue #7195815 Textures corruption on all devices, in many apps Change-Id: I52d2d208173690dbb794a83402d38f14ea4c6c22
* Fix a couple of rendering issuesRomain Guy2012-09-287-13/+33
| | | | | | | | | | | Bug #7253839 1. Make sure we don't make GL calls while recording display lists 2. Disable an early and trivial clip optimization in font renderer when a perspective transformation is used on the Canvas Change-Id: I3f1052164239329346854f72d0a0d401fbfecf06
* Merge "Plug memory leak that happens when reusing display lists Bug ↵Hiroshi Lockheimer2012-09-271-6/+8
|\ | | | | | | #7195815" into jb-mr1-dev
| * Plug memory leak that happens when reusing display listsRomain Guy2012-09-271-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Bug #7195815 We did not reclaim resources when reusing an existing DisplayList to record a new empty list of commands. This would lead to various memory leaks: bitmaps, paints, paths, matrices, etc. This is not a common case but some apps run into this situation, such as Launcher. Change-Id: I2eb14ac86a212123f8edbe42b70a7c1c51fa4145
* | Merge changes I9873540e,I4f6c38e3 into jb-mr1-devRomain Guy2012-09-277-8/+63
|\ \ | |/ | | | | | | | | * changes: Skia's ColorMatrix vector is in the 0..255 range not 0..1 Bug #7248980 Don't use the QCOM_tiled_rendering extension with functors Bug #7247880
| * Skia's ColorMatrix vector is in the 0..255 range not 0..1Romain Guy2012-09-271-0/+6
| | | | | | | | | | | | Bug #7248980 Change-Id: I9873540e3bc1ea0526ea0884279a427c0de96006
| * Don't use the QCOM_tiled_rendering extension with functorsRomain Guy2012-09-276-8/+57
| | | | | | | | | | | | Bug #7247880 Change-Id: I4f6c38e37b953c58e6107097c613891a49dac766
* | Fix rectangle AA offset calculationChris Craik2012-09-272-29/+54
| | | | | | | | | | | | | | | | | | | | bug:4419017 Fixes compiler warning Handle bezier thresholds with large stroke widths better Fix sub-hairlines (for scaleX == scaleY) Change-Id: Ida387483348ee61424b7fba729abca2a88bd68b3
* | Merge "Add stroke support to polygonal shape rendering" into jb-mr1-devChris Craik2012-09-277-179/+362
|\ \ | |/ |/|
| * Add stroke support to polygonal shape renderingChris Craik2012-09-267-179/+362
| | | | | | | | | | | | | | | | | | | | | | | | bug:4419017 bug:7230005 - Adds support for stroke/strokeAndFill for shapes without joins - Fixes path-polygonization threshold calculation - Fixes rendering offset (now only used for points) - Several formatting fixes Change-Id: If72473dc881e45752e2ec212d0dcd1e3f97979ea
* | Merge "Make gradients beautiful again Bug #7239634" into jb-mr1-devRomain Guy2012-09-263-10/+19
|\ \ | |/ |/|
| * Make gradients beautiful againRomain Guy2012-09-263-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug #7239634 This change passes two matrices to the vertex shader instead of one. We used to compute the final MVP matrix on the CPU to minimize the number of operations in the vertex shaders. Shader compilers are however smart enough to perform this optimization for us. Since we need the MV matrix to properly compute gradients dithering, this change splits the MVP matrix into two. This has the advantage of removing one matrix multiplication per drawing operation on the CPU. The SGX 540 shader compiler produces the same number of instructions in both cases. There is no penalty hit with having two matrices instead of one. We also send so few vertices per frame that it does not matter very much. Change-Id: I17d47ac4772615418e0e1885b97493d31435a936
* | Merge "Applies a layer's color filter even when the layer is a quad Bug ↵Romain Guy2012-09-261-5/+5
|\ \ | |/ | | | | #7238059" into jb-mr1-dev
| * Applies a layer's color filter even when the layer is a quadRomain Guy2012-09-261-5/+5
| | | | | | | | | | | | Bug #7238059 Change-Id: Ib4736a419bc1a9a67a01d090516ed049fe3aebca
* | Assign default texture id of 0Chet Haase2012-09-265-15/+13
|/ | | | | | | | | | Some logic depends on a default value of 0, which was not being assigned. Issue #7195815 chrome url bar is corrupted Issue #7190656 Textures corrupted on mr1 Change-Id: I346b7b76e885bf8f04740e711fd88f917a5418c7
* fix a possible dead-lock when clearing cachesMathias Agopian2012-09-251-9/+17
| | | | | Bug: 7195815 Change-Id: I8e226b7ec445f9f4fe46ae216ef7cc41efc5a0fd
* make sure to destroy GL objects on the GL threadMathias Agopian2012-09-252-3/+2
| | | | | Bug: 7195815 Change-Id: I5bcac61cd0b903d1ccca0754fdb9cb1023efbe0f
* Revert "Deleting objects on the wrong thread is a silly idea Bug #7195815"Dave Burke2012-09-255-11/+25
| | | | | | This reverts commit 8a1374946a928fcba7495c87ff6adda327fdfb9f Change-Id: I53564a6c531d334afcc1fce0bea1e57ae266aa78
* Deleting objects on the wrong thread is a silly ideaRomain Guy2012-09-255-25/+11
| | | | | | | | Bug #7195815 Turns out that multi-threading is hard. Change-Id: Ib0b4bd6dc3caea27f7ced22cbb363bb955fe58ab
* Don't destroy the same texture twiceRomain Guy2012-09-251-7/+19
| | | | | | | | | | | | | Bug #7221449 SurfaceTexture already deletes the GL texture when detachFromContext is invoked. The newly introduced refcount would casue the Layer object to be destroyed later and attempt to delete the GL texture again. By the time the second cleanup occurs, the texture name might have been reused by somebody else, resulting in erroneous behaviors. Change-Id: I257c589fea64b34c00f46fbfaa7732e6854a5e41
* Fix alpha channel computation with ColorMatrixColorFilterRomain Guy2012-09-253-11/+13
| | | | | | | | | | | Bug #7222476 There were two issues: - Blending was ignored with color filters - The addition vector of a color filter was treated as integer values instead of float values Change-Id: Id94065704a30ee8aaaa5724a9f3a3cff7c50ced7
* Merge into jb-mr1-devJean-Baptiste Queru2012-09-253-46/+85
|\ | | | | | | Change-Id: I7b777c7a4818d699582419d2eb4fc1f5cc0f4f46
| * Add a property to disable libhwui's scissor optimizationRomain Guy2012-09-243-46/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug #7158326 When scissor optimization is enabled, OpenGLRenderer will attempt to minimize the use of scissor by selectively enabling and disabling the GL scissor test. When the optimization is disabled, OpenGLRenderer will keep the GL scissor test enabled and change the scissor rect as needed. Some GPUs (for instance the SGX 540) perform better when changing the scissor rect often than when enabling/disabling the scissor test often. Change-Id: Idb68862e287a23358f9188d577ae0f86161902fd
* | Merge "Avoid deadlock when deleting layers Bug #7217459" into jb-mr1-devRomain Guy2012-09-234-9/+18
|\ \ | |/
| * Avoid deadlock when deleting layersRomain Guy2012-09-234-9/+18
| | | | | | | | | | | | Bug #7217459 Change-Id: I12bfa6c30c5030bd1b23ea6a3ce64240ab1dfba3
* | Merge changes Ib0a0b7d1,Ibec4b2aa into jb-mr1-devRomain Guy2012-09-232-28/+24
|\ \ | |/ | | | | | | | | * changes: Fix overdraw debug on QCOM Make sure we never bind to texture #0 Bug #7195815
| * Fix overdraw debug on QCOMRomain Guy2012-09-231-5/+3
| | | | | | | | | | | | | | Disable the use of the tiling extension when overdraw debug is turned on. Change-Id: Ib0a0b7d1998146aa0c7efef2d3822f9997efb123
| * Make sure we never bind to texture #0Romain Guy2012-09-231-23/+21
| | | | | | | | | | | | Bug #7195815 Change-Id: Ibec4b2aa4c580419eb5eb61adae6c9c960694d0c
* | Optimize glyph cache texture uploadsChet Haase2012-09-233-7/+22
|/ | | | | | | | | | | | Only upload the changed area of the glyph cache, not the entire bitmap. Note that we can't do the full-on optimization here of copying a sub-rect of the bitmap because of GL ES 2 limitations, but we can at least copy the horizontal stripe containing the dirty rect, which can still be a big savings over uploading the entire bitmap. Issue #7158326 Bad framerates on MR1 (Mako, Manta, Prime) Change-Id: Iab38d53202650f757ead4658cf4287bdad2b3cb9
* Merge "Add support for a new developer setting: overdraw debugging" into ↵Romain Guy2012-09-217-6/+99
|\ | | | | | | jb-mr1-dev
| * Add support for a new developer setting: overdraw debuggingRomain Guy2012-09-217-6/+99
| | | | | | | | Change-Id: I350ba4486577c3289f82c20938f7a35138778727
* | Merge "Optimize shaders for dithered gradients" into jb-mr1-devChet Haase2012-09-212-20/+37
|\ \
| * | Optimize shaders for dithered gradientsChet Haase2012-09-212-20/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's faster to compute a dither calculation in the vertex shader and use a varying (letting the GPU interpolate the fragment values) than to perform that calculation in the fragment shader as part of a texture lookup. Issue #7207600 Prime mr1 shader performance issues Issue #7158326 Bad framerates on MR1 (Mako, Manta, Prime) Change-Id: I15789582a6e9e2d8b9dd22aa5b0f72f0ba1cce7f
* | | Merge "Finish this bit before I forget." into jb-mr1-devRomain Guy2012-09-211-1/+3
|\ \ \ | | |/ | |/|
| * | Finish this bit before I forget.Romain Guy2012-09-211-1/+3
| | | | | | | | | | | | | | | | | | This code is not enabled in current builds. Change-Id: I488ec9e94889efbf2c8f3312abfed4298a76b7f1
* | | Merge "Polygonal rendering of simple fill shapes" into jb-mr1-devChris Craik2012-09-2110-207/+581
|\ \ \ | |/ / |/| |
| * | Polygonal rendering of simple fill shapesChris Craik2012-09-2010-207/+581
| | | | | | | | | | | | | | | | | | bug:4419017 Change-Id: If0428e1732139786cba15f54b285d880e4a56b89
* | | Update layers in a single batch at the beginning of a frameRomain Guy2012-09-214-44/+121
| |/ |/| | | | | | | | | Bug #7186819 Change-Id: Ice5926dfedfb3be3a3064e65008dafa2852407da
* | Optimize tiling managementRomain Guy2012-09-203-13/+5
|/ | | | | | Bug #7186819 Change-Id: Iebc42a6e9c96ad5605fbbe1539aa887695d2e829
* Add support for QCOM_tiled_renderingRomain Guy2012-09-193-16/+56
| | | | | | | | | Bug #7186819 This optional OpenGL extension can be used by tiled renderers to optimize copies from main memory to tiles memory. Change-Id: Id4a5d64e61ad17f50e773e8104b9bf584bb65077
* Minimize state changes when updating layersRomain Guy2012-09-185-11/+75
| | | | Change-Id: I407fcc80bd3178f9f09a3b379ceb7f7ce0749e08
* Fix GL shader bugsChet Haase2012-09-182-7/+7
| | | | | | | Fixing errors in emitted shader code that caused GL errors at runtime Change-Id: I267a84398a81329a6688b292505f8779bd750ad1
* Merge "Fix bad shader code" into jb-mr1-devChet Haase2012-09-171-2/+2
|\
| * Fix bad shader codeChet Haase2012-09-171-2/+2
| | | | | | | | | | | | Shader code missing "=" in a couple of cases. Change-Id: Iff8a99a0ccb2903c30e2bdb2f698ef9b2e03d5d1
* | Merge "Fix occasional crash bug with layers" into jb-mr1-devChet Haase2012-09-179-37/+87
|\ \ | |/ |/|
| * Fix occasional crash bug with layersChet Haase2012-09-179-37/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Launcher occasionally crashes with a stack trace indicating that the memory of a Layer object is corrupt. It is possible for us to delete a Layer structure and then, briefly, use it to draw a DisplayList again before that DisplayList gets recreated (without the layer that got deleted). When this happens, if the memory got corrupted, it's possible to crash. The fix is to add Layer to the other objects which we currently refcount (bitmaps, shaders, etc.). Then instead of deleting a Layer, we decrement the refcount. We increment when creating it, then increment it again when it's referenced from a DisplayList. Then we decrement the refcount instead of deleting it, and decrement when we clear a DisplayList that refers to it. Then when the refcount reaches 0, we delete it. Issue #6994632 Native crash in launcher when trying to launch all apps screen Change-Id: I0627be8d49bb2f9ba8d158a84b764bb4e7df934c
* | Fix modulation and gamma correction issuesRomain Guy2012-09-142-39/+51
|/ | | | | | | | | | | | | | | | | | | | | | | Modulation is normally enabled in a shader when drawing with an alpha mask (A8 texture.) Modulation is used to do one of two things: - Colorize the primitive (to draw text in red for instance) - Apply extra translucency (50% translucent circle filled with a bitmap) The current implementation has four issues: 1. Unnecessary work is performed by assigning the modulation color to vec4 fragColor early in the shader 2. The modulation color's alpha is applied twice when the primitive is drawn with an SkShader 3. The decision to modulate is wrong and triggers when any of the RGB channels is < 1.0. Only the alpha channel needs to be taken into account to make the decision 4. Gamma correction is not applied properly This change addresses all four issues above. Change-Id: I73fcc74efc4b094bf2d1b835f10ffaa2ea4b9eb9
* Merge "Multiply alpha for AA as late as possible" into jb-mr1-devRomain Guy2012-09-141-5/+7
|\