464 Commits

Author SHA1 Message Date
Victoria Lease
b61fb10fe4 fix argument mismatches in Paint JNI
Paint.getTextRunCursor() no longer has a "flags" argument on the Java
side. The native side, however, still had the argument, and was being
called with misaligned arguments, causing all manner of madcap fun.

Also, the version of Paint.getTextRunCursor() that took String as an
argument needed to lose the "flags" argument, as well, to prevent an
infinite loop in the CharSequence version of the function, which was
supposed to be calling the String version but was actually calling
itself.

Bug: 8201224
Change-Id: Iad0dabaf81185f29a082566cc64590f2ba9bc31c
2013-02-14 15:58:46 -08:00
Fabrice Di Meglio
ebcacc785b Fix bug #8194572 Chrome SIGBUS'es on launch around TextLayoutCacheKey
- remove remaining dirFlags
- clean method names

Change-Id: I404b643cd10321e977530528168d1d415b3f2eca
2013-02-13 17:22:52 -08:00
Chris Craik
c932760f66 Merge "Revert "Merge remote-tracking branch 'goog/master-chromium' into 'goog/master'" DO NOT MERGE" 2013-02-13 23:14:58 +00:00
Fabrice Di Meglio
0c33ecd209 Merge "Clean Paint.mBidiFlags as it is no longer used" 2013-02-13 19:11:50 +00:00
Chris Craik
7c1a49f5f5 Revert "Merge remote-tracking branch 'goog/master-chromium' into 'goog/master'" DO NOT MERGE
This reverts commit 6c0307dd0aefe9a08794b155fc03ee60ebd14f25, reversing
changes made to a2cd828b749c444d55c2c41c7dbb85088ff94b9f.

Conflicts:
	packages/SystemUI/res/values-sv/strings.xml

Change-Id: Ia178efe8b14751583d47b2826bfe3d3d5463dd2e
2013-02-13 10:50:20 -08:00
Victoria Lease
ded5ed963c Count baseGlyphCount once for scripts without typefaces
Characters from complex scripts without dedicated typefaces were
getting baseGlyphCount counted twice: once in shapeFontRun() and
then a second time during SkScalerContext::getNextContext()
chaining.

This was a problem for text runs beginning with full-width Latn
characters - shapeFontRun() would get the base glyph count for
the typeface containing those characters, then realise it had no
typeface specified for the Latn script, resetting the typeface
to default without resetting the base glyph count along with it.
Mojibake full-width Latn characters, ho!

The same issue also affected Cherokee text, which this fix also
addresses.

Bug: 8127795
Bug: 8034351
Change-Id: I058d81cffbbf86426cc3c5aafcc91a76f4fe6b62
2013-02-12 14:47:43 -08:00
Fabrice Di Meglio
6d9fe5bd22 Clean Paint.mBidiFlags as it is no longer used
See bug #7623824

Change-Id: Ie2f9422821f6dcc73c99e8695f448e966b587b1d
2013-02-12 13:12:13 -08:00
Michael Jurka
7f2e4efa96 am c24b1448: Merge "Don\'t mark recycled bitmaps as immutable"
# Via Android (Google) Code Review (1) and Michael Jurka (1)
* commit 'c24b14481527e2f87ddb3a156b8217d32c645b10':
  Don't mark recycled bitmaps as immutable
2013-02-04 09:35:09 -08:00
Michael Jurka
c24b144815 Merge "Don't mark recycled bitmaps as immutable" 2013-02-04 17:31:17 +00:00
Michael Jurka
afce5a4008 Don't mark recycled bitmaps as immutable
Helps avoid Bitmap allocations in apps that use a
pool of bitmaps and recycle them

Change-Id: I787455a5207bf90d6ed9f1622e0f7f7e1a4a6704
2013-02-04 16:40:25 +01:00
Derek Sollenberger
d0351a67f1 am 1bce2db3: Merge "Fix return type mismatch in Region\'s JNI code."
# Via Android (Google) Code Review (1) and Derek Sollenberger (1)
* commit '1bce2db3b4ac17156066646171c82731c87aa4d1':
  Fix return type mismatch in Region's JNI code.
2013-02-04 05:24:49 -08:00
Derek Sollenberger
250f8ef248 Fix return type mismatch in Region's JNI code.
bug: 7620006
Change-Id: Iddca9b3739b0c116a80a900e06cede338b868e17
2013-02-01 11:57:59 -05:00
Jeff Sharkey
8c02c72475 am 54298652: Merge "Reduce TextLayoutCache logging."
* commit '5429865241f1e63f52fbbcf5d97fcca0ec68e793':
  Reduce TextLayoutCache logging.
