205 Commits

Author SHA1 Message Date
Derek Sollenberger
d39d1affe8 Updates resulting from the Skia merge (revision 1327)
Change-Id: I2a8f5869dbe95bb594f2ba5d7278f9b330e6f17a
2011-05-16 15:30:40 -04:00
Fabrice Di Meglio
2ea7588014 Prepare OpenGLRenderer to use glyphs from TextLayoutCache
- add OpenGLRenderer.drawGlyph()
- refactor glypth logging code

Change-Id: I797e6f1304d3f3f8f6ed31e7f9965d336233d2a4
2011-05-13 11:07:38 -07:00
Conley Owens
e7cb25916c am 1eb31b43: am 718516f3: am 9fd8e057: Merge "Fix memory leak of SkMovie class"
* commit '1eb31b434fdc325c55b65ecf1783c63b2fdfa669':
  Fix memory leak of SkMovie class
2011-05-02 10:11:52 -07:00
Conley Owens
1eb31b434f am 718516f3: am 9fd8e057: Merge "Fix memory leak of SkMovie class"
* commit '718516f3b73468c480ef8d2283a1c80a6223658d':
  Fix memory leak of SkMovie class
2011-04-29 17:15:09 -07:00
Romain Guy
8f67eae87a Take the index parameter into account in drawTextOnPath.
Change-Id: I92ff9b2c0fe16a467996ae1973bbfd4fad5ef750
2011-04-26 11:24:42 -07:00
Fabrice Di Meglio
589e4e27ee Fix bug #4338103 (Android Arabic and Hebrew input is broken)
- fix glyph order when there is only a single run
- update tests

Change-Id: I113f28a8c76cab622fb75ce84bc50d1d38fa254e
2011-04-25 17:48:55 -07:00
Fabrice Di Meglio
0a1413e4bf Clean getTextRunAdvances() APIs
- remove ICU reference in API names
- use a "reserved" int parameter to pass either "0" for Harfbuzz or "1" for "ICU"

Change-Id: I88b4f76feafd203a6999cd7349402fa36a9a4b2a
2011-04-21 17:36:26 -07:00
Fabrice Di Meglio
010d5c4e5b TextLayout cache - update size and improve logging
- set size to 256K
- add pid logging
- fix percent gain computation

Change-Id: Id6da4d606147294e05597022414531c346860f45
2011-04-21 15:33:50 -07:00
Fabrice Di Meglio
4f810c8535 Use Harfbuzz for Paint drawText / measureText / breakText APIs
Change-Id: I35aa02bfd45629bf5c560f98a28399ff3d0fc900
2011-04-19 17:36:13 -07:00
Fabrice Di Meglio
b39d89735b Use Harfbuzz for Canvas drawText APIs
Change-Id: I661d5e9e0bbe9a859e7a000cb161994d29add099
2011-04-18 18:33:48 -07:00
Fabrice Di Meglio
06732fde78 Return chars advances instead of glyphs advances
- take care of log_clusters for char/glyph mapping
- remove verbose logs

Change-Id: Id19af2b4a46cc4ada0b99263a3208de14a979ba5
2011-04-18 17:00:18 -07:00
Fabrice Di Meglio
f7b9e78486 Merge "Add Unicode BiDi Algo before drawing text in Canvas" 2011-04-18 11:15:57 -07:00
Fabrice Di Meglio
689e515ed2 Add Unicode BiDi Algo before drawing text in Canvas
- only for temporary API
- update BiDiTest

Change-Id: Ifd445799dc0fda4da896246e41978cd8d71aa035
2011-04-15 19:39:47 -07:00
Elliott Hughes
e9cf71dfd0 Merge "Don't allocate a raw object then call its constructor manually..." 2011-04-13 10:17:46 -07:00
Elliott Hughes
cf6f7a0f00 Don't allocate a raw object then call its constructor manually...
We can do this in one step.

Change-Id: Id6b70c83002038caf62fe89cc769eca54ae0c055
2011-04-12 17:50:45 -07:00
Elliott Hughes
4cb1753ec6 Remove useless forward declarations.
Change-Id: I8f191367acb18ea9a3f807e791099e0485b1b249
2011-04-12 16:10:26 -07:00
Elliott Hughes
dd66bcbf9d More native code cleanup.
Don't keep unused global references to classes, don't throw exceptions
when an exception is already pending, and fix a (harmless) misunderstanding
about how GetStringChars works.

Change-Id: Ie445036f057daa8a1c76aceb7bad2a84fb81d820
2011-04-12 11:28:59 -07:00
Elliott Hughes
a3804cf77f You don't need to poke around inside FileDescriptor manually.
We can help you with that.

Note also that getParcelFileDescriptorFD did no such thing. All its callers
were passing in a regular java.io.FileDescriptor and expecting the int. No
ParcelFileDescriptors involved.

Change-Id: Idc233626f20c092e719f152562601f406cc1b64a
2011-04-11 17:04:01 -07:00
Elliott Hughes
dcd2ef9acc Merge "More JNI exception-throwing cleanup." 2011-04-08 16:15:26 -07:00
Elliott Hughes
69a017bc1d More JNI exception-throwing cleanup.
There are a few (unimportant) bug fixes here. There were several attempts to
throw exceptions in situations where there's already a pending exception.

