21 Commits

Author SHA1 Message Date
Romain Guy
7d139ba2c3 Remove extra leftover logs and use uint32_t instead of unsigned int.
Change-Id: I944f82fe3255de38dc04048cc8bd861f578f01a7
2010-07-02 11:20:34 -07:00
Romain Guy
121e224256 Track the size in memory of the texture cache.
The texture cache was previously checking the number of stored textures. This was
not very useful as this could easily lead to an abuse of memory. The new cache
instead tracks the total size occupied in RAM by the cached textures. When a new
texture is generated, older textures are kicked out as needed.

Change-Id: Ib27142f4a018d5bf84774c1fb6f45a67a85f20bc
2010-07-01 18:26:52 -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
fe8809471a Remove unnecessary return and add bitmap generation ID tracking.
Change-Id: Icf5e0635e789f5ea53268c22fad51cf733b5b1a6
2010-06-30 16:05:32 -07:00
Romain Guy
364703c6fa Fix the build.
Change-Id: I08bd6daf25351daca3ae552e1cfcfce85eefa73b
2010-06-30 15:51:03 -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
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