90 Commits

Author SHA1 Message Date
Romain Guy
29378192f7 Test setTextScaleX()
Change-Id: Iafa421def64a8f9a83b320b6cf3cc5286515c355
2010-08-20 15:49:27 -07:00
Romain Guy
e9e7fd0813 Update OpenGLRenderer test to test opaque ARGB8888 bitmaps.
Change-Id: I7159825f4b1d6f5a1cd09ec091994801b52b6bda
2010-08-19 14:45:42 -07:00
Romain Guy
2542d19974 Layers were using an extra Snapshot causing extra clipping.
Bug #2919310

Change-Id: I72ccd44bba7a3f3db72f581aa96198b6226e4478
2010-08-18 11:47:12 -07:00
Romain Guy
8fb954263d Fix save()/restore() issues in the OpenGL renderer.
The save stack now behaves exactly like in Skia.

Change-Id: If7e642f41f2c8f693f6e8c26cba81507d466562e
2010-08-17 18:40:21 -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
0a41749953 Cleanup, better code reuse.
Change-Id: Ib86a7309ae579cce3b7cf464782c34e70a74c616
2010-08-16 20:26:20 -07:00
Romain Guy
1e45aae5de Add drop shadows.
Change-Id: Ic6a72409d4785968d1fbdff229f17ee5c00b240b
2010-08-13 19:41:14 -07:00
Romain Guy
48daa54d31 Add extra blending modes.
This change adds the following blending modes for shaders and color filters:
Add
Multiply
Screen
Overlay
Darken
Lighten

Change-Id: Iff22f5ce6041b43c71b1857d73013f5010ab3413
2010-08-10 21:42:40 -07:00
Romain Guy
a674ab74e3 Add support for text underline and strikethru.
Change-Id: I3a0e6643d7cafbdd06d9a908c8cf9347dcaba146
2010-08-10 17:26:42 -07:00
Romain Guy
61c8c9c5b2 Fix tons of bugs and add new text rendering support.
Change-Id: I326c66b10784006f6df2f12d38e120cef94cd0d7
2010-08-10 12:22:01 -07:00
Romain Guy
ba7186e082 Add 3d transformation test.
Change-Id: Ia163af802e5a320490196461a97d5f797b71abb4
2010-08-05 19:08:32 -07:00
Romain Guy
7fbcc0492f Add support for paths.
Rendering is implementing by rasterizing the paths into A8 textures.
This cna be extremely inefficient if the path changes often.

Change-Id: I609343f304ae38e0d319359403ee73b9b5b3c93a
2010-08-05 17:23:49 -07:00
Romain Guy
529b60a3b1 Add android:hardwareAccelerated to Activity.
Hardware acceleration can now be enabled/disabled locally on each activity
declared in the manifest. It can also be enabled/disabled directly on a
window through the WindowManager.LayoutParams.

Change-Id: I91dd0b26c4e7eb8cd7288e523ed6b7bda6d0990b
2010-08-04 10:55:46 -07:00
Romain Guy
db1938e0e6 Add support for ColorFilters.
Color filters are fully supported and can be used with shaders.

Change-Id: Id90ccf1c81cb462f2431f366f3f8f710d7971e04
2010-08-02 18:50:56 -07:00
Romain Guy
06f96e2652 Refactor Skia shaders handling.
With this change, Skia shaders can easily be applied to any mesh. This change also
supports ComposeShader. For instance, this can be used to blend a gradient and a
bitmap togehter and paint a string of text with the result.

Change-Id: I701c2f9cf7f89b2ff58005e8a1d0d80ccf4a4aea
2010-07-30 19:18:16 -07:00
Romain Guy
b82da65cb1 Fix improper clipping after a save()
Change-Id: I13426a67f20d77e2710bd500d82884098f4be97c
2010-07-30 11:40:21 -07:00
Romain Guy
ae5575b342 Fix gradients rendering and destructor crashes.
This changes binds all textures to GL_TEXTURE0, this will have
to be changed when combining shader capabilities.

Change-Id: I02df4f5ba41e9b01ffa52fd7c26b41477c7ed18f
2010-07-29 18:48:04 -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
e8e62a4a03 Add text alignment support to drawText().
This change also integrates better support for RTL text.

Change-Id: I6da8f5cf5dc28ca7cf1b22e27b0d853c919e8481
2010-07-23 18:55:21 -07:00
Romain Guy
09147fbdc8 Add support for text culling.
Change-Id: Ibf0adacdc5c64d40a8000b21d7cb0797d63efe29
2010-07-22 13:08:20 -07:00
Romain Guy
694b519ac6 Add text rendering.
Change-Id: Ibe5a9fa844d531b31b55e43de403a98d49f659b9
2010-07-21 21:33:20 -07:00
Romain Guy
c0ac193b94 Add support for linear gradients.
Change-Id: Id15329da065045b3f06fdaed615f33cd57608496
2010-07-19 18:44:05 -07:00
Romain Guy
d27977d1a9 Add support for BitmapShader.
This change also fixes an issue with the clip and layers.

