History log of /frameworks/base/libs/hwui/Matrix.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a447d29c65fb811cd184775a3476101a1cede929 12-Jun-2014 John Reck <jreck@google.com> Fix DA bugs

* Now aware of transform of DrawDisplayListOp
* Supports projection

Bug: 15539677
Bug: 15506680

Change-Id: Ic16f482cd48c3add12e49eca529281be12b93491
/frameworks/base/libs/hwui/Matrix.cpp
e4aa95e3627226bcb0d8cc3e42dca6e4df8f421c 08-May-2014 Chris Craik <ccraik@google.com> Add logging utility methods

Change-Id: I0f316830dcc0bbf438292a6d0fbe9f8154368500
/frameworks/base/libs/hwui/Matrix.cpp
b79a3e301a8d89b9e1b1f6f3d7fd6aa56610a6f0 11-Mar-2014 Chris Craik <ccraik@google.com> Fix orthographic shadows projection, simplify shadow reordering

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
/frameworks/base/libs/hwui/Matrix.cpp
e361ad7ab15fcf4919a56a6293689d968ee8dcff 11-Mar-2014 Chris Craik <ccraik@google.com> Remove experimental perspective projection

Change-Id: Iad688c8395ccd4673cc129973802b5f01dfb45ba
/frameworks/base/libs/hwui/Matrix.cpp
f57776b2d195f0937906eb88b777bb55ccc36967 26-Oct-2013 Chris Craik <ccraik@google.com> 3d view system!

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
/frameworks/base/libs/hwui/Matrix.cpp
996fe656340ede058a6f0e6b18f9ec525ddb4e27 21-Sep-2013 Chris Craik <ccraik@google.com> Correct bitmap merging logic

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
/frameworks/base/libs/hwui/Matrix.cpp
d965bc5823d878a3fd056b8a95fb4eb578ed3fe4 16-Sep-2013 Chris Craik <ccraik@google.com> Disallow negative scale matrices in merged Bitmap drawing

bug:10622962

Change-Id: I55ac18ad56b53dc9e6e6ea14cd3ec4bdafa98ac3
/frameworks/base/libs/hwui/Matrix.cpp
f6bed4f12a2c975678fc0bdea15054ab169aafb5 21-Jun-2013 Romain Guy <romainguy@google.com> An identity matrix should be considered a pure translate matrix

Change-Id: I75e91797e8270f902f67bdd7bb526cccc23adc6b
/frameworks/base/libs/hwui/Matrix.cpp
624234f69b2a4781d24f3e4c6ae6450729e38397 06-Mar-2013 Romain Guy <romainguy@google.com> Take only the scale params into account to rasterize text

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
/frameworks/base/libs/hwui/Matrix.cpp
3b753829ae858d424fe109f714745379a6daf455 05-Mar-2013 Romain Guy <romainguy@google.com> Fix colored rects clipping and code cleanup

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
/frameworks/base/libs/hwui/Matrix.cpp
c74f45a334f0e3725c23cdd270cbcb0efac4ea75 27-Feb-2013 Romain Guy <romainguy@google.com> Properly scale text

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
/frameworks/base/libs/hwui/Matrix.cpp
13ba0054846ce630ca31e8f26169fd9388faee02 15-Feb-2013 Romain Guy <romainguy@google.com> Remove obsolete header file

We now use the same mechanism to compare keys everywhere in libhwui.

Change-Id: I8b3cb25b13f4f38eb6f12aed0356f796a773617c
/frameworks/base/libs/hwui/Matrix.cpp
8ce00301a023eecaeb8891ce906f67b513ebb42a 16-Jan-2013 Romain Guy <romainguy@google.com> Implement clipRect with a transform, clipRegion & clipPath
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
/frameworks/base/libs/hwui/Matrix.cpp
a3dc55f83ab583e0a66b893c71b849afa046770a 28-Sep-2012 Romain Guy <romainguy@google.com> Fix a couple of rendering issues
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
/frameworks/base/libs/hwui/Matrix.cpp
710f46d9d6a5bf9ea1c1833384caf61e1934124f 18-Sep-2012 Chris Craik <ccraik@google.com> Polygonal rendering of simple fill shapes

bug:4419017

Change-Id: If0428e1732139786cba15f54b285d880e4a56b89
/frameworks/base/libs/hwui/Matrix.cpp
d3efd6920e64d0207a0655640297d87d4937ee27 07-May-2012 Chet Haase <chet@google.com> Fix issue where scale-animating text would jump temporarily a few pixels

Some logic in the native matrix code would determine that a matrix was
'pureTranslate' based on the scale values of a matrix being close-enough to 1,
which was within a very small epsilon. This works in general, because screen space
coordinates make that epsilon value irrelevant, so close-enough really is close-enough.

