52 Commits

Author SHA1 Message Date
Romain Guy
47b8adec39 Add a new Camera API to control the camera's location
Change-Id: Id9a082d2def803eb527e1987875e0d8a22c6e8aa
2011-02-23 19:51:42 -08:00
Romain Guy
b18d2d0079 Dirty layers in the area covered by a drawBitmapMesh() call
Bug #3410827

Change-Id: Ic8b4f6201af94497bba86c75819588c78debddc2
2011-02-10 15:52:54 -08:00
Romain Guy
f28daffda5 Empty the clip rect when intersection is empty.
Bug #3410035

Change-Id: I5ceb80514d3b20c9ad230478549ad31ced403d53
2011-02-04 00:59:34 -08:00
Romain Guy
09b7c91de7 Allocate layers from the layers pool.
Bug #3413433

This change will be beneficial to Launcher to avoid hiccups when
swiping pages of icons. When a layer is discarded, it is kept
in the layers pool instead of being destroyed right away. This
favors memory reuse over allocations.

Change-Id: Ifb6944ba83d6ceb67c331527c0827b26ce648eb1
2011-02-02 20:28:09 -08:00
Romain Guy
849d0a37cf New API to let apps draw without layers.
Bug #3413433

Launcher now enables layers all the time, but in some cases (for instance, when the
workspace is not scrolling,) it is more efficient to draw without the layer.

Change-Id: I625fb5b48506acda9ae75356fdbbe812c85f2aab
2011-02-01 17:56:09 -08:00
Romain Guy
54229ee5eb Correctly set the alpha of a hardware layer before drawing it.
Bug #3410819

Change-Id: I3ebaca2233f4edf5b59d84ec7706555056a1a4b1
2011-02-01 13:05:16 -08:00
Romain Guy
7d7b5490a0 Enable partial invalidates when rendering with OpenGL.
Change-Id: Ie8be06c4776b815e8737753eb8003b4fd8936130
2011-01-24 18:39:56 -08:00
Romain Guy
5a7b466a2b Add support for drawBitmapMesh().
Change-Id: Ic77f9c534bb90dc7b9458299544bd50b8b6ae6a5
2011-01-20 19:09:30 -08:00
Romain Guy
01d58e43ed Add rounded rects and circles support to OpenGLRenderer.
Change-Id: I6cedf2b495d58de7c0437096809fa9e4518a1b8c
2011-01-19 21:55:10 -08:00
Romain Guy
42f3a4b7c3 Make embedded hardware layers work.
Bug #3369474

Change-Id: Ib6d7fb44eedda9dc2933b5e1b176f307968af91d
2011-01-19 13:42:26 -08:00
Romain Guy
807daf7df6 Add support for skew()
Change-Id: Ia3a9a867f74fd78b61f75179e3788fdc2f0cacd0
2011-01-18 11:19:19 -08:00
Romain Guy
fb13abd800 Fix 9patch rendering in ExpandableListView.
Change-Id: I60843d61a40b0cb7dd09923cb4489a5a76f20486
2011-01-16 15:16:38 -08:00
Romain Guy
6c319ca127 Better backend for hardware layers.
With this new backend, a hardware layer is only recreated when
its associated view is udpated. This offers fast composition
in GL and fast update of the layer in GL as well.

Change-Id: I97c43a612f5955c6bf1c192c8ca4af10fdf1d076
2011-01-11 17:53:19 -08:00
Romain Guy
171c592f0b New layers API for Views.
This API can be used to back a view and its children with either a
software layer (bitmap) or hardware layer (FBO). Layers have
various usages, including color filtering and performance
improvements during animations.

Change-Id: Ifc3bea847918042730fc5a8c2d4206dd6c9420a3
2011-01-06 18:34:30 -08:00
Dianne Hackborn
9f0696709b We are now Honeycomb.
Change-Id: I69dadd57184d2d80f426c1c862ed0a040c8baf03
2011-01-06 12:57:49 -08:00
Xavier Ducrohet
ec31a7f119 Create some layout files for HwAccelerationTest
The goal is use the app to test layout lib, so layout
files are needed, and custom views must be instantiable
(ie public)

Change-Id: I46bb3d8af6e4d7973d041aa618f1c7762efd93d0
2010-12-14 14:58:59 -08:00
Romain Guy
a957eea785 New, better line drawing implementation.
Bug #3207544
Bug #3225875

Change-Id: Ibdd1dfc64e01625d5c441f39eb0aa3ee647f6ff5
2010-12-08 19:06:58 -08:00
Romain Guy
5ec9924d24 Fix rendering issue with layers.
Change-Id: I1d511ab2707000762a942d32c300a9944ab38603
2010-11-03 16:19:08 -07:00
Romain Guy
e5ebcb0107 Fix clipping issue in StackView.
Change-Id: I7ec28f25c3993a2bd7ef6399ba1923839d239905
2010-10-15 13:57:28 -07:00
Romain Guy
7975fb6d12 Apply bilinear filtering to text.
Change-Id: I2c81ad657ee2a11a2139e0b11ae3749db54c0749
2010-10-01 16:36:14 -07:00
Romain Guy
0bb5667b4e Fix INVALID_OPERATION error with layers rendering.
This change is a workaround for a driver bug that causes an INVALID_OPERATION
to be thrown on every glCopyTexSubImage() call. This change also adds a new
test for gradients local matrices.

Change-Id: I41b7437481026702d0a3a9677f099b4557c0a84e
2010-10-01 00:25:02 -07:00
Romain Guy
ee916f14cb Add support for SweepGradient in the GL renderer.
Change-Id: I7aa397ed4e34655ead9ba1f5b4ce087665e0f022
2010-09-20 17:54:17 -07:00
Romain Guy
759ea80dca Add support for drawLines(), with anti-aliasing
Change-Id: I16c0593c5671490909dec13a85df601e1428a1a6
2010-09-16 20:49:46 -07:00
Romain Guy
8411f336c7 Fix rendering issue with layers intersecting the clip rect.
Change-Id: Icbe35194fa219ef13ce639d33631235f8d7df3d7
2010-09-13 17:27:57 -07:00
Romain Guy
f607bdc167 Correct implementation of saveLayer().
Change-Id: I5375126636913e0a84f2d6bbd0ebe40d2e4f2763
2010-09-12 12:24:12 -07:00
Romain Guy
a5aed0d589 Add support for advanced blend modes with the framebuffer.
This adds the ability to blend with the framebuffer using Darken,
Lighten, Add, Multiply, Overlay and Screen.

Change-Id: Iae01a53797d4ad39c373cba6ff2a42293129da1a
2010-09-09 14:42:43 -07:00
Romain Guy
53389bdcdf Correctly set the viewport on window resize.
Change-Id: Idec325264d85feda76d4cda00fa511aaac82cf64
2010-09-07 17:16:32 -07:00
Romain Guy
4299c0f242 Add test for gamma correction.
Change-Id: Id2a311bc116438d3627a943cb5fb1ba8dc121bb0
2010-08-27 16:56:50 -07:00
Romain Guy
a80d32f7b6 Add support for textScaleX.
This will not look great because we render fonts using bitmaps, not
paths.

Change-Id: I01b87b81bfbdbfa28460a5d5309d38e2a65e77c4
2010-08-20 18:42:37 -07:00
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
0a41749953 Cleanup, better code reuse.
Change-Id: Ib86a7309ae579cce3b7cf464782c34e70a74c616
2010-08-16 20:26:20 -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
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
b82da65cb1 Fix improper clipping after a save()
Change-Id: I13426a67f20d77e2710bd500d82884098f4be97c
2010-07-30 11:40: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
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
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
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
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