summaryrefslogtreecommitdiffstats
path: root/tests/HwAccelerationTest
Commit message (Collapse)AuthorAgeFilesLines
* Use path intersection instead of saveLayer+mesh to mask projected ripplesChris Craik2015-05-261-11/+7
| | | | | | | | | | | | | | | | | | | | | bug:14297149 SaveLayer's performance cost is high, and proportional to the surface being projected onto. Since ripples (even unbounded ones) are now always projected to the arbitrary background content behind them, this cost is especially important to avoid. This removes the last semi-secret, saveLayer from the projected ripple implementation. Also fixes the HW test app to correctly demonstrate this projection masking behavior. Additionaly, alters PathTessellator to gracefully handle counter-clockwise paths, and simplifies the work done by ShadowTessellator to ensure all of its paths are counterclockwise. Change-Id: Ibe9e12812bd10a774e20b1d444a140c368cbba8c
* Revert "Revert "Merge getDisplayList and updateDisplayListIfDirty""Chris Craik2015-05-011-3/+3
| | | | | | | | Fixes breakage from HwAccelerationTest This reverts commit b2847afde24aac22c8fb804cdce0c24b8a7c40c4. Change-Id: I762b3c9020fc1d06bac61ffa8b956049147515b1
* Remove HardwareCanvasChris Craik2015-03-101-3/+3
| | | | Change-Id: I239646a7f00f09d3f76fe6b6162eed86bc0d6e77
* Fix layer shader to store layer pointerChris Craik2015-02-181-3/+3
| | | | | | bug:19419672 Change-Id: I4277348ceab41fbf45a107a8b21f64e2b4af23e0
* Fix issue with RNA destruction mid-animationJohn Reck2014-12-091-0/+28
| | | | | | | | | Bug: 18521508 Fix an issue where an RNA's native object was destroyed before the java-side object was started Change-Id: I487fb476e0ecdf7000515f4f7320e8cfbc50a52b
* Surface:lockHardwareCanvasJohn Reck2014-10-213-0/+266
| | | | | | Bug: 17440886 Change-Id: I1f2d98c63ec1a2814c2258cf7e0096139263770a
* Disable RT-anim for AnimatorSetJohn Reck2014-09-051-3/+12
| | | | | | | | | Bug: 17317184 Unfortunately this will disable *all* RT animations in a scene, but we don't have more selective targetting currently Change-Id: I57e1c0ae43957f45229473bdcdaf34c05825fab7
* Animator stuffJohn Reck2014-08-271-6/+0
| | | | | | Bug: 17228458 Change-Id: Id884a429a512f9cd2be0ed16dbd0f10e92b4440d
* Return Animator instead of ValueAnimatorJohn Reck2014-07-191-2/+2
| | | | Change-Id: I29a7cfdc7ffbb3a4d33f9e64f9d7ca791f5c947c
* Tweaks to outline APIChris Craik2014-07-191-9/+16
| | | | | | | | | | b/15283203 b/16142564 Remove boolean return value chaining, as it's redundant with the data in the Outline itself. Change-Id: I3116e57cd1b35c98b74e95195117edd7e39fb2df
* Add RT-enabled reveal animatorJohn Reck2014-07-182-9/+110
| | | | | | | | | Bug: 16161431 Also re-writes RevealAnimator to avoid using any listeners internally, removing the logic around shadowing the update listeners. Change-Id: I6ed8126398eed971a87f20bccb7584c9acafbb6c
* Simplify Shader.setLocalMatrix.Leon Scroggins III2014-07-101-4/+5
| | | | | | | | | | | | | | | | Previously, calling setLocalMatrix updated any Paint that had the Shader attached. This depended on deprecated behavior in Skia. Use new Skia APIs, and do not modify any Paints that use the Shader. In addition, update callers to call setShader (again) after modifying the Shader. Sample app at ag/499573 for testing. Depends on I673801444f0a8fd4f192b5b7effdde1aa83e702b in external/skia. BUG:14315916 Change-Id: I3c3316377874e89fccc85afb864bc038b0ef3890
* Draw overlapping rectangles with color modulated.ztenghui2014-06-301-38/+87
| | | | | | | | Touch the screen to turn on / off depth test. Disalbe the vsync to get the real performance. Drawing 10 rectangles on N10 show almost 3x perf gain, in this setup. Change-Id: I97bb84f744e90c35febad8cb853ed877cda5e64f
* Preparing the new GL depth test.ztenghui2014-06-303-2/+329
| | | | | | Right now, the code is just copied from ApiDemos for the initial setup. Change-Id: I531f95faca744c7e91fadae189818af3d04a85ee
* Add setStartValue to RNAJohn Reck2014-06-021-6/+12
| | | | | | | | Bug: 15198607 Should be good-enough for Ripples to use for pseudo-chaining support. Change-Id: Ia8666928ccb69ae401cb583751632a52bd928b63
* Respect Z ordering in touch dispatch, software drawingChris Craik2014-05-284-11/+68
| | | | | bug:14390526 Change-Id: I617a6ea7dbac1facae246491a247cf307452fc0e
* Fix buildJi-Hwan Lee2014-05-171-3/+2
| | | | Change-Id: If0e46d6fa0f5b176c3b5294eab58d25935b3b4f8
* Fix buildChris Craik2014-05-161-1/+2
| | | | Change-Id: Ic0b36cd0f6525c4bc1ad365cd089e9a9fac9dc17
* Merge "Round rect outline clipping"Chris Craik2014-05-162-0/+96
|\
| * Round rect outline clippingChris Craik2014-05-152-0/+96
| | | | | | | | Change-Id: Iee9cf4f719f6f1917507b69189ad114fa365917b
* | Animator start value...John Reck2014-05-151-5/+6
|/ | | | Change-Id: Ifd35ed95a28c625086d7fa97764fe63ab4a997f1
* Add TimeInterpolator support to RNAJohn Reck2014-05-121-1/+7
| | | | | | Bug: 14678626 Change-Id: I6554e7fcd42c49fac3618ca792083bb68e358f55
* Allow all loopers to be RT-acceleratedJohn Reck2014-05-072-0/+105
| | | | | | Bug: 14445956 Change-Id: I03e92642aa118db5c7fefa1f09c3a5bde6ea671d
* Make RenderNodeAnimator and WebView play niceJohn Reck2014-05-051-0/+9
| | | | Change-Id: Ifaefcf510b2d377663fc86f60608d6ec9be8329a
* Add CanvasProperty for drawCircleJohn Reck2014-05-023-1/+147
| | | | Change-Id: Icbcc030f5033d2094e567d7c519b9d672f2aac1c
* Add elevation, Z properties to ViewChris Craik2014-04-281-1/+1
| | | | Change-Id: I3dd3b683a66e248a0fdf2ca69d1e962615b0daf9
* Support Oval GradientDrawable outlines, and ShapeDrawableChris Craik2014-04-251-3/+0
| | | | Change-Id: Ifc9e55757d3325cb28a1a812ec696512d4a18b39
* Clip TouchFeedbackDrawable effect to receiver OutlineChris Craik2014-04-234-0/+70
| | | | | | | | 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
* Remove isolated z volume testChris Craik2014-04-113-77/+0
| | | | Change-Id: I757cd9445b7e8f564b5f1357d3e5c17032daf17e
* Rename DisplayList->RenderNodeJohn Reck2014-03-171-2/+2
| | | | Change-Id: Idcca6f26ba6282594789962f5edb3ed53a290fef
* Fix build, removing hidden attrChris Craik2014-03-071-2/+0
| | | | Change-Id: Ia820e76345ad6077025e887afdaa91e08eecd649
* Improve isolatedZVolume testChris Craik2014-03-032-7/+13
| | | | | | Shows interleaving effect better Change-Id: I85361b15587306484dc8fa6d6366e866014c270f
* Rework and clean up DisplayList projectionChris Craik2014-02-062-29/+3
| | | | | | | | | | Move the projection surface to be a property of a DisplayList, set to true for every background drawable. Additionally, handle a projecting view background such that it doesn't try to project onto itself (which is undesirable). Change-Id: Ic70b17474bd87340e80767f8518f73b233419c7a
* Update reordering method names, and make 3d reordering API publicChris Craik2014-01-295-1/+108
| | | | | | | | | | IsContainedVolume -> hasIsolatedZVolume conveys that this affects Z ordering of views ProjectToContainedBackground -> ProjectBackwards, since it ended up using its own projection target, separate from the 3d volume bit Change-Id: Ia2cde838cc4da134366fe6ff623290fbd65e50c3
* Support projection of DisplayLists onto ancestors.Chris Craik2014-01-153-0/+155
| | | | | | | | | | | | | | | For now, ancestor views signal the acceptance of projections with a save(0x20)/restore pair. During the order traversal, each view with the save(0x20) code will collect descendent views with mProjectToContainedVolume (which still needs to be renamed) so that they can be drawn out of order later. - *Temporary* sample code added to HwAccelerationTest. - Note that a projected displaylist must not be clipped. Change-Id: I45c493e845961535b958d59c53e8aff3f8891d9f
* am c1acf799: am 243a026b: Merge "Second attempt at avoiding infinite loop in ↵Romain Guy2013-08-211-2/+7
|\ | | | | | | | | | | | | PathCache::trim() Bug #10347089" into klp-dev * commit 'c1acf7994a975903320ec8146c62118b651debc4': Second attempt at avoiding infinite loop in PathCache::trim() Bug #10347089
| * Second attempt at avoiding infinite loop in PathCache::trim()Romain Guy2013-08-211-2/+7
| | | | | | | | | | | | Bug #10347089 Change-Id: I70f5a3933e848632473acc6636c88be5dc6ac430
* | Make color filters mutableRomain Guy2013-08-192-0/+189
|/ | | | Change-Id: I3d035d24a75e09db13d136a22bd7dbd326d0ce36
* Fix region clipping bugsRomain Guy2013-08-011-4/+2
| | | | | | See external bug #58344 Change-Id: Iecd6c41fc8076cd76add2335d3442a6dd8878f12
* Add path ops APIRomain Guy2013-07-302-1/+98
| | | | | | | | | | | | | | | | | | | | | | | | Path ops can be used to combine two paths instances in a single path object. The following operations can be used: - Difference - Reverse difference - Union - XOR - Intersection To use the API: Path p1 = createCircle(); Path p2 = createRect(); Path result = new Path(); result.op(p1, p2, Path.Op.DIFFERENCE); This code will subtract the rectangle from the circle and generate the resulting path in "result." Change-Id: Ic25244665b6691a7df0b0002a09da73d937b553b
* Remove unnecessary allocationsRomain Guy2013-06-061-5/+1
| | | | Change-Id: Ia561a0a312ca2737d5afa742184f5392bb2f29a3
* Pack preloaded framework assets in a texture atlasRomain Guy2013-05-022-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the Android runtime starts, the system preloads a series of assets in the Zygote process. These assets are shared across all processes. Unfortunately, each one of these assets is later uploaded in its own OpenGL texture, once per process. This wastes memory and generates unnecessary OpenGL state changes. This CL introduces an asset server that provides an atlas to all processes. Note: bitmaps used by skia shaders are *not* sampled from the atlas. It's an uncommon use case and would require extra texture transforms in the GL shaders. WHAT IS THE ASSETS ATLAS The "assets atlas" is a single, shareable graphic buffer that contains all the system's preloaded bitmap drawables (this includes 9-patches.) The atlas is made of two distinct objects: the graphic buffer that contains the actual pixels and the map which indicates where each preloaded bitmap can be found in the atlas (essentially a pair of x and y coordinates.) HOW IS THE ASSETS ATLAS GENERATED Because we need to support a wide variety of devices and because it is easy to change the list of preloaded drawables, the atlas is generated at runtime, during the startup phase of the system process. There are several steps that lead to the atlas generation: 1. If the device is booting for the first time, or if the device was updated, we need to find the best atlas configuration. To do so, the atlas service tries a number of width, height and algorithm variations that allows us to pack as many assets as possible while using as little memory as possible. Once a best configuration is found, it gets written to disk in /data/system/framework_atlas 2. Given a best configuration (algorithm variant, dimensions and number of bitmaps that can be packed in the atlas), the atlas service packs all the preloaded bitmaps into a single graphic buffer object. 3. The packing is done using Skia in a temporary native bitmap. The Skia bitmap is then copied into the graphic buffer using OpenGL ES to benefit from texture swizzling. HOW PROCESSES USE THE ATLAS Whenever a process' hardware renderer initializes its EGL context, it queries the atlas service for the graphic buffer and the map. It is important to remember that both the context and the map will be valid for the lifetime of the hardware renderer (if the system process goes down, all apps get killed as well.) Every time the hardware renderer needs to render a bitmap, it first checks whether the bitmap can be found in the assets atlas. When the bitmap is part of the atlas, texture coordinates are remapped appropriately before rendering. Change-Id: I8eaecf53e7f6a33d90da3d0047c5ceec89ea3af0
* Apply ComposeShader's local matrix to childrenRomain Guy2013-03-181-2/+11
| | | | Change-Id: Idf9b8e7d7b30f8fcd8ba1fd4bfe8991e9ca148e2
* Merge all shapes/paths caches to PathCacheRomain Guy2013-03-181-6/+25
| | | | | | | | | This change will greatly simplify the multi-threading of all shape types. This change also uses PathTessellator to render convex paths. Change-Id: I4e65bc95c9d24ecae2183b72204de5c2dfb6ada4
* Add TaskManager APIRomain Guy2013-03-121-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This API can be used to run arbitrary tasks on a pool of worker threads. The number of threads is calculated based on the number of CPU cores available. The API is made of 3 classes: TaskManager Creates and manages the worker threads. Task Describes the work to be done and the type of the output. A task contains a future used to wait for the worker thread to be done computing the result of the task. TaskProcessor The processor dispatches tasks to the TaskManager and is responsible for performing the computation required by each task. A processor will only be asked to process tasks sent to the manager through the processor. A typical use case: class MyTask: Task<MyType> class MyProcessor: TaskProcessor<MyType> TaskManager m = new TaskManager(); MyProcessor p = new MyProcessor(m); MyTask t = new MyTask(); p.add(t); // Waits until the result is available MyType result = t->getResult(); Change-Id: I1fe845ba4c49bb0e1b0627ab147f9a861c8e0749
* Precache paths from a worker threadRomain Guy2013-03-111-2/+2
| | | | Change-Id: I3e7b53d67e0e03e403beaf55c39350ead7f1e309
* Take text scale/skew into account only when rendering into a layerRomain Guy2013-03-041-6/+24
| | | | | | | | | | | | 3D rotations can undo scale/skew transforms; since FreeType only accepts 2x2 matrices we can end up generating very large glyphs that are drawn at a 1:1 scale on screen. For instance, if the current transform has a scale of 2000 set on both X and Y axis and a perspective Z factor set to Z, the actual scale factor on screen ends up being 1. We would however generate glyphs with a scale factor of 2000 causing the font renderer to blow up. Change-Id: Ia5c3618d36644e817825cb9c89e2f53aece2074e
* Support 3D rotations when drawing textRomain Guy2013-02-282-0/+74
| | | | | | | | | | | | | If a perspective transform is set on the Canvas, drawText() should not attempt to rasterize glyphs in screen space. This change uses the old behavior instead (i.e. rasterize the glyphs at the native font size and apply the transform on the resulting mesh.) This change also adds an optimization: empty glyphs (spaces) do not generate vertices anymore. This saves a lot of vertices in text heavy applications such as Gmail. Change-Id: Ib531384163f5165b5785501612a7b1474f3ff599
* Reorganize OpenGL renderer testsRomain Guy2013-02-282-170/+331
| | | | | | | | | | | The new UI works just like ApiDemos. The label of the activities declared in the manifest defines where they go in the UI. For instance Draw/Circles will create an entry called Draw in the first screen of the test app. Click the "Draw" item will launch a new activity containing an item called "Circles". Change-Id: I98a4442ee3d992598af440b2078ae1925214da20
* Properly scale textRomain Guy2013-02-272-3/+22
| | | | | | | | | | | | | | | This change does not apply to drawPosText() and drawTextOnPath() yet. Prior to this change, glyphs were always rasterized based on the font size specified in the paint. All transforms were then applied on the resulting texture. This creates rather ugly results when text is scaled and/or rotated. With this change, the font renderer will apply the current transform matrix to the glyph before they are rasterized. This generates much better looking results. Change-Id: I0141b6ff18db35e1213e7a3ab9db1ecaf03d7a9c