2013-01-17 13:00:10 -08:00
Jeff Sharkey
3f32a313db Reduce TextLayoutCache logging.
Change-Id: I09ae49b0a9708de219b18b00ce5b82ee4a0b2bcd
2013-01-17 12:53:27 -08:00
Junichi Monma
7d73eb049f am 6d191ed9: Added the necessary Harfbuzz scripts for rendering Japanese text correctly.
* commit '6d191ed99491f209168e88f3d570e89c6836285b':
  Added the necessary Harfbuzz scripts for rendering Japanese text correctly.
2013-01-17 09:08:30 -08:00
Junichi Monma
6d191ed994 Added the necessary Harfbuzz scripts for rendering Japanese text correctly.
bug id : b/8023135

Change-Id: Ie9a69f480026302ff949fdf2b4089e4d95a38fb0
2013-01-17 16:13:22 +09:00
Kristian Monsen
1893d443eb am 2d76d4f3: Fix build break in master-chromium
* commit '2d76d4f35ca8d0bcb45159555aa7715b7070a751':
  Fix build break in master-chromium
2013-01-15 20:20:08 -08:00
Kristian Monsen
2d76d4f35c Fix build break in master-chromium
Include needed headers and sort them correctly.

Change-Id: I8557c98234d86f4d0b105182f4f191a826c9aeb5
2013-01-15 19:23:21 -08:00
Raph Levien
0728441b93 am e45113a1: Merge "Attempt to resolve build breakage on x86"
* commit 'e45113a1564c6e701fcc076813bee276d501c576':
  Attempt to resolve build breakage on x86
2013-01-15 15:02:51 -08:00
Raph Levien
77b74d4f93 Attempt to resolve build breakage on x86
If the scalblnf function is not available but scalbnf is, this patch
should fix the build.

Change-Id: Id83faba3298a44d57f4c924862a15c5d2bef3ca0
2013-01-15 14:37:27 -08:00
Raph Levien
49a7e454d1 am 7cd0859a: Merge "Update framework text layout to use Harfbuzz NG"
* commit '7cd0859a735c0c6a489d70d5d96e44e9d1a27be8':
  Update framework text layout to use Harfbuzz NG
2013-01-15 11:28:40 -08:00
Raph Levien
aaedde51b7 Update framework text layout to use Harfbuzz NG
These are the frameworks changes to use the new version of Harfbuzz.

Change-Id: Idbef325e8fc1c27a9f2296414ddb1f79b778a00e
2013-01-15 09:58:06 -08:00
Derek Sollenberger
fc615a0f64 Remove calls to SkCanvas::setBitmapDevice()
Change-Id: Ib0aa2f65b77802b105c0e8a9d7cdde2e863d3673
2013-01-08 10:00:54 -05:00
Siva Velusamy
360b4d9418 am af80cdd7: Merge "DdmServer: add controls for OpenGL tracing"
* commit 'af80cdd7dfa28158fa91ab374d8e6d2500de66b1':
  DdmServer: add controls for OpenGL tracing
2013-01-02 09:14:06 -08:00
Siva Velusamy
af80cdd7df Merge "DdmServer: add controls for OpenGL tracing" 2013-01-02 09:10:06 -08:00
Siva Velusamy
0c1761bd37 DdmServer: add controls for OpenGL tracing
Add a new JDWP packet to allow control of OpenGL tracing.

Change-Id: Ic89e2f6299238a612df2f914581049f2cbba088c
2012-12-19 16:31:56 -08:00
Derek Sollenberger
2fa54cef47 Merge "Update framework to support r5967 of Skia." into master-chromium 2012-12-19 06:18:11 -08:00
Andy McFadden
d47f7d8b5f Rename ISurfaceTexture and SurfaceTexture
The C++ class names don't match what the classes do, so rename
ISurfaceTexture to IGraphicBufferProducer, and SurfaceTexture to
GLConsumer.

Bug 7736700

Change-Id: I08e677faf2ebb418ef131d0a8008e01037db0e50
2012-12-18 11:22:21 -08:00
Derek Sollenberger
ca79cf69d0 Update framework to support r5967 of Skia.
bug: 6906025
Change-Id: Iefdb830ec3aa2ab3472c1c142484a7aa21788a15
2012-12-12 15:28:54 -05:00
Jamie Gennis
82bb813f11 stop using a deprecated SurfaceTextureClient ctor
Change-Id: Ie6196ba4896c0ab37b9aed3d1a4ffd04c99c5f80
2012-12-11 17:02:31 -08:00
Romain Guy
059e12ccd2 Use LruCache instead of GenerationCache in libhwui
Change-Id: Ic26ddc7151eb5462bcd243b21daf7187ed6d3bec
2012-11-29 11:44:02 -08:00
Igor Murashkin
c99db2bc46 Updated android.graphics.SurfaceTexture to use wp for FrameAvailableListener
Bug: 7425644
Change-Id: I7ccdc0ef421df7240d6cff9222c37411b1ecaf01
2012-10-30 14:44:25 -07:00
Raph Levien
d98efca738 Modify TextLayoutCache to use new LRU cache
This patch modifies TextLayoutCache to use the new hash-based LRU
caching mechanism, which should be significantly faster than the
old GenerationCache implementation.

