summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderProxy.h
AgeCommit message (Collapse)Author
2017-05-22Improve time to texture destructionJohn Reck
Eliminate textureCache.mGarbage which is only cleared in a trimMemory. Instead when we hit ~Bitmap post a message to RenderThread to release the texture immediately Bug: 38258699 Test: manual Change-Id: I962ba275e89afb628ba02f74769287edbab9fed4
2017-05-17Revert "Fix recent apps in system UI for Skia pipeline"John Reck
This reverts commit 625dd56a45bfe95c5f1baa1891529503ff3374a9. Reason for revert: Caused a memory leak, b/38330767 Bug: 38136140 Bug: 38330767 Test: manual, verified memory isn't leaking doing the steps in b/38330767 Change-Id: I998bea04788d58ba6bad71c1691d5a3b33190c1b Merged-In: I98b2dfd750be57a15785808e2d5723616e2ce20a
2017-05-12Fix recent apps in system UI for Skia pipelineStan Iliev
Enable HW Bitmaps for Skia pipeline just enough to make recent apps list working by adding support for BitmapShader. Drawing HW bitmaps in a canvas is also supported. Test: recent apps work, HWUI unit tests pass, CTS tests pass. bug: 38136140 Change-Id: Ibd06c859c86dc213310d5ce5272497e1882d0cc6 Merged-In: Ibd06c859c86dc213310d5ce5272497e1882d0cc6
2017-02-21Overhaul GraphicsStatsServiceJohn Reck
* LRU cache of recently-used is dead, replaced disk storage * ASHMEM size is read from native by the system service, no longer requires keeping a sizeof() in sync with a constant in Java * Supports dumping in proto format by passing --proto * Rotates logs on a daily basis * Keeps a history of the most recent 3 days Bug: 33705836 Test: Manual. Verified log rotating works by setting it up to rotate every minute instead of day. Confirmed /data/system/graphicsstats only has the most recent 3 entries after several minutes Change-Id: Ib84bafb26c58701cc86f123236de4fff01aaa4aa
2017-01-25Overhaul RenderNode's DisplayList managementJohn Reck
* Move mValid to native * Have destroyHardwareResources destroy everything * Remove flaky mParentCount checks in setStaging * All tree updates have an internal observer to ensure onRemovedFromTree() is a reliable signal * onRemovedFromTree() immediately releases resources to avoid displaylist "leaks" Test: Unit tests for validity added & pass, manually verified that b/34072929 doesn't repro Bug: 34072929 Change-Id: I856534b4ed1b7f009fc4b7cd13209b97fa42a71c
2016-11-18Support readback from hardware bitmapssergeyv
Test: hwuimacro readbackFromHBitmap --onscreen. bug:30999911 Change-Id: I369c069c40cb0f9adae5a94501815f29c2d7df0f
2016-10-31Routine to upload hardware bitmapssergeyv
Change-Id: Id8283a0975325e6830d55fd1e33c5f292a1e9be0 Test: refactoring cl. bug:30999911
2016-10-21Use Bitmap in DisplayList & RecordedOps instead of SkBitmapsergeyv
Test: refactoring cl. bug:32216791 Change-Id: I1d8a9a6e772e2176b6c2409409a910478b45f8db
2016-10-11Linear blending, step 1Romain Guy
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
2016-09-07Add API to copy a windowJohn Reck
Change-Id: I9bb5209010db6665be4b6f8db81a6fc1b7debc45
2016-08-02Eliminate recents upload jank am: 4387190d8e am: 021a952150John Reck
am: 897b9effb7 Change-Id: Iab2f01b5b3a9be6946e36169209c281a3320ed14
2016-08-01Eliminate recents upload jankJohn Reck
Bug: 30342017 Upload recents thumbnails in the dead gaps between frames instead of at the start of a frame. This eliminates jank caused by the large texture upload. Change-Id: I507cd286d199109c7a9a1511d68ba5ab5d28069f
2016-07-07Merge changes from topic \\'fifo\\' into nyc-mr1-dev am: a96d445aefTim Murray
am: 03b34e402c Change-Id: If3104889f659aef9a6d7035e18ab839544c9ecb3
2016-07-07Add new mode for SCHED_FIFO on UI and RenderThreads.Tim Murray
Add a new mode, controlled by sys.use_fifo_ui property, that enables the top app's UI and RenderThread to be SCHED_FIFO. This eliminates almost all jank due to scheduling competition with non-UI critical threads. This mode may not be suitable for all devices. bug 24503801 Change-Id: I7b8a31830ad80f7efa00236928d5476998ed4e00
2016-07-06Benchmark-mode for macrobenchJohn Reck
Adds googlebench output format support Adds offscreen rendering for >60fps benchmarking Adds 'all' alias to run all registered TestScenes Change-Id: I2579e40f2f4c941bfbd90c75efbee384c08a116b
2016-06-29Remove unused method from RenderProxy and CanvasContext.Derek Sollenberger
Change-Id: I324bbfa40a2155d0212fa20c6bd39df5bb21d27a
2016-06-21Delete unused argsJohn Reck
Bug: 21170575 Change-Id: Icc832f70f206342557f44667ad3498405d04db78
2016-04-26API tweaks to PixelCopy and make it publicJohn Reck
Bug: 27708453 Change-Id: I81667ce42f9ca1c1a13e1e61299927900845fc84
2016-04-14Revert "Revert "Make stopped state a first-class thing""John Reck
This reverts commit eab3f2658aa41d37c3b05d49a2ce4e3f4ed85399. Fixes first-frame issue, mReportNextDraw needs to override mStopped Fixes: 28118961 Fixes: 27286867 Change-Id: I5c811759637d08ba9f3b342016d1b3006986d5a2
2016-04-12Merge "Framework-side of SurfaceView#getBitmap" into nyc-devJohn Reck
2016-04-11Framework-side of SurfaceView#getBitmapJohn Reck
Bug: 27708453 Change-Id: Ie6fd7eca522d3e6549d8af587c975fd7e6053649
2016-04-11Merge "Revert "Make stopped state a first-class thing"" into nyc-devJohn Reck
2016-04-11Revert "Make stopped state a first-class thing"John Reck
This reverts commit 945961f78a78eced823d5ba78505c781b079703d. Change-Id: Iebc1d49fac33380233f8785fc39bec6c30a5e714
2016-04-08Merge "Make stopped state a first-class thing" into nyc-devJohn Reck
2016-04-08Merge "Fix a derp" into nyc-devJohn Reck
2016-04-07Fix a derpJohn Reck
Fixes: 28074465 I knew I added that flag for a reason... Change-Id: I6e28237dcd50191769a828bf2646c3a00c14387c
2016-04-07Make stopped state a first-class thingJohn Reck
Bug: 27286867 WindowManager has committed to stopped state controlling the lifecycle of the Surface, so make that a first-class thing in HWUI as well. This makes it more resistent to things like a rogue updateSurface() happening while mStopped=true, leading to bad things down the line. Instead let the surface be changed/updated as often as desired, and just block any attempt to draw on that surface. Also removes some unnecessary makeCurrent()s, as EglManager ensures that we *always* have a valid GL context now (using a pbuffer surface if there is no window surface set) Change-Id: Iead78ddebc7997e8fdb0c9534836352f5e54b9bd
2016-04-07Fix some edge casesJohn Reck
Bug: 27709981 This desperately needs a refactor, but to keep the current (really needed & nice) behavior of dispatching after sync finishes would be difficult to handle cleanly without lots of ripping so... #yolo Change-Id: I831a06c6ae7412a062720d68ecbe3085190f0258
2016-02-09updates to FrameStatsObserver APIAndres Morales
- Rename to FrameMetrics to avoid collision with existing android.view.FrameStats class - Make FrameMetricsObserver implementation detail, exposing FrameMetricsListener interface as public API and wrapping in FrameStatsObserver to maintain state - Remove dropped frame count call, in favor of passing as parameter to callback method. - Move away from raw timestamp access in favor of Metric IDs which represent higher-level, more stable stages in a frame lifecycle and match the categories exposed in the onscreen bars. - Support many-to-many Window<->FrameMetricsListener relationship Change-Id: I00e741d664d4c868b1b6d0131a23f8316bd8c5c2
2016-02-04Have RT drive window positioningJohn Reck
Bug: 22802885 Change-Id: I6beed5474d3a943b16e9097f7bd61ce3cbd37505
2016-01-22expose hwui frame stats through FrameStatsObserverAndres Morales
Change-Id: I88884bafc8e2f6d7f67a36d3609490e83cf8afd5
2016-01-19Merge "fix race condition between HWUI cache and renderThread" am: 2c2b5e8514John Reck
am: 4354ae9883 * commit '4354ae9883ae1282ac457539f46d529bdfa89fec': fix race condition between HWUI cache and renderThread
2016-01-19fix race condition between HWUI cache and renderThreadThomas Buhot
getMaximumBitmapWidth() and getMaximumBitmapHeight() of DisplayListCanvas need HWUI cache instance. Since the initialization of the cache is asynchronous it may crash if not yet ready. Add a staticFence() call to guarantee the cache has been created prior issuing the call. Change-Id: I5ed9e5cc084444c8d1872a77fef50e294ae14e93 Signed-off-by: Thomas Buhot <thomas.buhot@intel.com> Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
2015-12-16resolve merge conflicts of 04ce46db64 to master.John Reck
Change-Id: I935bb47718f0e7d5fb48945dd8de6e28dac136e5
2015-12-10libhwui: make setSurface asynchronousThomas Buhot
On the critical path of the cold launch of applications the main thread of the started application tells the RenderThread to create a surface. This process is synchronous and blocks the main thread of the application until the creation of the EGLContext is complete. As a consequence the launch time of the application is delayed by time spent allocating the EGL Context in the RenderThread. With this optimization the launch time of any application is improved (for example settings by 20 to 40 ms). Change-Id: Ibf47aaa0abb8dedf7aa00693073db3785d9d6b08 Signed-off-by: Thomas Buhot <thomas.buhot@intel.com> Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
2015-11-10Fix threading issuesJohn Reck
Bug: 25584167 Change-Id: I413ef9e0c86f7cca1f7d085e0071745ca0192853
2015-11-03Remove almost-all android::Singleton usersJohn Reck
Bug: 25426213 Change-Id: I88e6206e8915cce95c3a8a8a82a4bb8fbf668141
2015-10-16Rename DisplayListData to DisplayListChris Craik
Change-Id: I25f6bb88ffdf9baf7e8e4e2a294aa8c9d2a4605b
2015-10-02Rendering the window frame with a second threadSkuhne
Using a multi threaded render node to render the window frame asynchronously from the application relayout. Bug: 22527834 Bug: 24400680 Bug: 24459827 Bug: 24409773 Bug: 24537510 Change-Id: I1010fc6a8b6e38424178140afa3ca124433ab7e4
2015-09-21MultiThreaded rendering of different renderNodesSkuhne
This is adding the renderer side infrastructure to allow rendering multiple render nodes with different threads. This is a pre-step for decoupling a non client decor resize reder from a content resize render. Multiple render nodes can be added to be drawn, and to prevent overdrawing, a content bounds area can be set Bug: 22527834 Change-Id: Ie7271e20895bf38957e5a84aeefc883e282039ad
2015-08-26Serializing display listsJohn Reck
This is a WIP prototype Change-Id: Id4bfcf2b7bf905221c3734b7b6887c9b2efd37e6
2015-07-30Replace most usages of utils/Vector.hJohn Reck
Change-Id: I540d1b3523244d6c71fc52d6fb30555271c25644
2015-05-14Adjust light source for window positionAlan Viverette
Bug: 16523629 Change-Id: I2f3fed1edcac0a3cfd5034aded45e08ececfebaf
2015-05-05Merge "Cleanup properties" into mnc-devChris Craik
2015-05-05Dump profile info after running testJohn Reck
Bug: 20824843 Not really a proper "benchmark mode" but it turns out we already have reasonably good profile data, so tweak the test app to spit it out after a run. Change-Id: Iaee9c0d61b5508daf282fe5f95d0b37ee419a8f1
2015-05-05Cleanup propertiesChris Craik
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
2015-04-30A bunch more cleanupsJohn Reck
Switch a few places to using android::canvas instead of SkCanvas as well which eliminated some JNI Change-Id: I8f98b56442a06362b82b984cd1bd3a92398d8dbc
2015-04-17Revert "A bunch more cleanups"John Reck
This reverts commit c294d128d03bc9a9982b273a82516c04583438cc. Change-Id: Id1ebb236950f7c36c6d86e1dd95566d3a200748d
2015-04-14A bunch more cleanupsJohn Reck
Switch a few places to using android::canvas instead of SkCanvas as well which eliminated some JNI Change-Id: I8f98b56442a06362b82b984cd1bd3a92398d8dbc
2015-03-27Add GraphicsStatsServiceJohn Reck
More S's for More Speed Split JankTracker's backing data from the class to allow for data relocation to/from ashmem regions Pack the jank tracking data to fit in 256 bytes Change-Id: Ife86a64b71a328fbd0c8075fe6a0404e081f725b