14 Commits

Author SHA1 Message Date
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
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
Romain Guy
08ae317c21 Add glOrtho equivalent to the OpenGL ES 2.0 renderer.
Change-Id: I063dad3d81dab7833acb1e7a9c7121f8efd2a044
2010-06-21 19:35:50 -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