Change-Id: I6170462ad93a56156a731a2927680164d62b5cfc
2012-10-25 23:17:33 -07:00
Chet Haase
aaee13176e am 85c1aef9: am 6534dd02: am 74261d84: Merge "Don\'t null the reference to Bitmap pixels until we\'re really ready" into jb-mr1-dev
* commit '85c1aef929b40f6fae31938b9c71160865d67f81':
  Don't null the reference to Bitmap pixels until we're really ready
2012-10-22 15:55:08 -07:00
Chet Haase
547e66531d Don't null the reference to Bitmap pixels until we're really ready
A change in the VM triggers a native memory error more aggressively than before,
showing that there's a bug in the logic of recycling bitmaps. Since the pixel
memory is allocated on the Java heap, nulling out the reference to that memory
in the Java level Bitmap object can cause that memory to get collected at any time.
Meanwhile, we may have a reference to that memory at the native level for rendering
purposes, causing an error if/when we access that memory after it has been collected
by the VM.

The fix is to avoid setting the reference to the pixels to null unless we are
not referring to it in native code. This is determined at the time we call
recycle() - we return a boolean to indicate whether the native code is still
using the memory. if not, the Java code can null out the reference and allow the
VM to collect it. Otherwise, it will get collected later when the encompassing
Bitmap object is collected.

Issue #7339156 HTML5 tests crash the app (Vellamo)

Change-Id: I3a0d6b9a6c5dd3b86cc2b0ff7719007e774b5e3c
2012-10-22 15:25:19 -07:00
Bart Sears
7dbf63665b am ae232842: am b112bb66: am 0ee71add: Merge "Fix native crash while saving a panorama." into jb-mr1-dev
* commit 'ae232842c86f108da5a73c047eff5a09e9c9c222':
  Fix native crash while saving a panorama.
2012-10-17 10:28:52 -07:00
Bart Sears
0ee71adde0 Merge "Fix native crash while saving a panorama." into jb-mr1-dev 2012-10-17 10:20:50 -07:00
Wu-cheng Li
4b63f14c96 Fix native crash while saving a panorama.
YuvToJpegEncoder should handle the case when the height is not
multiples of 16.

bug:7165606

Change-Id: I02f142b233c4f5c0cd8df5e3d1eaebbf62d28052
2012-10-17 18:06:59 +08:00
Romain Guy
ef9f40f11e am b7b30eb0: am fa71ba2c: am 1b85122b: Merge "Add API to enable mipmaps on Bitmap Bug #7353771" into jb-mr1-dev
* commit 'b7b30eb0577e794c744a1e3e3079325f73081c3d':
  Add API to enable mipmaps on Bitmap Bug #7353771
2012-10-16 19:14:13 -07:00
Romain Guy
713e1bb9df Add API to enable mipmaps on Bitmap
Bug #7353771

This API can be used when scaling large images down to a small size
to get nicer looking results.

Change-Id: If09087eed36077eee5355f6047a3ca67747d7d9e
2012-10-16 18:44:09 -07:00
Keun young Park
7a6dca427b am 09ff8a6f: am 27665148: am c378656d: Merge "fix wrong read size in ToColor_S4444_Opaque" into jb-mr1-dev
* commit '09ff8a6f43dad1e27524e41622392fe040b7bdab':
  fix wrong read size in ToColor_S4444_Opaque
2012-10-12 13:48:22 -07:00
Keun young Park
038953da05 fix wrong read size in ToColor_S4444_Opaque
- S4444 takes 16bits, not 32bits
- This caused sporadic failure in CTS BitmapFactoryTest#testDecodeStream4

Bug: 7179389
Change-Id: Ib36a3a569b3149d74f36ae67a069a7b65a72e895
2012-10-12 11:36:13 -07:00
Raph Levien
85e25c478a am 44d21eb5: am 6f3f7c68: am 9dc11eb8: Merge "Fix for 7281523 android.text.cts.SelectionTest#testMoveRight failures" into jb-mr1-dev
* commit '44d21eb5fcfd8f25920ccc3abccf3aedbf01f5df':
  Fix for 7281523 android.text.cts.SelectionTest#testMoveRight failures