There were also cases where the code was wrong; it was checking for a NULL
return from Get*ArrayElements and throwing NPE, but passing NULL is an error
that causes a crash and a NULL return means an exception has already been
thrown. I didn't want to get into the Scoped* classes just yet, but that
was by far the easiest way to fix this.

Change-Id: I0b31160ee51b96e82539f6514b8412b149dba7c3
2011-04-08 15:01:19 -07:00
Fabrice Di Meglio
0343a7eb6d Merge "TextLayoutCache - add glyphs caching" 2011-04-08 14:51:08 -07:00
Fabrice Di Meglio
fcf2be1846 TextLayoutCache - add glyphs caching
- cache glyphs after Harfbuzz shaping
- use "m" prefix for member variables
- add temporary API for drawing text with glyphs
- update BiDiTest app

Change-Id: I619b3f313b15f010018daad21b3e5e486619b4e4
2011-04-08 14:37:18 -07:00
Elliott Hughes
8451b25a44 Use jniThrowException for exception throwing from native code.
I'll do media and the generated gl stuff separately. Otherwise, this
cleans up all direct calls of ThrowNew/Throw except the one in the
binder that needs to remain.

Change-Id: I8f95a5f020f53b25926ad31ac0c9477ddf85d04b
2011-04-07 19:17:57 -07:00
Brian Carlstrom
46e18c11d4 Don't use local ref for cached jclass reference in JNI code
Change-Id: Id45b2acb358a819f2fd332e99f3a095f6fc7299b
related-to-bug: 4241138
2011-04-06 10:04:20 -07:00
Fabrice Di Meglio
48796a81be TextLayoutCache - more code refactoring
- move code from .h file to .cpp file

Change-Id: Ib8201a20e2767ef5d92707a6f4d8d79a3673e04d
2011-04-05 15:35:59 -07:00
Fabrice Di Meglio
1de9e7a9df Code refactoring for TextLayoutCache
- rename TextLayoutCache entry name
- update references to old name
- better variable names in TextLayoutCache::getRunAdvances()

Change-Id: I5173fbc8af79437ce4786084580426f130120ce8
2011-04-05 14:13:22 -07:00
Fabrice Di Meglio
0fb1ac0038 Merge "Code cleaning - suppress non useful code" 2011-03-30 18:39:38 -07:00
Fabrice Di Meglio
99e95b0e12 Code cleaning - suppress non useful code
Change-Id: I3f3bffdd1f5d64a6b601d56bee3b5fc8147086bd
2011-03-30 17:59:19 -07:00
Fabrice Di Meglio
aabe537f1e Update TextLayoutCache key for supporting more SkPaint properties
Change-Id: I35bb991e536e662c1a0724ab7e311fba3d52487a
2011-03-30 16:06:02 -07:00
Fabrice Di Meglio
eee49c699c Fix text redering issue where the text was sometimes truncated
- mostly was visible in Settings apps / Wi-Fi networks summary info for each network
- correctly setup the local SkPaint for advances computation
- improve test app for adding live resizing

Change-Id: Ia031fe1b115b521ba55c7e68f2a26300f02e48ca
2011-03-29 19:44:33 -07:00
Kimiyoshi Kusaka
08d7778f08 Fix memory leak of SkMovie class
Movie class doesn't have finalize method.
So memory leak of SkMovie class of native Skia occurs when Movie class is released.
I add finalize method to Movie class (Movie.java) and jni destructor method to SkMovie class (Movie.cpp).

Change-Id: I4dae9dd95f128cbfade50bef978b219ba99321dd
2011-03-28 11:58:51 +09:00
Fabrice Di Meglio
251ae9a7b4 Fix text redering issue where the text was sometimes truncated
- mostly was visible in Settings apps / Wi-Fi networks summary info for each network
- use ceilf() instead of roundf()

Change-Id: I80310a9f00e8f7eb066d8ff03f52ea8f9cd85880
2011-03-24 17:21:23 -07:00
Fabrice Di Meglio
aa5eb64a0c Merge "Use Harfbuzz instead of ICU4C for computing advances" 2011-03-23 10:56:41 -07:00
Fabrice Di Meglio
9f82b580d7 Use Harfbuzz instead of ICU4C for computing advances
- use Harfbuzz shaper for shaping and getting glyphs
- add test app for showing result of drawText() and drawGlyphs()
- add private API in Canvas and Paint for test app

Change-Id: Ia15be216f8636d2d864066e9b7de2f53008c30f6
2011-03-22 19:36:30 -07:00
Romain Guy
1a81aea814 Update GL textures when changing a Bitmap's pixels
Bug #4146495

