summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Matrix.h
Commit message (Collapse)AuthorAgeFilesLines
* Simplify matrix copy constructor/loadChris Craik2015-07-071-4/+0
| | | | | | bug:22208220 Change-Id: Id096eb8de8da0dd1687d6af9456b16ce2a1a589b
* Use path intersection instead of saveLayer+mesh to mask projected ripplesChris Craik2015-05-261-0/+6
| | | | | | | | | | | | | | | | | | | | | 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
* Add overrides and switch to nullptr keywordChris Craik2014-12-221-1/+1
| | | | | | | | Changes generated with clang-modernize. Additionally, fixed some struct-vs-class usage to make clang happy. Change-Id: Ic6ef2427401ff1e794d26f21f7b44868fc75fb72
* Fix DA bugsJohn Reck2014-06-121-0/+1
| | | | | | | | | | * Now aware of transform of DrawDisplayListOp * Supports projection Bug: 15539677 Bug: 15506680 Change-Id: Ic16f482cd48c3add12e49eca529281be12b93491
* Add logging utility methodsChris Craik2014-05-081-1/+1
| | | | Change-Id: I0f316830dcc0bbf438292a6d0fbe9f8154368500
* Fix orthographic shadows projection, simplify shadow reorderingChris Craik2014-03-121-0/+1
| | | | | | | | | Separate matrix passed to shadow system into two parts, one for transforming the polygon XY points (using the actual draw matrix) and a separate one which respects correct 4x4 3d rotations and translations for determining Z values. Change-Id: I7e30a84774a8709df6b2241e8f51fc5583648fe8
* Remove experimental perspective projectionChris Craik2014-03-111-4/+0
| | | | Change-Id: Iad688c8395ccd4673cc129973802b5f01dfb45ba
* Simplify DisplayList matricesChris Craik2014-02-051-2/+10
| | | | | | | Somewhat unifies the ortho/perspecive paths - the property matrix (translate/scale/rotate) is now always a Matrix4. Change-Id: I36e4fe83d1150ee6e4be5f64f34d0fc8d6525cc6
* 3d view system!Chris Craik2013-12-121-4/+10
| | | | | | | | | | | | | | | | | | | True 3d transformations are now supported by DisplayLists and the renderer, initially with the translationZ property on view. Renderer operations used directly by DisplayList (formerly, clip/save/restore/saveLayer) are now more simply managed by allocating them temporarily on the handler's allocator, which exists for a single frame. This is much simpler than continuing to expand the pool of pre-allocated DisplayListOps now that more operations are called directly by DisplayList, especially with z ordered drawing. Still TODO: -APIs for camera positioning, shadows -Make Z apis public, and expose through XML -Make invalidation / input 3d aware Change-Id: I95fe6fa03f9b6ddd34a7e0c6ec8dd9fe47c6c6eb
* Correct bitmap merging logicChris Craik2013-09-201-2/+1
| | | | | | | | | | | | | | | bug:10863163 This fixes two issues The check for pure translation was incorrect. It was fixed and renamed for clarity. Certain matrix paths weren't setting kTypePositiveScale. For simplicity (and because positive scale is simple to check) removed flag in favor of dynamic checking. Change-Id: Ic5ce235653ef49a68b8b242bd89fc2e95874ecc9
* Disallow negative scale matrices in merged Bitmap drawingChris Craik2013-09-161-1/+3
| | | | | | bug:10622962 Change-Id: I55ac18ad56b53dc9e6e6ea14cd3ec4bdafa98ac3
* An identity matrix should be considered a pure translate matrixRomain Guy2013-06-201-5/+5
| | | | Change-Id: I75e91797e8270f902f67bdd7bb526cccc23adc6b
* Overdraw avoidance and merging of clipped opsChris Craik2013-06-121-0/+6
| | | | | | | | | | | | | | | | | bug:8951267 If an opaque op, or group of opaque ops covers the invalidate region, skip draw operations that precede it. Clipped operations may now be merged, but only if they share a clipRect - this is a very case for e.g. ListView, where all background elements may now be a part of the same MergingDrawBatch. It is this more aggressive merging that groups together clipped background elements in the ListView case, enabling the overdraw avoidance skipping the window background. Change-Id: Ib0961977e272c5ac37f59e4c67d828467422d259
* Avoid 9patch cache lookups when possibleRomain Guy2013-06-111-4/+21
| | | | | | | This optimization saves up to 0.3ms per frame on the Play Store's front page, on a Nexus 4 device. Change-Id: Iaa4ef33c6e3b37e175efd5b9eea9ef59b43f14f3
* Less aggressive glyphs precachingRomain Guy2013-03-131-0/+8
| | | | | | | | | | | | | The renderer used to pre-cache glyphs at record time. This then changed to pre-caching at the beginning of every frame. This unfortunately entails a lot of duplicate work on every frame, which amounts to 0.5 to 1ms in some stock applications. This change is somewhere in the middle: pre-caching happens the first time a DrawTextOp is deferred or every time the screen-space transform is different from the last pre-caching operation. Change-Id: Id6d9e2599d90a5b75010b0f0a28746befbf3c205
* Take only the scale params into account to rasterize textRomain Guy2013-03-051-2/+2
| | | | | | | | | | This change extracts the scale parameters of the current transform to pass then to the font renderer. Rotation and perspective are applied to the generated mesh inside the vertex shader. This limits the number of glyphs we have to create in the font cache and thus reduces memory churn. Change-Id: Ic5b3bae2b2b0e0250a8ee723b071a1709725c749
* Fix colored rects clipping and code cleanupRomain Guy2013-03-051-0/+16
| | | | | | | | | | | | | | | | The drawColorRects() method was clipping individual rectangles using the wrong parameters left, top, right and bottom instead of l, r, t and b. It also checked for count == 0 after the loop when it should have checked for vertexCount == 0. The quickReject is now not part of the loop since it's a bit overkill to perform so many matrix multiplications. What we really care about is the final quickReject performed on the max bounds of the entire set of rectangles. This change also replaces all instances of mSnapshot->transform by currentTransform() to make the code slightly more readable. Change-Id: I6485280414499716852f7dbfba186774eb6763d4
* Properly scale textRomain Guy2013-02-271-0/+2
| | | | | | | | | | | | | | | 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
* Implement clipRect with a transform, clipRegion & clipPathRomain Guy2013-01-171-3/+27
| | | | | | | | | | | | | | | | | | | | | Bug #7146141 When non-rectangular clipping occurs in a layer the render buffer used as the stencil buffer is not cached. If this happens on a View's hardware layer the render buffer will live for as long as the layer is bound to the view. When a stencil buffer is required because of a call to Canvas.saveLayer() it will be allocated on every frame. A future change will address this problem. If "show GPU overdraw" is enabled, non-rectangular clips are not supported anymore and we fall back to rectangular clips instead. This is a limitation imposed by OpenGL ES that cannot be worked around at this time. This change also improves the Matrix4 implementation to easily detect when a rect remains a rect after transform. Change-Id: I0e69fb901792d38bc0c4ca1bf9fdb02d7db415b9
* Fix a couple of rendering issuesRomain Guy2012-09-281-0/+1
| | | | | | | | | | | 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
* Polygonal rendering of simple fill shapesChris Craik2012-09-201-4/+4
| | | | | | bug:4419017 Change-Id: If0428e1732139786cba15f54b285d880e4a56b89
* Add missing public native APIRomain Guy2011-10-121-1/+3
| | | | Change-Id: Ie3bc706b2ac91d686a5b888e8ae841820e9d37c7
* Add an API to set the transform on a TextureView's surface texture.Romain Guy2011-08-161-0/+2
| | | | | | Bug #5156689 Change-Id: I635a625885c9b832a60d44ece0de7613ceb84109
* Don't apply AA to rects with no rotation/perspective.Romain Guy2011-06-091-0/+1
| | | | Change-Id: I21138d4d0589cc28f1dcffb8b675cd81a9900e24
* Add support for skew()Romain Guy2011-01-181-0/+7
| | | | Change-Id: Ia3a9a867f74fd78b61f75179e3788fdc2f0cacd0
* Correctly render text when coordinates are not integers.Romain Guy2010-12-061-0/+2
| | | | | | Bug #3225632 Change-Id: If09759e6e95eb2885362ab3ba088cf5aae64c7bf
* Optimize FBO drawing with regions.Romain Guy2010-11-021-3/+3
| | | | | | | | | This optimization is currently disabled until Launcher is modified to take advantage of it. The optimization can be enabled by turning on RENDER_LAYERS_AS_REGIONS in the OpenGLRenderer.h file. Change-Id: I2fdf59d0f4dc690a3d7f712173ab8db3848b27b1
* Apply bilinear filtering on text only when necessary.Romain Guy2010-10-041-0/+2
| | | | Change-Id: Ic903f4b5d30e9c92528c6291941896efe4729ee3
* Add support for circular gradients to the GL renderer.Romain Guy2010-09-211-0/+2
| | | | | | | This change also adds full support for local transformation matrices on sweep and radial gradients. Change-Id: Id8773bc0766575190e3f3d51984fc5e57b266c3f
* Fix GC issue, fix local shader transformations.Romain Guy2010-08-121-3/+1
| | | | Change-Id: I208bdf89815dcd18dcadd43df932a77362918435
* Better support for rotation and perspective matrices.Romain Guy2010-08-121-0/+16
| | | | Change-Id: I56b5ae3321735ba5ee42aafc9bc0eb399b9e75b5
* Improve clip support (add intersect, union and replace.)Romain Guy2010-07-161-0/+2
| | | | | | | This change also modifies the way the clip is stored. The clip is now always stored in screen-space coordinates. Change-Id: I96375784d82dfe975bc6477a159e6866e7052487
* Do not apply transforms when using drawColor().Romain Guy2010-07-141-0/+3
| | | | | | This fixes an issue in the way the clip transformations were applied. Change-Id: I91e7b5d15baf244d1280e48938282bb33609081d
* Add implementations for saveLayerAlpha() and textured rects.Romain Guy2010-06-261-0/+3
| | | | | | | | | | | Even though there's an implementation for textured rects, drawBitmap() is not hooked up yet as it will require a good texture cache. This method is implemented using FBOs. There's currently an issue either in the driver or in the Canvas renderer that forces the FBO to be fullscreen, which is extremely expensive and yields terrible performance. Change-Id: I148419195e12d45653c60186938aa78c23a68e2c
* Convert tabs to spaces.Romain Guy2010-06-251-47/+47
| | | | Change-Id: I5d3ae48af79b19b6d293deff0521e4bb57d5114b
* Implement quickReject() and drawRect().Romain Guy2010-06-251-4/+4
| | | | | | | The OpenGL ES 2.0 renderer can now draw colored rectangles. At least there's something on screen now. Change-Id: I80a13ccc1dd56784edf74f2670a364f30700234a
* Add colored rectangles implementation in OpenGLRenderer.Romain Guy2010-06-241-3/+9
| | | | | | | Drawing two rectangles one after the other discards the second one because of Z buffering issues. This will be fixed in another changelist. Change-Id: Ida1b3cde8a78e60cacc07e477abc44def527ff67
* Add support for transformations.Romain Guy2010-06-231-1/+9
| | | | | | | | | | | | | | | This change adds partial support for the following transforms: - scale() - translate() - rotate() - setMatrix() - getMatrix() The transform is stored in a snapshot and saved/restored as needed. The transform is currently not applied to the clip rect and is not mapped to the vertex shader. Change-Id: Id48993453311200804149917d0c126a4d0471226
* Fix the simulator build.Romain Guy2010-06-221-0/+100
Change-Id: Ie404f7c2c308f0657f273af19a56e8c039b61898