20 Commits

Author SHA1 Message Date
Romain Guy
f607bdc167 Correct implementation of saveLayer().
Change-Id: I5375126636913e0a84f2d6bbd0ebe40d2e4f2763
2010-09-12 12:24:12 -07:00
Romain Guy
8aef54fa17 Add support for Canvas flags on save.
This is required for the rewrite of layers support.

Change-Id: I5c0867dcf5aeb0392c8d0fbab05febb0eaff70d9
2010-09-01 15:49:25 -07:00
Romain Guy
8b55f37765 Fix drawing issues with layers.
Prior to this change layers would clip their content incorrectly. They would
also not apply alpha properly.

Change-Id: Id7b3aaa7dbdc51de68fe050e64458f68e40503fd
2010-08-18 17:10:07 -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
af28b51496 Better support for rotation and perspective matrices.
Change-Id: I56b5ae3321735ba5ee42aafc9bc0eb399b9e75b5
2010-08-12 14:34:44 -07:00
Romain Guy
959c91f7f7 Bunch of fixes.
Fixes memory leak, fixes multiple context support, fix 3d transforms.

Change-Id: I7462cfbc57857dbd4de4e76b9d4cba58a1bce77b
2010-08-11 19:35:53 -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
09147fbdc8 Add support for text culling.
Change-Id: Ibf0adacdc5c64d40a8000b21d7cb0797d63efe29
2010-07-22 13:08:20 -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
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
260e102162 Optimize shader binding changes.
This change also cleans up the internal API a little bit by using mat4
everywhere instead of float[16] (for the ortho matrix for instance.)

Change-Id: I35924c7dc17bad17f30307118d5ed437c2ed37e0
2010-07-12 14:43:40 -07:00
Romain Guy
dda570201a Add a layer (FBO) cache.
The cache is used to draw layers so that a new
texture does not have to be recreated every time
a call to saveLayer() happens.

The FBO cache used a KeyedVector, which is a bad
idea. The cache should be able to store several
FBOs of the same size (this happens a lot during
scrolling with fading edges for instance.) This
will be changed in a future CL.

Change-Id: Ic316189e625f0dbcf0d273a71cc981a433d48726
2010-07-06 12:00:33 -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
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
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