498 Commits

Author SHA1 Message Date
Romain Guy
1639351139 Make libhwui entirely optional.
The makefile variable USE_OPENGL_RENDERER must be set to true to compile
libhwui and the related code in the JNI layer.

This change also removes obsolete APIs from Canvas that must not be used
and would be confusing if left in. These APIs were remnants of our first
attempt at an OpenGL renderer for the view hierarchy and had not been
taken out before Android 1.0 was released.

Change-Id: I2475ff1307212bab26c926724f3c508681c7dae1
2010-08-08 17:45:07 -07:00
Romain Guy
de0547c07a Prevent memory leak with ComposeShader.
Change-Id: I926186c96b3c61085cdb6173d56d3a15a04ac95b
2010-08-07 23:05:17 -07:00
Romain Guy
9e044aed21 Fix NPE in RoundRectShape.
Change-Id: I3cef1b2723e5ebf3583f91b1bfe8121c0f6d253d
2010-08-06 14:27:30 -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
Alex Sakhartchouk
518f033b68 Adding more matrix math functions.
Fixing build.

Change-Id: Ie0f6724ba063ada94d1d44d99bbe56e21d9bd72f
2010-08-05 10:28:43 -07:00
Jason Sams
442a647424 Support constant and varying colors in ProgramFragment.
Change-Id: I16ce84ff427016f3a1923594efc718eca32dd7f2
2010-08-05 10:00:21 -07:00
Alex Sakhartchouk
fb10c16a05 Added ability to set font color.
Propagating the name of meshes and allocations from native a3d to java

Change-Id: If781f55340b5369459610e5e92ea69e240dcd24e
2010-08-04 14:45:48 -07:00
Alex Sakhartchouk
cf9a44cdf3 Adding matrix class methods.
Change-Id: I597b1b3955e29921394909f302800034571e6a50
2010-08-04 10:48:30 -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
694b519ac6 Add text rendering.
Change-Id: Ibe5a9fa844d531b31b55e43de403a98d49f659b9
2010-07-21 21:33:20 -07:00
Romain Guy
a1db574036 Add preliminary support for text rendering.
Change-Id: I547eb631dbda24d13960d54b4144fb8908fd8a49
2010-07-20 16:37:27 -07:00
Romain Guy
f9764a4f53 Add program for linear gradient.
This change adds a new DrawLinearGradientProgram class to enable the drawing
of linear gradients. Two new vertex and fragment shaders are introduced,
based on DrawTextureProgram's shaders.

Change-Id: I885afc076bb6cef8cd3962ae21a086fa6a03bf96
2010-07-16 23:18:27 -07:00
Romain Guy
7fac2e1833 Add plumbing to support gradients in OpenGL renderer.
The LinearGradient class keeps a copy of the various parameters that
define the gradient. The copies are native arrays to avoid copying
Java arrays on every draw call. The gradient code path is implemented
until OpenGLRenderer::drawRect() (see TODO.) The actual gradient
implementation will be added in a latter change.

Change-Id: I9300d250ef5e2e9c2e097c3116ee71dfc9d752d8
2010-07-16 17:10:13 -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
Alex Sakhartchouk
51b7ebc652 Merge "Populate java objects with native data from a3d file. Remove legacy constructor from programraster Make a3d object creation synchronous" 2010-07-15 15:19:07 -07:00
Romain Guy
c96cdc9844 Merge "Add support for BitmapShader." 2010-07-15 14:45:37 -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
Alex Sakhartchouk
dfac814c18 Populate java objects with native data from a3d file.
Remove legacy constructor from programraster
Make a3d object creation synchronous

Change-Id: Ic7d7547cf6eee6f9a7c6e3ee12cd104e80056a7b
2010-07-15 14:02:54 -07:00
Jim Shuma
506821b406 Merge "Making Program*.Builder classes' setters return 'this'" 2010-07-15 13:43:52 -07:00
Jim Shuma
288c8711a6 Making Program*.Builder classes' setters return 'this'
This is for better correspondence with the Builder pattern.
See also: Effective Java, 2nd edition.

Change-Id: Iecccd42be49dea2ed8e4b8cc38ce96379cf3c11c
2010-07-15 13:42:02 -07:00
Scott Main
82e2b4cb51 am 4fd41688: am 5352d237: am 38137d7a: Merge "docs: lots of additions to the resources docs new drawable resources add <merge> and <include> to layout resource update drawable class descriptioons to point to resources guide add ID resource type" into froyo
Merge commit '4fd416880e53c172bac4a51b2eafea699b58badf'

* commit '4fd416880e53c172bac4a51b2eafea699b58badf':
  docs: lots of additions to the resources docs
2010-07-15 11:54:15 -07:00
Scott Main
4fd416880e am 5352d237: am 38137d7a: Merge "docs: lots of additions to the resources docs new drawable resources add <merge> and <include> to layout resource update drawable class descriptioons to point to resources guide add ID resource type" into froyo
Merge commit '5352d2378d2f92ebe0657e4caedb4498492fc404' into gingerbread-plus-aosp

* commit '5352d2378d2f92ebe0657e4caedb4498492fc404':
  docs: lots of additions to the resources docs
2010-07-15 11:23:08 -07:00
Scott Main
5352d2378d am 38137d7a: Merge "docs: lots of additions to the resources docs new drawable resources add <merge> and <include> to layout resource update drawable class descriptioons to point to resources guide add ID resource type" into froyo
Merge commit '38137d7a27b037611c70a9d900aa53b4c15563bf' into gingerbread