However, TextView, when centering text, works in a coordinate system that is quite
huge, with left/right values about 500,000. These numbers multiplied times that small
epsilon value would give a result that was significant, and would cause a miscalculation
of up to 4-5 pixels, causing the snap that we'd see for a couple of frames as the
scale got "close enough" to 1.

The fix is to remove the optimization of "close enough". What we really need the matrix to
do is to identify itself as being translate-only when no scale as been set (which is the
default). For the purposes of that check, it is good enough to simply check the values against
1 directly. Similarly, the bounds-check logic needs to check against 0 and 1 directly.

Issue #6452687: Glitch when changing scale of a view containing text

Change-Id: I167fb45d02201fb879deea0e5a7ca95e38128e17
/frameworks/base/libs/hwui/Matrix.cpp
5baa3a62a97544669fba6d65a11c07f252e654dd 20-Dec-2011 Steve Block <steveblock@google.com> Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
/frameworks/base/libs/hwui/Matrix.cpp
302a9df1d50373c82923bb84ff665dfce584fb22 16-Aug-2011 Romain Guy <romainguy@google.com> Add an API to set the transform on a TextureView's surface texture.
Bug #5156689

Change-Id: I635a625885c9b832a60d44ece0de7613ceb84109
/frameworks/base/libs/hwui/Matrix.cpp
181d0a6ccedee03789919d53c46540a8df751896 10-Jun-2011 Romain Guy <romainguy@google.com> Don't apply AA to rects with no rotation/perspective.

Change-Id: I21138d4d0589cc28f1dcffb8b675cd81a9900e24
/frameworks/base/libs/hwui/Matrix.cpp
807daf7df615b60ce6fc41355aabe3aa353cebab 18-Jan-2011 Romain Guy <romainguy@google.com> Add support for skew()

Change-Id: Ia3a9a867f74fd78b61f75179e3788fdc2f0cacd0
/frameworks/base/libs/hwui/Matrix.cpp
6620c6d413f972819fada92b574f0fa9e96d36c1 07-Dec-2010 Romain Guy <romainguy@google.com> Correctly render text when coordinates are not integers.
Bug #3225632

Change-Id: If09759e6e95eb2885362ab3ba088cf5aae64c7bf
/frameworks/base/libs/hwui/Matrix.cpp
5b3b35296e8b2c8d3f07d32bb645d5414db41a1d 28-Oct-2010 Romain Guy <romainguy@google.com> Optimize FBO drawing with regions.
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
/frameworks/base/libs/hwui/Matrix.cpp
03750a067e818ca7fbd0f590e2ff6a8fded21e6c 18-Oct-2010 Romain Guy <romainguy@google.com> Use VBOs to render most geometries.

Change-Id: I4360dc4fe5693ab425450c107282b2c22db4dca7
/frameworks/base/libs/hwui/Matrix.cpp
e5ebcb0107a939395e03592fd44c746cd09e311d 15-Oct-2010 Romain Guy <romainguy@google.com> Fix clipping issue in StackView.

Change-Id: I7ec28f25c3993a2bd7ef6399ba1923839d239905
/frameworks/base/libs/hwui/Matrix.cpp
4bb942083a0d4db746adf95349108dd8ef842e32 13-Oct-2010 Romain Guy <romainguy@google.com> Optimize 9patch rendering.

This change detects empty quads in 9patches and removes them from
the mesh to avoid unnecessary blending.

Change-Id: I4500566fb4cb6845d64dcb59b522c0be7a0ec704
/frameworks/base/libs/hwui/Matrix.cpp
e8cb9c14309b0f01c0159efdf9a7198f44a62642 04-Oct-2010 Romain Guy <romainguy@google.com> Apply bilinear filtering on text only when necessary.

Change-Id: Ic903f4b5d30e9c92528c6291941896efe4729ee3
/frameworks/base/libs/hwui/Matrix.cpp
ddb80bebb0776e6d852aab6e8bba5d5591847a55 21-Sep-2010 Romain Guy <romainguy@google.com> Add support for circular gradients to the GL renderer.

This change also adds full support for local transformation matrices on
sweep and radial gradients.

Change-Id: Id8773bc0766575190e3f3d51984fc5e57b266c3f
/frameworks/base/libs/hwui/Matrix.cpp
1d83e1981c8b89da93dff37a4f8b2b1ad8480b44 17-Aug-2010 Romain Guy <romainguy@google.com> Correctly set the viewport in layers.

Bug #2919295