2012-10-05 11:02:24 -07:00
Raph Levien
577b07197b Fix for 7281523 android.text.cts.SelectionTest#testMoveRight failures
The failures were caused by the implementation of doTextRunCursor
passing a too-small value for contextCount into the underlying
getTextRunAdvances call (it wasn't accounting for the start offset).
Thus, when getTextRunAdvances made a copy of the text for its cache key,
it was getting a partial copy.

This patch fixes the size so the cache key always has a full copy of the
text.

Change-Id: I57e3ac6de7aef0e1f1c7000dc3d653f9b0d623d2
2012-10-04 23:15:12 -07:00
Raph Levien
997d4283c0 am d8c6c6f5: am 1ca8d35f: am 5a829cbf: Merge "Fix for testPaintFlagsDrawFilter CTS test" into jb-mr1-dev
* commit 'd8c6c6f56630fa466b96dd5359d39a659a1e42f8':
  Fix for testPaintFlagsDrawFilter CTS test
2012-10-03 16:05:18 -07:00
Raph Levien
e174ae210e Fix for testPaintFlagsDrawFilter CTS test
This fixes bug 6948776
android.graphics.cts.PaintFlagsDrawFilterTest#testPaintFlagsDrawFilter
failures on JO

When we moved the drawing of text decorations (underline, strikethrough)
from Skia to our own drawing (so we could take into account the metrics
computed by TextLayoutEngine), we just used the raw flags from the
paint, which ignored the overrides that a DrawFilter can effect.

The patch simply checks for the existence of a DrawFilter in the canvas,
and applies it to a copy of the paint where present. This will be one
extra paint copy where the filter exists, but that's expected to be rare
(other than running this CTS test, of course).

Change-Id: I664c478b73a3a1cc43599ee11bbc02c69b7a96c2
2012-10-03 15:26:47 -07:00
Raph Levien
5472070c4a am 912c3780: am ad3cc4bb: am 217ca3b0: Merge "Fix for bug 7234184 F/TextLayoutCache: Failed to put an entry..." into jb-mr1-dev
* commit '912c37802cd2e3e10495ea4b7c9dc3ccdd1702e5':
  Fix for bug 7234184 F/TextLayoutCache: Failed to put an entry...
2012-10-02 13:09:22 -07:00
Raph Levien
832815cb53 Fix for bug 7234184 F/TextLayoutCache: Failed to put an entry...
This bug was triggered by user code concurrently mutating the character
array while calling into a drawText method in another thread. When the
value of the array changed, it caused inconsistent state, leading to
assert failures.

This is arguably bad behavior by the user code, but it shouldn't cause a
native crash. The fix is to do a defensive copy of the text into the
key, so the value is guaranteed to remain constant throughout the text
layout process. The change is mostly deletion of code, because there was
an optimization to try to avoid such a copy. That optimization was not
actually effective, however, because the indexOfKey() operation in the
KeyedVector underlying the TextLayoutCache did the copy anyway. Thus,
even though this change looks like it's introducing a copy where there
wasn't one before, the actual performance impact should be nil.

Note that the ability to handle a mutating argument is now part of the
contract for TextLayoutEngine::getValue(), and is now documented. That
contract may change, as the result of future optimization. Also, care
was taken to only use the value after the copy.

Other performance issues with TextLayoutCache are tracked in bug
7271109.

Change-Id: I9c90e8e4d501f3f37e2f22a7851f032808d46fbe
2012-10-02 12:32:40 -07:00
Chet Haase
d2e74f3400 am 1dd00221: am bcdaf8cb: am 62ea4363: Merge "Fix texture corruption" into jb-mr1-dev
* commit '1dd002214e9734aa862db9b7e7092aacd737e46d':
  Fix texture corruption
2012-10-01 11:17:35 -07:00
Chet Haase
6a2d17f713 Fix texture corruption
When memory gets low on a device, activities flush everything they can.
Hardware-accelerated activites, such as Launcher, flush GL resources and destroy
the GL context. However, some resources were still hanging around, due to deferred
destruction policies (we don't delete layers until the DisplayLists they are in
are finalized, to ensure we don't deref deleted objects). This meant that we were
referring to obsolete GL data in these objects. in particular, it meant that we might
come around later, after a new GL context was created, and delete a texture object
that was incorrect. We use the layer's "texture id" to refer to the texture underlying the
layer. But if there's a new GL context, then this texture ID is no longer valid, and
we may be deleting the texture that a different object (layer, icon, whatever) is referring
to, because the driver may return that same ID under the new GL context.

The fix is to more aggressively delete things that we know will not be used again
when the GL context is destroyed. In particular, we delete all resources being used
by all DisplayLists at GL context destruction time.

Issue #7195815 Textures corruption on all devices, in many apps

Change-Id: I52d2d208173690dbb794a83402d38f14ea4c6c22
2012-09-30 15:35:08 -07:00