Change-Id: I5fd9832098d8cf7ae8eb781ff9bffe7defaea279
2010-07-15 14:44:42 -07:00
Romain Guy
3d58c03de0 Do not apply transforms when using drawColor().
This fixes an issue in the way the clip transformations were applied.

Change-Id: I91e7b5d15baf244d1280e48938282bb33609081d
2010-07-14 16:35:43 -07:00
Romain Guy
266e05179c Prevent crash in ListView when changing cache hint. 2010-07-14 11:08:02 -07:00
Romain Guy
6926c72e25 Correctly support pre-multiplied alpha, optimizations, more stuff.
Add support for the following drawing functions:
- drawBitmap(int[]...)
- drawPaint()

Optimizes shader state changes by enabling/disabling attribute arrays
only when needed.

Adds quick rejects when drawing trivial shapes to avoid unnecessary
OpenGL operations.

Change-Id: Ic2c6c2ed1523d08a63a8c95601a1ec40b6c7fbc9
2010-07-12 20:20:03 -07:00
Romain Guy
16202fc974 Fix alpha blending and improve fragment shaders performance.
Change-Id: Ib74f6941d25ca6f6a41708e541174eaa7e8d9bc2
2010-07-09 16:13:28 -07:00
Romain Guy
f7f93556c8 Draw n-patches using OpenGL.
Currently only tested with title bars and buttons.

Change-Id: I8263a9281898dc0e943b1b8412827fe55639b9d6
2010-07-08 19:19:07 -07:00
Romain Guy
f86ef57f8b Don't use full screen FBOs, this dramatically increase performance.
The next step will be to add an FBO cache to avoid churning memory on every
frame we draw. This change also adds support for drawBitmap(Bitmap, Matrix, Paint).

Change-Id: I7825cdcf0cad9bffe6219e05d8328a53d4a6e583
2010-07-01 15:27:21 -07:00
Romain Guy
8ba548f81d Add implementation for drawBitmap(Bitmap, Rect, Rect, Paint)
Change-Id: I10904d2325a5431d15801aebcec1048715678e8c
2010-06-30 19:21:21 -07:00
Romain Guy
c1396e93b6 Add implementation for drawBitmap().
Change-Id: Iada9325f3c5642b61c2e0c4cd80bcfbc92cb491e
2010-06-30 17:56:19 -07:00
Romain Guy
ce0537b800 Add hooks for drawBitmap().
Change-Id: I58e962c3a8b2bc75c2605fe369ad3002579d86e0

Add texture cache.

Change-Id: I1c0e5581d228869e114438258a1014e33e024ad7
2010-06-30 15:21:01 -07:00
Romain Guy
d55a86120d Add support for saveLayer().
saveLayer() is affected by the paint's alpha and xfermode.

Change-Id: I28693a9337052643adccdb4889a8f228d4e17903
2010-06-28 18:52:24 -07:00
Romain Guy
026c5e1670 Implement support for PorterDuff's blending modes.
The blending modes are currently hooked up only when drawing filled rects but the
code is reusable for other primitives. This will allow implementation of saveLayer().
This method is required to support the fade effects used throughout the standard
Android UI.

Change-Id: I396023d123436f16cdafc606e358e4eb80c9df2c
2010-06-28 17:12:22 -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
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
85bf02fc16 Fix the simulator build.
Change-Id: Ie404f7c2c308f0657f273af19a56e8c039b61898
2010-06-22 13:11:24 -07:00
Romain Guy
e4d011201c Add libhwui, to hardware accelerate the Canvas API using OpenGL ES 2.0.
This is the initial checkin to setup the library and turn on OEGL ES 2.0
in ViewRoot, not a functional renderer.

Change-Id: I6655c54166e2967da2e21e7d6dcfba78bf113b44
2010-06-17 13:40:11 -07:00
Romain Guy
0bbae08364 Add new API to check whether a Bitmap was modified.
Bitmap.getGenerationId() can be used by caches to find out if a Bitmap has been
modified. This simply exposes an existing Skia API.

This change also adds a small test app for Canvas hardware acceleration. The new
Bitmap API is required to implement a texture cache.

Change-Id: I8547b146cd14c8afe1a2327fcd6d71b1b1cb68fc
2010-06-15 18:03:40 -07:00