Change-Id: I16ce79ab0d5747cb01c6c1abe531da3dfd93fb54
/frameworks/base/libs/hwui/Matrix.cpp
0ba681bce12d522c5575dfccb5a6ca12f0fba746 13-Aug-2010 Romain Guy <romainguy@google.com> Fix GC issue, fix local shader transformations.

Change-Id: I208bdf89815dcd18dcadd43df932a77362918435
/frameworks/base/libs/hwui/Matrix.cpp
af28b514964861d81b48902f942f706050936d38 12-Aug-2010 Romain Guy <romainguy@google.com> Better support for rotation and perspective matrices.

Change-Id: I56b5ae3321735ba5ee42aafc9bc0eb399b9e75b5
/frameworks/base/libs/hwui/Matrix.cpp
889f8d1403761d5668115ced6cbb3f767cfe966d 29-Jul-2010 Romain Guy <romainguy@google.com> Moved all the rendering code to the new shader generator.

The generator supports features that are not yet implement in the
renderer: color matrix, lighting, porterduff color blending and
composite shaders.

This change also adds support for repeated/mirrored non-power of 2
bitmap shaders.

Change-Id: I903a11a070c0eb9cc8850a60ef305751e5b47234
/frameworks/base/libs/hwui/Matrix.cpp
079ba2c85b15e882629b8d188f5fbdb42f7f8eea 16-Jul-2010 Romain Guy <romainguy@android.com> Improve clip support (add intersect, union and replace.)

This change also modifies the way the clip is stored. The clip is now
always stored in screen-space coordinates.

Change-Id: I96375784d82dfe975bc6477a159e6866e7052487
/frameworks/base/libs/hwui/Matrix.cpp
5cbbce535744b89df5ecea95de21ee3733298260 28-Jun-2010 Romain Guy <romainguy@android.com> Reduced the complexity of layers composition.

This change also refactors the code base a bit by moving classes out of
OpenGLRenderer into separate headers/implementations. This makes the code
more manageable.

This change also adds documentation for implementation methods. The
undocumented methods are simply Skia's Canvas methods.

Change-Id: I54c68b443580a0129251dddc1a7ac95813d5289e
/frameworks/base/libs/hwui/Matrix.cpp
bd6b79b40247aea7bfe13d0831c6c0472df6c636 26-Jun-2010 Romain Guy <romainguy@android.com> Add implementations for saveLayerAlpha() and textured rects.

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
/frameworks/base/libs/hwui/Matrix.cpp
7ae7ac48aa2b53453c9805075171ecd5bcafd7de 25-Jun-2010 Romain Guy <romainguy@android.com> Convert tabs to spaces.

Change-Id: I5d3ae48af79b19b6d293deff0521e4bb57d5114b
/frameworks/base/libs/hwui/Matrix.cpp
c7d53494f1fbd9f9d74af89053ff9fdb1ccbac6c 25-Jun-2010 Romain Guy <romainguy@android.com> Implement quickReject() and drawRect().

The OpenGL ES 2.0 renderer can now draw colored rectangles. At least there's
something on screen now.

Change-Id: I80a13ccc1dd56784edf74f2670a364f30700234a
/frameworks/base/libs/hwui/Matrix.cpp
9d5316e3f56d138504565ff311145ac01621dff4 25-Jun-2010 Romain Guy <romainguy@google.com> Add colored rectangles implementation in OpenGLRenderer.

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
/frameworks/base/libs/hwui/Matrix.cpp
f6a11b8a9e25ff9861bbba19251bea84d8a5daf2 24-Jun-2010 Romain Guy <romainguy@google.com> Add support for transformations.

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
/frameworks/base/libs/hwui/Matrix.cpp
bb9524b6bdddc7ac77d8628daa8b366b8a7be4a4 23-Jun-2010 Romain Guy <romainguy@google.com> Add implementations for clipRect(), save() and restore().

The current implementation of clipRect() does not apply local transformations
before setting the new clip.

Change-Id: I5997871bb638dfcd1a8ef96354846af52427e445
/frameworks/base/libs/hwui/Matrix.cpp
3e168335b3422008908ac6973bb36078fd979f35 22-Jun-2010 Romain Guy <romainguy@google.com> Fix simulator build again.

Change-Id: Ifd204d64eaa4c356422e3363ec0a6e6aa61c52dc
/frameworks/base/libs/hwui/Matrix.cpp
85bf02fc16784d935fb9eebfa9cb20fe46ff7951 22-Jun-2010 Romain Guy <romainguy@google.com> Fix the simulator build.

Change-Id: Ie404f7c2c308f0657f273af19a56e8c039b61898
/frameworks/base/libs/hwui/Matrix.cpp