26 Commits

Author SHA1 Message Date
Chet Haase
d3efd6920e 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
2012-05-07 12:18:19 -07:00
Steve Block
5baa3a62a9 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
2012-01-03 22:38:27 +00:00
Romain Guy
302a9df1d5 Add an API to set the transform on a TextureView's surface texture.
Bug #5156689

Change-Id: I635a625885c9b832a60d44ece0de7613ceb84109
2011-08-16 13:55:02 -07:00
Romain Guy
181d0a6cce Don't apply AA to rects with no rotation/perspective.
Change-Id: I21138d4d0589cc28f1dcffb8b675cd81a9900e24
2011-06-09 18:52:38 -07:00
Romain Guy
807daf7df6 Add support for skew()
Change-Id: Ia3a9a867f74fd78b61f75179e3788fdc2f0cacd0
2011-01-18 11:19:19 -08:00
Romain Guy
6620c6d413 Correctly render text when coordinates are not integers.
Bug #3225632

Change-Id: If09759e6e95eb2885362ab3ba088cf5aae64c7bf
2010-12-06 18:07:02 -08:00
Romain Guy
5b3b35296e 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
2010-11-02 16:17:23 -07:00
Romain Guy
03750a067e Use VBOs to render most geometries.
Change-Id: I4360dc4fe5693ab425450c107282b2c22db4dca7
2010-10-18 14:49:19 -07:00
Romain Guy
e5ebcb0107 Fix clipping issue in StackView.
Change-Id: I7ec28f25c3993a2bd7ef6399ba1923839d239905
2010-10-15 13:57:28 -07:00
Romain Guy
4bb942083a Optimize 9patch rendering.
This change detects empty quads in 9patches and removes them from
the mesh to avoid unnecessary blending.

Change-Id: I4500566fb4cb6845d64dcb59b522c0be7a0ec704
2010-10-12 15:59:26 -07:00
Romain Guy
e8cb9c1430 Apply bilinear filtering on text only when necessary.
Change-Id: Ic903f4b5d30e9c92528c6291941896efe4729ee3
2010-10-04 14:14:11 -07:00
Romain Guy
ddb80bebb0 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
2010-09-21 16:48:50 -07:00
Romain Guy
1d83e1981c Correctly set the viewport in layers.
Bug #2919295

Change-Id: I16ce79ab0d5747cb01c6c1abe531da3dfd93fb54
2010-08-17 11:37:00 -07:00
Romain Guy
0ba681bce1 Fix GC issue, fix local shader transformations.
Change-Id: I208bdf89815dcd18dcadd43df932a77362918435
2010-08-12 15:37:00 -07:00
Romain Guy
af28b51496 Better support for rotation and perspective matrices.
Change-Id: I56b5ae3321735ba5ee42aafc9bc0eb399b9e75b5
2010-08-12 14:34:44 -07:00
Romain Guy
889f8d1403 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
2010-07-29 14:37:42 -07:00
Romain Guy
079ba2c85b 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
2010-07-16 14:12:24 -07:00
Romain Guy
5cbbce5357 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
2010-06-27 22:59:20 -07:00
Romain Guy
bd6b79b402 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
2010-06-26 00:13:53 -07:00
Romain Guy
7ae7ac48aa Convert tabs to spaces.
Change-Id: I5d3ae48af79b19b6d293deff0521e4bb57d5114b
2010-06-25 13:46:18 -07:00
Romain Guy
c7d53494f1 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
2010-06-25 13:41:57 -07:00
Romain Guy
9d5316e3f5 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
2010-06-24 19:30:36 -07:00
Romain Guy
f6a11b8a9e 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
2010-06-23 17:47:49 -07:00
Romain Guy
bb9524b6bd 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
2010-06-23 12:36:03 -07:00
Romain Guy
3e168335b3 Fix simulator build again.
Change-Id: Ifd204d64eaa4c356422e3363ec0a6e6aa61c52dc
2010-06-22 13:29:14 -07:00
Romain Guy
85bf02fc16 Fix the simulator build.
Change-Id: Ie404f7c2c308f0657f273af19a56e8c039b61898
2010-06-22 13:11:24 -07:00