Change-Id: I4fe3f8501373b86b164af11ae51642b140035bb8
2011-03-21 15:30:27 -07:00
Eino-Ville Talvala
c5f94d8a47 Add support for timestamps into SurfaceTexture.
API addition: The timestamps are represented as nanoseconds from some
arbitrary time point. Like the SurfaceTexture transform matrix, the
timestamp retrieved by getTimestamp is for the last frame sent to the
GL texture using updateTexImage().

Camera HAL change: Expect vendors to set these timestamps using
native_window_set_buffers_timestamp().  For now, they are
autogenerated by SurfaceTextureClient if set_buffers_timestamp() is
never called, but such timing is likely not accurate enough to pass a
CTS test.

bug:3300707

Change-Id: Ife131a0c2a826ac27342e11b8a6c42ff49e1bea7
2011-03-17 13:10:03 -07:00
Romain Guy
8329db39f2 am b245e31f: am ee7ace06: Merge "Fix rendering artifact in edge fades. Bug #4092053" into honeycomb-mr1
* commit 'b245e31fa8dd1ad6a59ccf858154f3c7b92e0eb8':
  Fix rendering artifact in edge fades. Bug #4092053
2011-03-14 18:21:21 -07:00
Romain Guy
ee7ace065f Merge "Fix rendering artifact in edge fades. Bug #4092053" into honeycomb-mr1 2011-03-14 18:16:39 -07:00
Romain Guy
7b5b6abf85 Fix rendering artifact in edge fades.
Bug #4092053

The problem always existed but was made visible by partial invalidation.
When saving a layer, the renderer would try to postpone glClear()
operations until the next drawing command. This however does not work
since the clip might have changed. The fix is rather simple and
simply gets rid of this "optimization" (that turned out to be
usless anyway given how View issues saveLayer() calls.)

This change also fixes an issue with gradients (color stops where
not properly computed when using a null stops array) and optimizes
display lists rendering (quickly rejects larger portions of the
tree to avoid executing unnecessary code.)

Change-Id: I0f5b5f6e1220d41a09cc2fa84c212b0b4afd9c46
2011-03-14 18:05:08 -07:00
Glenn Kasten
977d1fbf47 am dd264f21: am 76470914: Merge "Bug 3515073 Add ANativeWindow_fromSurfaceTexture" into honeycomb-mr1
* commit 'dd264f21e6e9952b3d2ef53ea8a8a9e918e5ce96':
  Bug 3515073 Add ANativeWindow_fromSurfaceTexture
2011-03-11 16:36:42 -08:00
Glenn Kasten
7647091436 Merge "Bug 3515073 Add ANativeWindow_fromSurfaceTexture" into honeycomb-mr1 2011-03-11 16:31:55 -08:00
Wei-Ta Chen
1f507be1c1 am a2048056: am 2498b4b8: Merge "Fix 3510563: memory leak in BitmapRegionDecoder." into honeycomb-mr1
* commit 'a204805627eddeac0a1777c69ce62d31d339d4cd':
  Fix 3510563: memory leak in BitmapRegionDecoder.
2011-03-09 16:27:25 -08:00
Chih-Chung Chang
b1a04d5456 Fix 3510563: memory leak in BitmapRegionDecoder.
Change-Id: If639d5974204f18fdfd119b9fc7a762977c66f26
2011-03-08 18:47:23 +08:00
Glenn Kasten
846db33313 Bug 3515073 Add ANativeWindow_fromSurfaceTexture
This is similar to ANativeWindow_fromSurface.

Change-Id: Iaadc06a5d0d50685c34876aa89488c16e7cfaa65
2011-03-04 16:39:29 -08:00
Leon Scroggins
13492c848f Add ifdef to prevent header being added multiple times.
Change-Id: I92bb0667bea98e43fca20dceb4fff20e446c03cf
2011-03-04 13:54:35 -05:00
Fabrice Di Meglio
1eb1293732 Merge "Add TextLayout Cache" 2011-03-03 12:21:15 -08:00
Leon Scroggins
a06d86ab81 Move NinePatchPeeker into its own file.
This way it can be used by other clients that want to draw
ninepatches.  Ultimately the goal is to allow ninepatch
drawing from native code for WebView.  Bug:3009375

Change-Id: Id13cef17ed7655a07e9f055586b686cf1e4af392
2011-03-03 11:40:39 -05:00
Fabrice Di Meglio
d313c665e6 Add TextLayout Cache
- use GenerationCache for caching
- move GenerationCache.h from libs/hwui/utils to include/utils
- add #define for cache activation / deactivation

Change-Id: Ifaf519f0b5e33b087a453e4aa6430162d8438f20
2011-03-02 13:29:20 -08:00
Eric Hassold
447ee77431 Merge "Detect out of memory in extractAlpha" 2011-02-24 13:47:16 -08:00
Eric Hassold
ef7be262e5 Detect out of memory in extractAlpha
When extractAlpha() native method in Skia fails to allocate pixels,
it resets target bitmap. This change detects when such empty bitmap
is returned, and throws a OutOfMemory Java exception.

Depends on https://android-git.corp.google.com/g/97793

Bug: 3418381
Change-Id: I65a84998be089c49ed5005f6995bdc4f4d1669bc
2011-02-24 11:21:13 -08:00