summaryrefslogtreecommitdiff
path: root/libs/hwui/PathCache.cpp
Commit message (Collapse)AuthorAgeFilesLines
* remove (dead) caches from hwuiMike Reed2018-05-031-559/+0
| | | | | | Test: make Change-Id: I18bfe51896672272ce7d471eaead69b651399368
* Format the world (or just HWUI)John Reck2017-11-031-30/+31
| | | | | Test: No code changes, just ran through clang-format Change-Id: Id23aa4ec7eebc0446fe3a30260f33e7fd455bb8c
* Delete all ro.hwui.* propsJohn Reck2017-07-191-12/+5
| | | | | | | | | | | | | Remove all ro.hwui.* tuning props and instead calculate them from the screen resolution. Or just hardcode them to what all devices were hardcoding them to anyway. Bug: 63741221 Test: Check cache size results on sailfish Change-Id: I8b0d210572a246f4fefb076935cf5156a70c274c
* Use Bitmap in Texture.uploadsergeyv2016-10-261-22/+18
| | | | | | | Test: refactoring cl. bug:32216791 Change-Id: Ib0b16c878d8371e0471e9a502f55626ec5999c60
* use SkBlendMode instead of SkXfermodeMike Reed2016-10-131-2/+3
| | | | | | use sk_sp versions of paint setters/getters Change-Id: I86591a0a8ec92e6039776cbf00424ea24f585b28
* Fatal abort on invalid stateJohn Reck2016-10-121-5/+9
| | | | | | | | | | Use mCaches.size() to track item count instead of trying to do it manually on the side. Bug: 31856965 Test: manual, minimal. Repro steps for bug are unknown, fix is speculative as a result Change-Id: Ic32f27262548a99be95440881420d224ede4db74
* resolve merge conflicts of 24e38ab to stage-aosp-masterJohn Reck2016-08-221-2/+5
|\ | | | | | | Change-Id: I25844e17d2d6371ed786833c756051d19d0abec4
| * Fix native memory leak caused by small HWUI path cache creationcaiqinl2016-08-221-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HWUI calculates the texture size as w*h*bpp. In some cases, the calculated path cache is small, but the actual memory allocated in driver is 4k/8k/16k, much bigger than HWUI calculates. Example: a 5*65 alpha texture, HWUI think it is 5*65*1 = 325 bytes, but driver allocates 8K. An app can allocates up to 32M path textures, which actually consumes 32M*(8*1024/325) = 806M memory. Here we limit the number of path texture in the cache to 256, it should be a pretty generous global limit. Change-Id: I890819b73bb0b7f63e96bc3d9d0ff9469c16838c
* | HWUI: Fix snapping in path renderingsergeyv2016-08-041-2/+2
| | | | | | | | | | bug:30444274 Change-Id: Ib10058659af47625b366c26e0b872fa3f1854cd0
* | HWUI: Cleanup PathCachesergeyv2016-08-041-53/+31
| | | | | | | | Change-Id: I947ae79db2b0505ebbacecf15e685b4219451707
* | Stop comparing Descriptions with memcmpsergeyv2016-04-111-13/+56
| | | | | | | | | | bug:27894959 Change-Id: I379c11381c08f6f77577a914638b32415768f26e
* | Move several property queries to Properties classChris Craik2016-02-051-11/+4
| | | | | | | | | | | | | | | | | | | | bug:17478770 This removes a lot of redundant property query code, and puts the queries all in one place, so defining them automatically will be simpler in the future. Change-Id: I0428550e6081f07bc6554ffdf73b22284325abb8
* | Track texture memory globallyJohn Reck2016-01-141-28/+5
| | | | | | | | | | | | Also mostly consolidates texture creation Change-Id: Ifea01303afda531dcec99b8fe2a0f64cf2f24420
* | Merge "Fix HWUI Path Cache dangling pointer" am: 37bf3ec9d2 am: 7516d4d866John Reck2015-11-101-0/+7
|\| | | | | | | | | | | | | am: 1b85ce17a3 * commit '1b85ce17a316973a170b3932f2d0a9b02063eaa3': Fix HWUI Path Cache dangling pointer
| * Fix HWUI Path Cache dangling pointerDigish Pandya2015-11-091-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | When precache, PathTexture is added to PathCache, and it is released after drawn if we want to clean it. But the PathCache LRU still holds the entry of the PathTexture object. When trim the cache in the end of each frame, LRU finds that its mListener is not NULL and invoke the functor, however, mListerer points to the released PathTexture object and is a dangling pointer, thus leads to crash. Smart pointer don't help here since they only manage scopes, while PathTexture is also controled by its cleanup field. The fix is to also remove the LRU entry of PathTexture*, it will also release the texture object and there won't be texture leaks. Change-Id: Iaa0621df5dc71532e9e75b38ad94384353930b95
* | Remove almost-all android::Singleton usersJohn Reck2015-11-031-0/+2
| | | | | | | | | | Bug: 25426213 Change-Id: I88e6206e8915cce95c3a8a8a82a4bb8fbf668141
* | Remove shader based gamma approachChris Craik2015-09-221-2/+2
| | | | | | | | | | | | Also fixes some INIT_LOGD logs Change-Id: I212a71a1e7b366aea41f7c3c8cc169d509d6e4a2
* | Replace most usages of utils/Vector.hJohn Reck2015-07-301-5/+2
| | | | | | | | Change-Id: I540d1b3523244d6c71fc52d6fb30555271c25644
* | Clean up unncessary definesChris Craik2015-07-141-3/+0
|/ | | | | | LOG_TAG and TRACE_TAG are already defined in the makefile Change-Id: I9e53e3dacbe018441edd74cb7c8c90846defee74
* Remove all usage of fmin and fmaxChris Craik2015-07-071-3/+3
| | | | | | | | bug:22208220 Removes needless call, and upconversion to doubles in multiple places. Change-Id: I1b949fa5f206446ac34de800154c0147d6bd8034
* Add tracing for path texture uploadChris Craik2015-05-131-0/+1
| | | | Change-Id: I4918e5a3c7e01b321d428b20babd48bf69a708e4
* Remove usage of Texture::cleanup in PathCacheChris Craik2015-05-111-25/+12
| | | | | | | | bug:21039605 Was causing double-deletes, is unneeded. Change-Id: I5c0a21d076fae7039d777ca09b21492f97fea98b
* Cleanup propertiesChris Craik2015-05-051-1/+1
| | | | | | | | | | | | bug:19967854 Separate properties from Caches, into static, RenderThread-only class. Also rewrites the means for java to set properties to correctly handle threading, and adds an override for profile bars so that SysUi doesn't clutter the screen with them. Change-Id: I6e21a96065f52b9ecc49d1a126244804ba106fa9
* Simplify TaskManager fallback pathChris Craik2015-04-201-3/+1
| | | | Change-Id: Ie3833449f7fe6aa69b9f71eb8bab1bef0fe434aa
* Use glops for text renderingChris Craik2015-03-181-30/+19
| | | | Change-Id: I5e155c8baf3149f0ff231ec3c89dbff6bb8eae92
* Refactor DisplayList path caching.Derek Sollenberger2015-03-131-48/+13
| | | | | | | | | | | This removes dependence on SkPath ptrs that HWUI does not control the lifecycle of. This clears up some errors where the paths are not generated from Java, but rather the Skia test suites. Cherry-pick of a change that originally landed in master-skia and is dependent on a skia merge (ag/655422). Change-Id: I41b9797a2b0af5d6b4ea51891565469d4f1d832d
* resolved conflicts for merge of c7e6b93a to masterJohn Reck2015-02-041-1/+3
|\ | | | | | | Change-Id: I4b791f37193727a0306214645f2f98cdf218cad0
| * am af6eaf65: Merge "Fix ANR caused by hwuiTask thread" automerge: 5ad36d4John Reck2015-02-041-1/+3
| |\ | | | | | | | | | | | | * commit 'af6eaf656ec0de5fcbea03968daffe2c845e2089': Fix ANR caused by hwuiTask thread
| | * Fix ANR caused by hwuiTask threadSangkyu Lee2015-01-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If hwuiTask thread is exited while HWUI renders something, some tasks can remain unfinished forever. This can make ANR problem if RenderThread waits this kind of tasks. According to the current implementation, hwuiTask threads are exited when HWUI receives trimMemory() callback with level >= 20 and some applications such as SystemUI can receive trimMemory() with level >= 20 even though they renders something yet. (For instance, when RecentsActivity in SystemUI is finished, HWUI receives trimMemory() callback with level >= 20 but SystemUI should still render the status bar and navigation bar.) This patch prevents the tasks from remaining unfinished and make the tasks executed immediately if they cannot be added to their TaskProcessors. Change-Id: I5bd26439aa5f183b1a7c1ce466362e27554b4d16
| | * Revert "Frameworks/base: Unused parameters in hwui"John Reck2014-11-221-1/+1
| | | | | | | | | | | | | | | | | | This reverts commit 42ddc18d108f789705ad4eb697ce9599ad322507. Change-Id: I3574a936a39a96314db6437d0a1eb58d260d893d
| * | Fix styleJohn Reck2014-12-121-1/+1
| | | | | | | | | | | | Change-Id: I7227b0eac126bf470ed50249a7809b845872983b
* | | Refactor blending and texture gl stateChris Craik2015-01-301-2/+2
| | | | | | | | | | | | Change-Id: Ia6b3c8b2afd3dfcee7f3ce401d846b789612054a
* | | Move more GL state management to RenderState and its directoryChris Craik2015-01-281-1/+0
| | | | | | | | | | | | Change-Id: Ic68584e1c08dc64be2ad43450cb6caa1de834fdc
* | | Add overrides and switch to nullptr keyword for all filesChris Craik2015-01-051-12/+12
| | | | | | | | | | | | | | | | | | | | | Adds remaining missing overrides and nullptr usages, missed due to an extreme failure in tool usage. Change-Id: I56abd72975a3999ad13330003c348db40f59aebf
* | | Revert "resolved conflicts for merge of 220c3f4f to master"Andreas Gampe2014-11-221-1/+1
|/ / | | | | | | | | | | | | | | Reverted as hwui doesn't agree. This reverts commit 8a902d9f24e83c87b054adb5836b4a5b8a257be9. Change-Id: I109e7b02bee2921e2155ded6df36f52e6f574b5a
* | resolved conflicts for merge of 99377df1 to lmp-mr1-dev-plus-aospAndreas Gampe2014-11-211-1/+1
|\| | | | | | | Change-Id: I3a98f55832ac447b1ed0dd129c7a93d088025943
| * Frameworks/base: Unused parameters in hwuiAndreas Gampe2014-11-211-1/+1
| | | | | | | | | | | | | | | | | | 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
* | resolve merge conflicts of 57b641a to lmp-mr1-dev-plus-aosp.Chris Craik2014-11-201-1/+1
|\ \ | |/ |/| | | Change-Id: I1be708f5a0cd4d64021a57f1063d54330f1d2d7e
| * Improve logging around performance critical eventsChris Craik2014-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | bug:17702227 Add details useful to developers (such as layer size/View name), and switch away from logging implementation names/details, since they are generally not relevant to developers. Change-Id: Iee605d182f241450f7e75a6d0c283d51fa1312f5
* | Frameworks/base: Wall Werror in libs/hwuiAndreas Gampe2014-11-101-1/+1
|/ | | | | | Turn on -Wall -Werror in libs/hwui. Fix errors. Change-Id: I74962d08c889712dacbd0d86d6760fc10802b6bd
* Minor cleanups around color usageChris Craik2014-07-171-1/+2
| | | | Change-Id: I56733cbe933a58d5977c032f056abb35265ee252
* Deep copy SkPath parameter to PathCache taskChris Craik2014-06-301-2/+2
| | | | | bug:15440706 Change-Id: I2b5b25f620df838cb1155cc8502d86ad3644c212
* stop using (deprecated) SkBitmap::ConfigMike Reed2014-06-201-2/+1
| | | | Change-Id: Ic75b5fc6996578e9d95bd3a220439ec1541d7c3b
* am b1c76a1a: Merge "Tessellate on worker threads" into lmp-preview-devChris Craik2014-06-101-12/+5
|\ | | | | | | | | * commit 'b1c76a1abcfb2f33e12fef37ec71d20724863b5e': Tessellate on worker threads
| * Tessellate on worker threadsChris Craik2014-06-101-12/+5
| | | | | | | | | | | | Tessellate and cache (where possible) shadow and round rect tessellation tasks. Change-Id: I2cfda8e11d83d51ea74af871235cf26e8f831d40
* | resolved conflicts for merge of b68f5f09 to masterKenny Root2014-05-301-2/+2
|\ \ | |/ |/| | | Change-Id: Ib8dd3a353f40a3357c8dc5ac591cd5e3ab4d0a4b
| * Fix a resource race bug in PathCacheyuyang2014-05-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When enabled defer rendering, it will do precache for DrawPathOp. The paint used for creating PathTask in precache just get the address of mFilteredPaint of OpenGLRenderer. So for the following defer operation like DrawTextOp has possibility change the mFilteredPaint by getPaint while another WorkerThread in PathCache is using the paint which pointed to the same address of mFilteredPaint to generate bitmap. As a result, it will generate a wrong bitmap for generateTexture in PathCache. To fix it, do a copy of paint when creating PathTask. CRs-Fixed: 664244 Change-Id: I5516f5b143458b88d3573d15b7ebb34f688800c7
* | am 328b7ee6: am aecb8c43: am 7b4cce68: am c3bac8a0: Merge "Fix graphics ↵Chris Craik2014-02-261-1/+3
|\| | | | | | | | | | | | | corruption caused by HWUI caches" * commit '328b7ee6a2ba2dc8f162fa57dbafd4bfc89bb72e': Fix graphics corruption caused by HWUI caches
| * Fix graphics corruption caused by HWUI cachesSangkyu Lee2014-02-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some caches(PatchCache, TextureCache, PathCache) for HWUI uses deferred removal for their cache entries even though actual resource objects are immediately freed by ResourceCache. For this reason, the uniqueness of a resource address in the caches is not guaranteed in specific cases. (Because malloc() can return the same address when malloc() and free() called very frequently.) So it can be possible the cache have two cache entries for two different resources but the same memory address. (Of course one of the resources is already freed.) It also can be possible mGarbage vector in PatchCache has duplicated addresses and this can lead to duplicated free blocks in the free block list and graphics corruption. (Deferred removal was implmeneted based on an assumption of unique resource addresses.) So this patch makes sure resource objects are freed after the resources are removed from the caches to guarantee the uniqueness of a resource address and prevent graphics corruption. Change-Id: I040f033a4fc783d2c4bc04b113589657c36fb15b Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
* | Use const where possible for drawing parametersChris Craik2014-01-031-10/+10
|/ | | | | | They should never be modified by a Renderer, only read and copied. Change-Id: I9d8d55dca19115ee9dfeb2bb3f092ba2fb327cd4