* commit '38137d7a27b037611c70a9d900aa53b4c15563bf':
  docs: lots of additions to the resources docs
2010-07-15 11:20:32 -07:00
Mathias Agopian
172b79e9df am 98704f14: am 38eea8bf: Merge "Remove the YV16 format for simplicity\'s sake." into gingerbread
Merge commit '98704f14eaeef6c9bcb73fea162f4941dd9bbd87'

* commit '98704f14eaeef6c9bcb73fea162f4941dd9bbd87':
  Remove the YV16 format for simplicity's sake.
2010-07-14 16:39:42 -07:00
Mathias Agopian
98704f14ea am 38eea8bf: Merge "Remove the YV16 format for simplicity\'s sake." into gingerbread
Merge commit '38eea8bf990540360b45b963195a7766c30b55d2' into gingerbread-plus-aosp

* commit '38eea8bf990540360b45b963195a7766c30b55d2':
  Remove the YV16 format for simplicity's sake.
2010-07-14 16:35:55 -07:00
Mathias Agopian
058d0390a4 Remove the YV16 format for simplicity's sake.
Change-Id: Iee03d100933ba0c67b13d51e0435be3b4cd953cf
2010-07-14 15:12:05 -07:00
Romain Guy
e5e285509f Merge "Enable 32-bits only assets." 2010-07-13 17:42:00 -07:00
Romain Guy
594f406514 Enable 32-bits only assets.
Go away dithering!

Change-Id: Iee5ee2e9430606e732d9b0abb3adc9f68275bd6d
2010-07-13 17:41:31 -07:00
Kenny Root
f35c96bb49 Merge "Support bidi/shaping for getTextPath" 2010-07-13 13:51:24 -07:00
Alex Sakhartchouk
250fd1144f Merge "Work on synchronizing a3d created files and java layer. Adding culling to ProgramRaster" 2010-07-13 12:46:36 -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
Alex Sakhartchouk
80a4c2cd34 Work on synchronizing a3d created files and java layer.
Adding culling to ProgramRaster

Change-Id: I58ccc82d37edc9539289d5eba44ea0e720874af5
2010-07-12 15:50:32 -07:00
Doug Felt
f7cb1f75fd Support bidi/shaping for getTextPath
Move layout-related code into separate class since it's needed by both
canvas and paint.

Change-Id: Iba89a1d94d7cca650255ffa3cbc952b988a51b54
2010-07-12 13:50:08 -07:00
Gilles Debunne
3a70b20ee5 Merge "New cursor controller in TextViews." 2010-07-09 16:22:30 -07:00
Gilles Debunne
cc3ec6cdb2 New cursor controller in TextViews.
Editable TextView now display a cursor controller under the insertion
point so that it can be precisely moved.

Change-Id: Ia2e6ddc57d249647ff6683e10e4226db3df27223
2010-07-09 16:20:21 -07:00
Jason Sams
53a93d5e91 Remove points from fixed function.
Add basic GL performance test.

Change-Id: I421a41b6683b2c5f70045cdd0f610a6939105fee
2010-07-09 15:34:32 -07:00
Jason Sams
f26d01a7ce Merge "Add boolean support for setVar." 2010-07-07 18:52:03 -07:00
Romain Guy
deba785f12 Add support to draw 9patches in OpenGL.
This change only adds the necessary API and stubs. The implementation
will be added in another change.

Change-Id: Ie50b8aff5868e78796cee331df15bdbf990d2ea1
2010-07-07 17:55:03 -07:00
Jason Sams
0b9a22cf78 Add boolean support for setVar.
Change-Id: Id64f3b2e43e19fc2a2d5fd81bb98d9ca67aae843
2010-07-07 17:08:07 -07:00
Doug Felt
4beb8ff717 Support bidi layout for drawTextOnPath.
Change-Id: Ie5867fdb66fe15336774e20d65fa63e0d05bf6fe
2010-07-07 14:58:03 -07:00
Alex Sakhartchouk
8287a9bc5e Cleanup pass on the mesh api change.
Removed all the simple mesh related calls and temporary objects.

Change-Id: Ic64a72a894e0314f216f10e1cfc0d45b17e2e182
2010-07-02 12:14:26 -07:00
Alex Sakhartchouk
164aaedf7f Start of mesh API cleanup.
Switched all native code to go through Mesh class.
Removed SimpleMesh
Added java Mesh class
Will need to port all existing code to use java Mesh, then remove java SimpleMesh.

Change-Id: Idb9c03d0b06b4ef87db28dffcffa1881d39120e5
2010-07-01 16:14:12 -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
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
Alex Sakhartchouk
9b949fce39 Adding freetype font rendering to renderscript.
Change-Id: I3a10ffe27092a41df156341c9cb3f7aa19c49f19
2010-06-24 17:15:34 -07:00
Jason Sams
8f31bd6b68 Merge "Add matrix ops to RSH headers." 2010-06-24 14:51:28 -07:00
Jason Sams
fae3f6b415 Add matrix ops to RSH headers.
Change-Id: I7e2843983a12e0155114b4a18813799e4341d26f
2010-06-24 13:54:11 -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
Gilles Debunne
03f0292744 New XmlDocumentProvider class.
Minor changes in the Adapters.java helper class.

Extracts data out of a XML document using an XPath-like syntax.

Change-Id: I0617b0783f11c86118b42cd8485d54440810c805
2010-06-23 10:43:00 -07:00