• Home
  • History
  • Annotate
  • only in /frameworks/base/core/jni/android/
History log of /frameworks/base/core/jni/android/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
89a2466a2a2859df5f29350117efd7f9d6a2e32f 09-Feb-2015 Leon Scroggins III <scroggo@google.com> Check that bitmap's size does not exceed 32 bits. DO NOT MERGE

BUG:19270126
Change-Id: I075d1cefcd3208305a72b4fa629a262e92eb60ea
raphics/Graphics.cpp
a730ef3f77fc495bc90199b4d45efab26d609782 27-Jan-2015 Leon Scroggins III <scroggo@google.com> Handle bad ninepatch data.

Changes proposed by Ben Hawkes of Google Project Zero.

NinePatchPeeker.cpp:
Instead of asserting, return false for bad data.

ResourceTypes.h:
Store ninepatch values as unsigned.

BUG:19151999
Change-Id: Ibe35e7569f632c6bb8a34a7701e26bb6ed547ec2
raphics/NinePatchPeeker.cpp
112e35b4641a1a8cad3616c8209ab47f03f9ab67 16-Jan-2015 Chris Craik <ccraik@google.com> Merge "Update generationId on bitmaps when decoded into by BitmapRegionDecoder" into lmp-mr1-dev
3b47713b26859f83c0cf7adede8e8090097673ad 15-Jan-2015 Chris Craik <ccraik@google.com> Update generationId on bitmaps when decoded into by BitmapRegionDecoder

bug:18921087

This fixes issues where bitmaps are cached as textures, and not
reuploaded when reused by BitmapRegionDecoder, showing stale content.

Change-Id: I7626fd6acd36d8e38723689734855ce9154eb8c8
raphics/BitmapRegionDecoder.cpp
152d7282a42cd7130648f373775fe75d319557f2 06-Jan-2015 Vladimir Marko <vmarko@google.com> Check for OOM in BitmapFactory's getMimeTypeString().

Bug: 18909596

(cherry picked from commit 7ab249a18e08bfefb8c2d60af1fb668c67ba4368)

Change-Id: Ie7be228442876d47faf37e3f664e378253dab6e3
raphics/BitmapFactory.cpp
f29d5a5b211786248d0557157c304c5fff428bd4 03-Dec-2014 Derek Sollenberger <djsollen@google.com> Update AndroidPixelRef to prevent VM from cleaning up memory prematurely.

bug:18306529
Change-Id: I1ea94df1dcaf4fcf248b63dc8b0a13f36412570a
raphics/Graphics.cpp
raphics/GraphicsJNI.h
de92f4c72be8537d2efff6024390b9ab706286e1 24-Nov-2014 Bo Liu <boliu@google.com> Fix crash in getNativeCanvas when canvasHandle is NULL

BUG: 18261928
Change-Id: I01a5af201fe829d5752433e1bb0db7edc01733d4
raphics/Graphics.cpp
d17793ea2a93af6ba9bc64c77502f48aa32814e4 07-Nov-2014 Dan Stoza <stoza@google.com> Merge "Add a BufferItem parameter to onFrameAvailable" into lmp-mr1-dev
a35778c799e8073a42b9e22191bde9d838327ab7 06-Nov-2014 John Reck <jreck@google.com> Yank ResourceCache out of Caches

Bug: 17947547

Pull the ResourceCache (aka, ref-counting side channel) out of
Caches so that DisplayListRenderer doesn't use Caches, avoiding
the risk of instantiating Caches on the wrong thread or
without a GL context

Change-Id: I7d63b70b3b0a0163308c5dedd6ef255eadebe8fd
raphics/Bitmap.cpp
raphics/NinePatch.cpp
raphics/Path.cpp
2c34b5e8136eac0332dac294cb06a6a98eac1c14 04-Nov-2014 Dan Stoza <stoza@google.com> Add a BufferItem parameter to onFrameAvailable

Passes the BufferItem for the queued buffer to the onFrameAvailable
callback so the consumer can track the BufferQueue's contents.

Bug: 18111837
Change-Id: If9d07229c9b586c668e5f99074e9b63b0468feb0
raphics/SurfaceTexture.cpp
fce84f035c35606c5707e735f503f7bdcfd5b2a1 01-Nov-2014 Svet Ganov <svetoslavganov@google.com> Crash apps that print malformed or password protected PDFs.

If apps are writing malformed content (typically not a PDF file) or if the
PDF content they provide to the print system is password protected, are now
crashed as both of these are app bugs.

bug:17636435

Change-Id: Ifce6a3199e587448dd38f6a84290a965c24b698b
raphics/pdf/PdfEditor.cpp
raphics/pdf/PdfRenderer.cpp
bec22beb99b279d381f720d761ca75fe3e7414dc 25-Sep-2014 Svetoslav <svetoslavganov@google.com> Save to a PDF file should look like print preview.

When rendering a PDF file for print preview we take into account
the selected print options such as paper size, orientation, etc
without modifying the document. To print we send the doc in its
original form and the print options so the print service can apply
the necessary transforms in addition to the optional custom options
it supports. When saving to PDF we have to actually change the
document as we act as a print service.

bug:13545980

Change-Id: Icdcecf962bec6ff742cc6015df5af9d9086ce760
raphics/pdf/PdfEditor.cpp
36960fad6631f3cb5f2c6048e482e19319b6b2d3 22-Oct-2014 Leon Scroggins III <scroggo@google.com> Merge "Decoder only returns true on complete success." into lmp-mr1-dev
754bffe9692f2f62c4788b78eedbd63394db15a2 22-Oct-2014 Leon Scroggins III <scroggo@google.com> am e463bc38: am 3c8bde55: Merge "Report that a JavaInputStreamAdaptor is at end." into lmp-dev

* commit 'e463bc388e7f5d83f864b320dde400e390ef5817':
Report that a JavaInputStreamAdaptor is at end.
91332e7ecac06ef4cd3320095689e6af21e13dc6 16-Oct-2014 Leon Scroggins III <scroggo@google.com> Report that a JavaInputStreamAdaptor is at end.

This prevents a naive caller from continuing to attempt to read.

BUG:17419670
BUG:17873145
Change-Id: Idd462ff9055aea42e8c7d5d58ef177f9e667385b
raphics/CreateJavaOutputStreamAdaptor.cpp
14494262d39964ccd7f0fbac43f45ac2ea1eb224 17-Oct-2014 Leon Scroggins III <scroggo@google.com> Decoder only returns true on complete success.

Recently we added a way for SkImageDecoder::decode to distinguish
between successfully decoding the entire image and only partially
decoding the image (see https://codereview.chromium.org/647023006).

Only consider a call to decode() a success if the image was completely
decoded. This matches pre-L behavior, and lets the caller know that
they need to try to decode again.

Requires a change to external/skia (I33e6940e247b74b20361ae041f8d36eb600df49f)

BUG:17419670
Change-Id: I17ed7288b2359fafaec9551adb16d1d037800eb7
raphics/BitmapFactory.cpp
86fd9278a98260e5812569381a07145221daa33d 08-Oct-2014 Chris Craik <ccraik@google.com> Merge "Enable fast jni for simple RenderNode/Matrix/Paint operations" into lmp-mr1-dev
4136a0aeac9bb95aa615d4fc1f12378829d26c80 08-Oct-2014 Chris Craik <ccraik@google.com> Enable fast jni for simple RenderNode/Matrix/Paint operations

bug:17895119

Change-Id: Id83bfd719ec873028f0d4e7e4e4c0702f3bb3dd9
raphics/Matrix.cpp
raphics/Paint.cpp
5cb769d99952ef9fb4f576abba70423fe157342b 24-Sep-2014 Derek Sollenberger <djsollen@google.com> Fix memory leak where we close the descriptor instead of the file.

bug: 17541634
Change-Id: I9968f9df249e4cba24383239ce6130dd16fcd532
raphics/BitmapFactory.cpp
d29c902f9822ab4b11dd4b91729c64d6987cdf29 26-Sep-2014 Jérôme Poichet <jpoichet@google.com> Revert "Fix memory leak where we close the descriptor instead of the file."

This reverts commit 1503ebd95fc82b1ae6ec8b006e62a9f6109973fa.

Change-Id: Id40cf34821ea244b1a838079bd147bc845b96cb3
raphics/BitmapFactory.cpp
1b99187253fcb03698a7db71394ff8a900ce56a6 24-Sep-2014 Derek Sollenberger <djsollen@google.com> Fix memory leak where we close the descriptor instead of the file.

bug: 17541634
Change-Id: I842176213e0547dd737ef6e0b83c320a5cc32219
raphics/BitmapFactory.cpp
784ab49b6e36aa15ce6a00dfbba6215a7991fce3 11-Sep-2014 George Mount <mount@google.com> Merge "Allow Path approximation to work with a single point Path." into lmp-dev
68cfdad20d83400e0cc0ddb4c86deaeda3337d4d 11-Sep-2014 George Mount <mount@google.com> Allow Path approximation to work with a single point Path.

Bug 17452965

A single point Path (move-to only) was not returning any
verbs in the verb list. This forces an approximation for
single move-to and empty paths by giving the same value
for fraction 0 and fraction 1.

Change-Id: Icb1b932d730457680cf422377a83fe669f0a7687
raphics/Path.cpp
62ce332c141cf7bc7200c4c87d63e395874fc3ec 05-Sep-2014 Svetoslav <svetoslavganov@google.com> Trim unnecessary pages when printing.

A user may request a subset of the document's pages to be printed.
In this case the expectation is that the resulting document does
not include not selected pages. While print serivices can do the
trimming themselves or the printer may do so, moving, potantually
many, redundant pages is inefficient. The real problem is when
saving to a PDF file where the saved file must not have the pages
the user did not select. This change adds shredding of undesired
pages from the PDF before saving it or passing it to a print service.
:
bug:17285994

Change-Id: I7deba535af99457bea3c118202314f0f3812e809
raphics/pdf/PdfEditor.cpp
a08d10fa7051668b629d561bb8411e34d28fdabf 30-Aug-2014 Mathieu Chartier <mathieuc@google.com> Add missing null check to ninePatchInsets

ninePatchInsets could be null after allocation, this possibly caused
a SIGABRT in GC or check_jni failure.

Bug: 17323232

Change-Id: Icd7e3819032e8e999d3c1483bf261bb39b3fe9e4
raphics/BitmapFactory.cpp
raphics/Graphics.cpp
772d576b97ac95cf9ed6cef365470e37fa4f4fda 27-Aug-2014 Raph Levien <raph@google.com> Merge "New weight-aware font config" into lmp-dev
2a5fab9d476f434818ba67d2b8b77208e881f0c1 27-Aug-2014 Raph Levien <raph@google.com> Merge "Fix incorrect return value on missing glyph" into lmp-dev
531dab6d3a2ffcd13684367659dfd0296f86cfe5 27-Aug-2014 Raph Levien <raph@google.com> Fix incorrect return value on missing glyph

The GetGlyph function returns a boolean indicating whether the glyph
exists in the font. However, we were testing the pointer, so the test
would always succeed even if the glyph was missing. This interfered with
fallback algorithms for rendering compatibility characters.

Bug: 15816880
Bug: 16856221
Change-Id: I95cd45bb8f5e8ddf74cf23e6e624fbf30172e00a
raphics/MinikinSkia.cpp
117cbebe810613d4a6de034f02652cdbbfef4cde 25-Aug-2014 Raph Levien <raph@google.com> New weight-aware font config

Parse new fonts.xml config file, and resolve weight selection based on
the base weight of the font (as defined by a weight alias specified in
the config file) and the requested bold flag. This change improves the
appearance of bold spans for alternate weights of Roboto.

In addition, this patch enables weight selection for fallback fonts.
For example, if an additional font with a weight of 100 is added to the
Hebrew font family in the fallback list, then requesting
"sans-serif-thin" would select that font for Hebrew text.

Bug: 14538154
Change-Id: I99a04fad4f7bf01c75726e760d42735dd9003496
raphics/FontFamily.cpp
raphics/Typeface.cpp
raphics/TypefaceImpl.cpp
raphics/TypefaceImpl.h
1698297daf8068bc9e6971d43744d48f1672bab2 26-Aug-2014 John Reck <jreck@google.com> Merge "DO NOT MERGE Copy shaders" into lmp-dev
c1469f39b571f5660346fc837ac30b19d7651a43 25-Aug-2014 John Reck <jreck@google.com> DO NOT MERGE Copy shaders

Bug: 16733996

Change-Id: I84afc1b24a23dd6ddf5ab48fb2bfcbe779f8d3e3
raphics/Shader.cpp
908040534dfc9f227c60dbf170c6b27a1ff123d8 25-Aug-2014 Raph Levien <raph@google.com> Preserve paint parameters in Paint copy constructor

The copy constructor for Paint was setting default values for additional
parameters, rather than copying them from the original object, resulting
in incorrect locale in the software text drawing path.

Fix for bug 17149910 "Chinese font is used on IME even if the system
language is Japanese"

Change-Id: I25f377ce4e0ea66946a27ea46a2db524872ae36f
raphics/PaintImpl.cpp
01edef10b9724fa5607d7918addc31a3b0c991dc 22-Aug-2014 John Reck <jreck@google.com> Revert immutable Shader change

Bug: 16733996

Change-Id: I51686aaf8f6ae8d0e390e298ad70f98f81c5f555
raphics/Shader.cpp
bd8db2e87e16900ff9b87937d3ccff6a50bd5b2a 21-Aug-2014 Chris Craik <ccraik@google.com> Add bounds checking to nine patch scaling

bug:17114103

Better handle the case, when scaling the divs in a nine patch, where
divs fall outside of the bounds of the bitmap.

Change-Id: I244b9c45b938c2a15f29e4563a86825ee9439b5f
raphics/BitmapFactory.cpp
6f03023ece076d33d8b171d5398c8ed70abf3f54 07-Aug-2014 Derek Sollenberger <djsollen@google.com> Remove dependency on SkPaintOptionsAndroid

Change-Id: I579a3503697efe3b8fd9bc809a6c9bfbf735cb1b
raphics/MinikinUtils.cpp
raphics/Paint.cpp
raphics/Paint.h
raphics/PaintImpl.cpp
e9ad3931fae71c8a8cd000fd52d5df4be79b0895 31-Jul-2014 Behdad Esfahbod <behdad@google.com> Add fontFeatureSettings to TextView and attrs

New API is hidden.

Bug: 15246510
Change-Id: I8cdbbd3a36fc280e07569dbb130f8c237062fff5
raphics/Paint.cpp
8e554924c527183962fc908c5f916f390f806c74 01-Aug-2014 Chris Craik <ccraik@google.com> Merge "Add outline alpha" into lmp-dev
77b5cad3efedd20f2b7cc14d87ccce1b0261960a 31-Jul-2014 Chris Craik <ccraik@google.com> Add outline alpha

bug:16140822
bug:16566746

This allows background drawables to alter the opacity of a shadow
being cast with their own alpha values.

Change-Id: I49698cc7c1bf4b2b55ffe2f82899543ca62bc61c
raphics/BitmapFactory.cpp
raphics/NinePatchPeeker.cpp
raphics/NinePatchPeeker.h
805f6ebf17e2791624bb1a30834b4c1cc65583bf 30-Jul-2014 Behdad Esfahbod <behdad@google.com> Support FontFeatureSettings in Paint

New API is hidden.

Bug: 15246510
Change-Id: Idefca06a366de0d87f53d123b5291788448de4d0
raphics/MinikinUtils.cpp
raphics/Paint.cpp
raphics/Paint.h
raphics/PaintImpl.cpp
ed1e6962bafb0c295cf8bdee778ee4af8ec01171 30-Jul-2014 Raph Levien <raph@google.com> Merge "Bump refcount of canvas created for Picture" into lmp-dev
febccd05f2e9ad2422d74fcf33ec9bc900ae83bb 30-Jul-2014 Raph Levien <raph@google.com> Bump refcount of canvas created for Picture

Both the Canvas and Picture objects will unref the canvas in their
finalizers, so an extra ref is needed. This had been present but was
inadvertently removed in the patch "Refactor android.graphics.Picture
JNI bindings." This patch simply restores the previous ref and comment.

Bug: 16399257
Change-Id: I9911826bd0e668bd25546ef54b0c9c1d467538c8
raphics/Picture.cpp
fa80f7491df82d71b7084500519a2195afbea706 18-Jul-2014 Behdad Esfahbod <behdad@google.com> Add letter-spacing to Paint and TextView

New API is hidden.

Bug: 15594400
Change-Id: I5cbe7aebef0b7280eb13924f2a706c0cb4a4688e
raphics/MinikinUtils.cpp
raphics/Paint.cpp
raphics/Paint.h
raphics/PaintImpl.cpp
c41d941f1b999502a2121597edeb3c23d26a2269 30-Jul-2014 Derek Sollenberger <djsollen@google.com> Disable fallback chaining in Skia.

Change-Id: I6e57b525bc4953a5b8969bb4c3e71b4a53de33d3
raphics/Paint.cpp
e21e2a2d1d85d422230c1115abba824338763a88 29-Jul-2014 Behdad Esfahbod <behdad@google.com> Clean up Minikin includes

Include headers where they are used. Add header guards to MinikinSkia.h

Change-Id: If341231625348290d28a7d625561fffc171a8407
raphics/MinikinSkia.cpp
raphics/MinikinSkia.h
raphics/MinikinUtils.cpp
raphics/MinikinUtils.h
raphics/Paint.cpp
raphics/SkiaCanvas.cpp
5ec789608bda858a0c6d669bb44a35a5a99abcdb 29-Jul-2014 Behdad Esfahbod <behdad@google.com> Use new minikin Layout::doLayout() that doesn't use a CSS string

The CSS version will be removed in minikin soon.

Bug: 16651112
Change-Id: Icebcbde6869e64399f160e1773e843cdd0199bc8
raphics/MinikinUtils.cpp
c437f6eef2e92fd1ca1c542a8e41315253ec7747 25-Jul-2014 Behdad Esfahbod <behdad@google.com> Merge "Further centralize Minikin interaction" into lmp-dev
63c5c78a72a21d57913e8601cc2a1ab72a424a02 25-Jul-2014 Behdad Esfahbod <behdad@google.com> Further centralize Minikin interaction

Part of the fix for bug 15246510 and others.

Change-Id: Ie99000989dfcd7a81aaa1233dec522344f852f31
raphics/MinikinUtils.cpp
raphics/MinikinUtils.h
raphics/Paint.cpp
1fc68395d3851a49825cdcbfc7f9ceb4fb206ec1 25-Jul-2014 Behdad Esfahbod <behdad@google.com> Remove unused TextLayout.h

Respective code was removed when switching to Minikin.

Change-Id: I353c834457145ccd9462a439dfdf16d4adb8b695
raphics/TextLayout.h
cae05e0b4c4726236487bdd7c23b82e93f85fd23 24-Jul-2014 Derek Sollenberger <djsollen@google.com> Move Canvas.h to a new location so that it can be shared with HWUI.

Bug: 15672762
Change-Id: Ia59e986cd4034e16b2e54e8d594e6941a6c9fb1b
raphics/Canvas.h
acb4099deff72c2c631f7110a405a3331d3e8b27 21-Jul-2014 Derek Sollenberger <djsollen@google.com> Refactor text drawing to move minikin interactions outside of the canvas interface.

bug:15672762
Change-Id: Iad63855424b4eeccef67a7341a9c2b0018c64c30
raphics/Canvas.h
raphics/SkiaCanvas.cpp
866cf65cc3c53f67836c9157d5c661adfdbd25e1 22-Jul-2014 Leon Scroggins III <scroggo@google.com> Make updateLocalMatrix replace the current Matrix.

Fixes a bug introduced in I3c3316377874e89fccc85afb864bc038b0ef3890.

CreateLocalMatrixShader combines the existing matrix with the new
matrix, which is not what we want. Keep track of the original
SkShader at all times, and always create the local matrix shader
with the original. Store the SkShader with a local matrix as
Shader.native_with_local_matrix.

Make Shader.native_instance private. Instead of allowing direct
access, add an init() method which sets it, and getNativeInstance(),
which returns either native_instance or native_with_local_matrix,
as appropriate.

Make Shader subclasses call init(), instead of setting native_instance
directly.

Pass native_with_local_matrix pointer to nativeSetLocalMatrix and
nativeDestructor, which unrefs it (if not null).

Since nativeSetLocalMatrix no longer replaces the original, do not
unref it.

Add a comment to Shader.updateLocalMatrix that it does not affect
ComposeShaders created with this Shader. (This should have been a
part of I3c3316377874e89fccc85afb864bc038b0ef3890.)

BUG:16293121
Change-Id: Ieb31c7e1fe99081f6b81493178f4a18d3c5df643
raphics/Shader.cpp
f23f5de1731be798f03a7808cf205457522e5d2e 22-Jul-2014 Chris Craik <ccraik@google.com> Merge "[Bitmap] Add null pointer protection in Bitmap_sameAs()" into lmp-dev
53001ca3a629c0069f4fdac44f7711ad4a0c395a 03-Jul-2014 henry.uh_chen <henry.uh_chen@htc.com> [Bitmap] Add null pointer protection in Bitmap_sameAs()

Symptom: SkBitmap::getAddr(int, int) may return NULL due to unrecognized config
(ex: kRLE_Index8_Config). This will cause memcmp method to crash. Since bm0 and
bm1 both have pixel data() (have passed NULL == getPixels() check), those 2
bitmaps should be valid (only unrecognized), we return JNI_FALSE to warn user
those 2 unrecognized config bitmaps may be different.

Cherry-pick of 3a1bffa835f279628e50385af3c85789bc737f64 from AOSP

Change-Id: I6970c27de412110a3035d0a783112c4cd3ebc35b
raphics/Bitmap.cpp
6ba30b85ddfbe37c338ee8dde3dd33322eb38d47 15-Jul-2014 Behdad Esfahbod <behdad@google.com> Add android.Paint that inherits SkPaint

The idea is that extra paint parameters that only affect text layout
(not rendering) will go in android.Paint instead of going into
SkPaintOptionsAndroid. We will eventually move those out of SkPaint
too.

This is currently implemented in PaintImpl.cpp. Will be renamed when
current Paint.cpp that has JNI bits is moved to android_graphics_Paint.cpp.

Change-Id: Iba66c34dea5da503a13b9c864cb9f2211ac4ba7d
raphics/Bitmap.cpp
raphics/Canvas.h
raphics/CanvasProperty.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/MinikinUtils.cpp
raphics/MinikinUtils.h
raphics/Movie.cpp
raphics/NinePatch.cpp
raphics/Paint.cpp
raphics/Paint.h
raphics/PaintImpl.cpp
raphics/Rasterizer.cpp
raphics/SkiaCanvas.cpp
2cb8c3c9e5d79dfba10d2f39792ad553d4fbc292 21-Jul-2014 Derek Sollenberger <djsollen@google.com> Remove invalid SkASSERT that prevents us from running with SK_DEBUG

Change-Id: I5634990e6cb962d72b686f7f103b9af7d96d4b55
raphics/Graphics.cpp
8872b38ef403cc2c44aca07d392f5e9426fd7f54 23-Jun-2014 Derek Sollenberger <djsollen@google.com> Separate Canvas JNI code from the implementation.

This introduces Canvas.h which is a pure virtual interface that
is intended to be used by both Skia and HWUI implementation. To help
stage this transition this CL only introduces the interface and Skia
implementation. The interface is not intended to be final and will
undoubtedly go through iterations in both style and location as we
look to introduce the HWUI implementation.

BUG:15672762
Change-Id: Ibaccdddb87d3b9358f4f0c1d317ead5282d4ee16
raphics/Camera.cpp
raphics/Canvas.cpp
raphics/Canvas.h
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/NinePatch.cpp
raphics/Picture.cpp
raphics/Picture.h
raphics/SkiaCanvas.cpp
raphics/pdf/PdfDocument.cpp
580ff8142b7d0455d0d41ee77572b4f55dd935f0 17-Jul-2014 John Reck <jreck@google.com> Revert "Separate Canvas JNI code from the implementation."

This reverts commit e28a5afee885cd69a5be5809f88116b601cb1a72.

Appears to cause memory corruption and random appearances of
chinese

Bug: 16343240
Bug: 16336642

Change-Id: Ife169181f40adff4b12948ed5f9d3a88dcec935b
raphics/Camera.cpp
raphics/Canvas.cpp
raphics/Canvas.h
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/NinePatch.cpp
raphics/Picture.cpp
raphics/Picture.h
raphics/SkiaCanvas.cpp
raphics/pdf/PdfDocument.cpp
f5d6c555c3430f6e423952ba3ab024380e550bba 23-Jun-2014 Derek Sollenberger <djsollen@google.com> Separate Canvas JNI code from the implementation. DO NOT MERGE

This introduces Canvas.h which is a pure virtual interface that
is intended to be used by both Skia and HWUI implementation. To help
stage this transition this CL only introduces the interface and Skia
implementation. The interface is not intended to be final and will
undoubtedly go through iterations in both style and location as we
look to introduce the HWUI implementation.

BUG:15672762
Change-Id: Idefadede356f688edb8eb09b4a02aa01b4077f62
raphics/Camera.cpp
raphics/Canvas.cpp
raphics/Canvas.h
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/NinePatch.cpp
raphics/Picture.cpp
raphics/Picture.h
raphics/SkiaCanvas.cpp
raphics/pdf/PdfDocument.cpp
47cd8e921db73e894f94ec4729ade90da50996f5 09-Jul-2014 Chris Craik <ccraik@google.com> Implement outline support for nine patches

b/15856895

Nine patches now have outline round rect metadata stored as optional
png tags. aapt generates these automatically by inspecting the bitmap
pixels to estimate outline bounds and round rect radius, based on
opacity.

Change-Id: I226e328a97873010d9e1adb797ac48f93a31183c
raphics/BitmapFactory.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/NinePatchPeeker.cpp
raphics/NinePatchPeeker.h
ab87983a11e0bd2e08d752d86d5e945ea7d39a04 09-Jul-2014 Leon Scroggins III <scroggo@google.com> Simplify Shader.setLocalMatrix.

Previously, calling setLocalMatrix updated any Paint that had the
Shader attached. This depended on deprecated behavior in Skia. Use
new Skia APIs, and do not modify any Paints that use the Shader.

In addition, update callers to call setShader (again) after modifying
the Shader.

Sample app at ag/499573 for testing.

Depends on I673801444f0a8fd4f192b5b7effdde1aa83e702b in external/skia.

BUG:14315916
Change-Id: I3c3316377874e89fccc85afb864bc038b0ef3890
raphics/Shader.cpp
525a66b2bb5abf844aff2109bdc9ed819566bece 15-Jun-2014 Svet Ganov <svetoslavganov@google.com> Adding print preview.

This change adds the pring preview part of the new print UX. The
UI has two parts, the top section is the print options and the
bottom section print preview with a list of pages. The user can
interact only with one of them. When print options are expanded
they cover the preview content and a scrim is laid out on top of
the preview. Tapping the scrim collapses the print options. When
the user types in page ranges and closes the options to look at
the preview, the latter is updated to show only these pages. In
the list of pages the user can further prune pages by deselecting
them.

Change-Id: I0b23d2c598afe2a34400ccfa43e4e935af83c72f
raphics/pdf/PdfRenderer.cpp
1103b3255945d2eb2fa9c191e84e2270b343cca9 08-Jul-2014 Mike Reed <reed@google.com> SkBitmap::Config is deprecated, use SkColorType

Change-Id: Ic953741325607bf85598c097bb3ab648d4a08996
raphics/Bitmap.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/NinePatchImpl.cpp
pengl/util.cpp
42a1d08df7d417fd4e67eabc91ff05ee77fd9995 08-Jul-2014 Mike Reed <reed@google.com> SkBitmap::Config is deprecated, use SkColorType

Change-Id: Ida181d2aac760072cf2d01409edac37699dea216
raphics/BitmapFactory.cpp
raphics/BitmapRegionDecoder.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
4a9c3891d4f890109e02bc83fecf9bcdf56a9395 07-Jul-2014 Mike Reed <reed@google.com> kNative_8888_SkColorType is now kN32_SkColorType

Change-Id: I13421a21de611203c62c1c1c36570a8cc803907b
raphics/BitmapFactory.cpp
c054966b719c8a7255f7cf4120cca5050acb68bd 04-Jul-2014 Alan Viverette <alanv@google.com> Make optical insets actually work

Change-Id: I9fabf4cb939cc7a868f95580e7229745acde0418
raphics/BitmapFactory.cpp
27bb05f2dccf1ac2ca55515aa0f4a99cd9c548a7 03-Jul-2014 Raph Levien <raph@google.com> Fix native crash when typeface is missing

Creating a typeface from a missing file crashes when it tries to extract
the style from the font. This patch just uses default style when the
resulting font object is NULL.

Bug: 15930808
Change-Id: I9438687100026f336db7aa204fe3a0232eee2db6
raphics/TypefaceImpl.cpp
57ee620ced8caed1eb8651717f6a6d2d5f1f9a5b 05-Jun-2014 Leon Scroggins III <scroggo@google.com> Read premultiplied status from the SkBitmap.

Replace the Java variable with mRequestPremultiplied, to better
reflect what it represents. In both native and Java, the SkBitmap
is used as the decision maker of whether a Bitmap is premultiplied.
When changing other settings, mRequestedPremultiplied is used to
determine whether it should be premultiplied (if the new config/
hasAlpha-ness etc supports it).

ChooseFromColorProc now reads both the colortype (instead of the
deprecated Config) and alphatype on the SkBitmap. Same with
ChooseToColorProc. In the process, this caught a bug, where the
wrong procs were being used for Index8.

Replace instances of SkBitmap::Config with SkColorType where I
was already changing code.

Use the new versions of setConfig/allocPixels that take an SkImageInfo
as a parameter.

Document isPremultiplied's return value for ALPHA_8.

BUG:13618134
Change-Id: I91fc1f1e46e9294364b1af0ab4bdb37c68d7058e
raphics/Bitmap.cpp
raphics/Canvas.cpp
raphics/GraphicsJNI.h
493f2e11909e2d5839ca81ddc66d48d538192478 26-Jun-2014 Dan Stoza <stoza@google.com> SurfaceTexture: Allow creation in detached mode

Adds a constructor that doesn't require a GLES texture name and sets
up the SurfaceTexture in detached mode.

Bug: 15616428
Change-Id: I375495f481bfbe43b3830ab7d124cef8f1be0ac6
raphics/SurfaceTexture.cpp
3d528c403c8945cc326bb656ff0c2e11373401da 26-Jun-2014 Raph Levien <raph@google.com> Fix build breakage

Other files were including GraphicsJNI.h and didn't have Minikin in the
include path. This patch eliminates the offending include.

Change-Id: I05c9dbf80b93f1731fd0192015e2c9c68a9dd3c6
raphics/FontFamily.cpp
raphics/GraphicsJNI.h
raphics/Paint.cpp
3660789f06c5fbcb81e6c7c79612048bff8f0f66 26-Jun-2014 Raph Levien <raph@google.com> Switch all text layout to Minikin

This patch switches all text layout operations to use Minikin, removes
the USE_MINIKIN #ifdef, and deletes some of the code that was only used
in the old TextLayout path (although some more refactoring remains).

Change-Id: I51b5c4e2bb46cfd9d204c12b9f16f135c769f5b5
raphics/Canvas.cpp
raphics/FontFamily.cpp
raphics/MinikinUtils.h
raphics/Paint.cpp
raphics/TextLayout.cpp
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
raphics/Typeface.cpp
raphics/TypefaceImpl.cpp
raphics/TypefaceImpl.h
d194262f53799ef7cd660729a8f1027263f73e27 26-Jun-2014 Raph Levien <raph@google.com> Delete Paint.getTextGlyphs()

The Paint.getTextGlyphs() method was used for testing the old Arabic
shaper and is entirely obsolete. Note that this is the very last
dependency (other than some enums in the header) for the old TextLayout
code path.

Change-Id: I7b596f0c0942ed50987fc8e0478cd93e667f1f9e
raphics/Paint.cpp
3744a64a8ade439f85f27c34369f2c1207e6c252 26-Jun-2014 Raph Levien <raph@google.com> Use Minikin's purgeCaches

In USE_MINIKIN builds, purge the Minikin caches rather than the
TextLayout caches.

Change-Id: Id6bf9db38488ed5023a61feab88004511393644c
raphics/Canvas.cpp
raphics/MinikinUtils.cpp
b933055cf3f7f8ea89bfd3bc9c37a3891ff7310a 16-Jun-2014 Mike Reed <reed@google.com> stop using (deprecated) SkBitmap::Config

Change-Id: Ic75b5fc6996578e9d95bd3a220439ec1541d7c3b
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/Canvas.cpp
e368b6bcfd499543a876b4cae02f1ca563ff1cb6 16-Jun-2014 Raph Levien <raph@google.com> Use Minikin grapheme cluster breaking

This patch uses the Minikin implementation of grapheme cluster breaking,
which improves the behavior of left and right arrow keys for moving the
cursor. Among other things, it fixes the behavior of jumping over the
"fi" ligature in Roboto.

Part of a fix for b/15653110 Improve behavior of arrow keys in EditText

Change-Id: I80ca54c973d85c49f23b81d51a0fe07a7a853d81
raphics/Paint.cpp
3f0d6167227d6d2cdd85f7718d92db859b443e92 18-Jun-2014 Raph Levien <raph@google.com> Simple implementation of drawPosText

The existing implementation of drawPosText is broken in various subtle
ways, in any case doesn't work with Minikin. This patch just implements
it by drawing a separate run for each Unicode character, which should
have the least surprising results for complex scripts such as Khmer.

Part of b/11750374 Resolve TODO items for Minikin

Change-Id: I874ae3c163f0cbe3cdf0160564fab04305aed5aa
raphics/Canvas.cpp
a0dc40409265fa46c3ceee91ec68d2f45b8f67e8 18-Jun-2014 Derek Sollenberger <djsollen@google.com> Fix namespace for picture

Change-Id: Id21ebcf2ba4befb4af15cd1d493428a64599afc1
raphics/Picture.cpp
c802c8cda234129c1ce3c7a939bd68a1d5813ce6 18-Jun-2014 Raph Levien <raph@google.com> Merge "Implement drawTextOnPath with Minikin"
9d2b5e1930bfc4b1da1c865843c247c708ea1565 16-Jun-2014 Raph Levien <raph@google.com> Implement drawTextOnPath with Minikin

This patch contains an implementation of drawTextOnPath for both
software and hardware Canvas using Minikin for text layout. One of the
steps for switching all remaining text operations to Minikin so the old
TextLayout and Skia fallback fonts mechanisms can be deleted.

Bug: 11750374 Resolve TODO items for Minikin
Change-Id: I06bfe74a101fa1dcdfc38f530f7194d71e522a85
raphics/Canvas.cpp
raphics/MinikinUtils.cpp
raphics/MinikinUtils.h
bc8bd76bc707cede75638ca299feb4a8d8698f3b 18-Jun-2014 Derek Sollenberger <djsollen@google.com> Merge "Refactor android.graphics.Picture JNI bindings."
24609581330bc350f797179e3c1a59789c645ec2 13-Jun-2014 Antonio Calabrese <acalabrese@google.com> Added primitive parameters to various functions requiring rectangles.

Change-Id: I5a2678fa989f0ff34404b8236787a8153b05f113

bug:14322352
raphics/Canvas.cpp
raphics/Path.cpp
4b0959d8db20c08ab1fed37f397b303af229162b 12-Jun-2014 Derek Sollenberger <djsollen@google.com> Refactor android.graphics.Picture JNI bindings.

This is the first CL in a series of CLs to refactor the Graphics JNI bindings.

bug: 15672762
Change-Id: I1455fa1330c7426407c06eeaad81ad37a57373b1
raphics/AndroidPicture.cpp
raphics/AndroidPicture.h
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/Picture.cpp
raphics/Picture.h
a7aa1b0aa566b2ff310cb89fbc9437de4819f583 12-Jun-2014 Anish Athalye <aathalye@google.com> Implement Paint.breakText() using Minikin

Change-Id: I36cee2d840ce1bd24a9a06f0c680880396b7398a
raphics/Paint.cpp
051910b9f998030dacb8a0722588cc715813fde1 16-Jun-2014 Raph Levien <raph@google.com> Clean up dirFlags / bidiFlags confusion

The dirFlags and bidiFlags enums are distinct, and have different
meanings. The former is a determined direction for a run of text, while
the latter is a request for the bidi algorithm. They have been used
interchangeably, and this has caused some problems, notably running the
bidi algorithm needlessly when the direction for a run is already
determined.

This patch cleans up the confusion, by always naming each occurrence
explicitly "boolean isRtl" or "int bidiFlags" (the previous code often
just used "int flags", which added to the confusion), and converts
between the meanings when a function takes an isRtl argument but passes
it to another function expecting bidiFlags.

Fixes b/15089607 Clean up bidi flag mess

Change-Id: I410b6604376e853dd12c255e7f5a9d2b9a310dd9
raphics/Canvas.cpp
raphics/Paint.cpp
cf6edd2b22473648fe4589aa256d4e851d33d1db 12-Jun-2014 Florin Malita <fmalita@google.com> Merge "Pass full matrix + clip save flags to the native SkCanvas."
17a8bfc38a565ae96f43d36b223779be840bb50c 03-Jun-2014 Leon Scroggins III <scroggo@google.com> In Bitmap.reconfigure, update the pixelref's info.

This fixes CTS tests which are crashing on an SkASSERT due to a
mismatch of SkImageInfo between the SkPixelRef and SkBitmap.

Also directly call ref() and unref() instead of SkSafeRef/SkSafeUnref,
since we would already crash if the SkPixelRef in question was NULL.

Also if the user attempts to reconfigure to 4444, use 8888 instead.

Change-Id: I473ef225c6cd1c92d67ae103c53c6cff0dad92de
raphics/Bitmap.cpp
b59508fce51b23f0201f4dcba7e4f18bab4f9d1a 23-Apr-2014 Robert Phillips <robertphillips@google.com> Changes to framework for ToT Skia.

Consists of 3 cherry-pick from changes by robertphillips@google.com
in master-skia:

-----------------------------------------------------------------------

New AndroidPicture wrapper class

Address code review comments & use new SkPictureRecorder::partialReplay
entry point

Addressing code review issues

Switch MakePartialCopy to makePartialCopy

Conflicts:
core/jni/android/graphics/Picture.cpp

Ie530ab15b3d549f0ecfb0ecc131f9144a7b72a91

Remove AndroidPicture from GraphicsJNI and split into .h and .cpp

-----------------------------------------------------------------------

Fix lingering legacy picture recording behavior
Address code review issues

Iaf870c2c400dbe70dc32d6d445574904f5ea718f

-----------------------------------------------------------------------

Update Android to new SkCanvas::drawPicture interface

As of Skia 9b14f26d (Alter SkCanvas::drawPicture (devirtualize,
take const SkPicture, take pointer) -
https://codereview.chromium.org/313613004) SkCanvas::drawPicture
has an alternate signature. The old entry point is deprecated.

I63395da61ecc3b58bfd2bc094752081f4b2f7535

-----------------------------------------------------------------------

Change-Id: I041133aeb5639abd853370e512acf93870f82aea
raphics/AndroidPicture.cpp
raphics/AndroidPicture.h
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/Picture.cpp
raphics/pdf/PdfDocument.cpp
b85056018b5be05c19c7b1cce1ccee35759ad1b4 05-Jun-2014 Florin Malita <fmalita@google.com> Pass full matrix + clip save flags to the native SkCanvas.

With granular state flags being deprecated, always pass full
save flags to the native canvas.

Legacy behavior is emulated in NativeCanvasWrapper, with a focus
on minimizing the overhead when there are no side effects to be
persisted.

Change-Id: Ifdad2ff9bb3a1f9736c6c41afc9ec6c07f62320e
raphics/Canvas.cpp
0627ec08dcc2e87c17e9b85f045dfb27dc4884b3 07-Jun-2014 Raph Levien <raph@google.com> Support fake italics

This patch adds fake italics, using essentially the same mechanism as
the fake bold implementation. Also combines fake bold/italic settings
with ones explicitly set in the paint.

Change-Id: Ia7eb3ddc8a6192d191711ba723ffd0d1d9d93f2e
raphics/MinikinSkia.cpp
raphics/MinikinUtils.h
raphics/Paint.cpp
1fc0fa87d42ce9268ece76b85b9edc834593e53a 07-Jun-2014 Raph Levien <raph@google.com> Support for fake bold in Minikin builds

Part of the fix for bug 15436379 Fake bold doesn't fully work (Minikin)

This patch queries the Minikin layout for when fake bold is needed,
and applies that to both shaping and drawing paint.

Also simplifies refcounting (the lifetime of all MinikinFont objects
is subsumed by the enclosing FontCollection).

Note: the fake bold flag set by the user is ignored in this patch.

Fake italics would be possible using the same mechanism, but it's
slightly more complicated (fake and user-set textSkewX values would need
to be combined, and the latter restored after drawing).

Change-Id: Ica2c4604846cbb37e5a783778b18d8993c9d4563
raphics/Canvas.cpp
raphics/MinikinSkia.cpp
raphics/MinikinSkia.h
raphics/MinikinUtils.h
raphics/Paint.cpp
raphics/TypefaceImpl.cpp
71f75f1e7be4107c9ffbcb37d816c053d9675367 06-Jun-2014 Raph Levien <raph@google.com> Merge "Fix getFontMetrics problems"
817ef4ae79bd39b5e55fc6ca4e3b8e47e114579f 06-Jun-2014 Raph Levien <raph@google.com> Fix getFontMetrics problems

Fixes a number of individual problems. In Minikin builds, gets base font
from TypefaceImpl rather than using whatever random font was in the
paint. Respects elegant metrics in ascent and descent methods as well as
getFontMetrics. Sets fixed ascent and descent values to 1900, -500,
which matches the Roboto font.

Part of the fix for bug 15467288 "Inconsistent line heights on
Minikin builds"

Change-Id: I12915f4a62de28932469c7279241eecf7320c47b
raphics/Paint.cpp
53be7b79fb174a4b063753f7c8e5388317224087 06-Jun-2014 Florin Malita <fmalita@google.com> Merge "Implement SkCanvasGlue::clipRegion() using clipPath()."
1dc14ba388cc37908c73d75ec31547c9c6f59d4e 05-Jun-2014 Florin Malita <fmalita@google.com> Implement SkCanvasGlue::clipRegion() using clipPath().

(Canvas clipRegion() public API is scheduled for deprecation)

The SkCanvas clip stack does not support clipRegion() ops. Implementing
these in terms of clipPath() makes persisting clips for SaveFlags
emulation purposes a whole lot simpler.

Change-Id: I41d1eb9e292ce370fba224338f9071d5e4068621
raphics/Canvas.cpp
240047694338830521594688de194a1cde2d4537 05-Jun-2014 Raph Levien <raph@google.com> am e0ebf19c: Merge "Support for context in Minikin shaping" into lmp-preview-dev

* commit 'e0ebf19cbfa60ba3eb0891d5e8416b70b212bc36':
Support for context in Minikin shaping
4c25e5a1f9bb24e84d50d97266388408fa878ebd 05-Jun-2014 Raph Levien <raph@google.com> am 79fbad97: Merge "Support for scaleX and skewX in Minikin" into lmp-preview-dev

* commit '79fbad97705d191f80d7af7e494ca4a5fed3a783':
Support for scaleX and skewX in Minikin
0ead890d1c875457e4ca9f9fc0cccd262010cc38 05-Jun-2014 Raph Levien <raph@google.com> Merge "Support for context in Minikin shaping" into lmp-preview-dev
30d3c97f297ed484938992bc669bd0e6b7713d9a 05-Jun-2014 Raph Levien <raph@google.com> Merge "Support for scaleX and skewX in Minikin" into lmp-preview-dev
6bfd7e7df3a9f9ea2f9e57a3552eed7f518be711 04-Jun-2014 Raph Levien <raph@google.com> Support for context in Minikin shaping

This patch uses the Minikin's new doLayout API that supports context,
and has some simple refactoring (pass css as string rather than setting
on the Layout object) to use this api.

Change-Id: I899474f81d377f3106e95ee3eb8d0fcc44c23ac2
raphics/Canvas.cpp
raphics/MinikinUtils.cpp
raphics/MinikinUtils.h
raphics/Paint.cpp
e95b5850ac2e56330abf68362451e7614b3dfe16 31-May-2014 Raph Levien <raph@google.com> Support for scaleX and skewX in Minikin

Passes textScaleX and textSkewX parameters, as well as paint flags from
the paint to Minikin, to support nontrivial scale and stretch of text.
Passing paint flags should minimize kerning artifacts arising from
mismatch of glyph rendering in layout and drawing.

Also, replaces unsafe snprintf to a fixed size buffer with a safe
version, which still avoids an allocation per layout operation.

This is part of the fix for bug 15186705 "Usability of the suggestion
strip in recent OTA's is severely reduced"

Change-Id: I79788383135836f4c21fb84405f36382627bf959
raphics/MinikinSkia.cpp
raphics/MinikinSkia.h
raphics/MinikinUtils.cpp
raphics/MinikinUtils.h
raphics/TypefaceImpl.cpp
8608bbb2077d8db81e29711ad14dcad073480b8c 05-Jun-2014 Raph Levien <raph@google.com> am 626b82f6: Merge "Query style from asset-created font (Minikin)" into lmp-preview-dev

* commit '626b82f63e4d7ea97187bec313b5cb687bb501b7':
Query style from asset-created font (Minikin)
f8423bae17dfb2a73a4f4adb40aaced76d42f0a0 04-Jun-2014 Raph Levien <raph@google.com> am 8fad12dc: Merge "Fix incorrect getStringBounds (Minikin)" into lmp-preview-dev

* commit '8fad12dc66f47af2fd394f44858802d10cf110f1':
Fix incorrect getStringBounds (Minikin)
1633caef58ebd0bc3b0c5da15dde2fb425b77c43 04-Jun-2014 Raph Levien <raph@google.com> Query style from asset-created font (Minikin)

This patch sets fStyle on the TypefaceImpl based on querying the font,
which is important in the Typeface.createFromAsset path. This fixes both
the style returned from getStyle() and also selects fallback fonts to
best match the style of the main font.

Fixes bug 15429916: "Typeface.getStyle always returning 0 in some L
devices".

Change-Id: I1992ba1e65e7f488d331e175f5f12843f67c2faa
raphics/TypefaceImpl.cpp
c5dc0370086a7f1c9a2d0d34321580648a0836ea 04-Jun-2014 Raph Levien <raph@google.com> am aef648f4: Merge "Better Minikin integration" into lmp-preview-dev

* commit 'aef648f405a6f2ed2e523e69cd6f1da884f4b9dd':
Better Minikin integration
676f92e9a77a547b80a3a22bb3d4e4d0d2aa0bed 04-Jun-2014 Florin Malita <fmalita@google.com> Merge "Canvas JNI cleanup."
95d49149cc7fff87a18449fa661454c1b5ddbd30 03-Jun-2014 Florin Malita <fmalita@google.com> Canvas JNI cleanup.

As pointed out in a previous patch review, some native Canvas methods do not
receive a native canvas handle and instead have to use GraphicsJNI to query
the object mNativeCanvasWrapper field.

To avoid the extra JNI call, this change adds the missing Java wrapper
methods and ensures that all native calls are passed efficient native
handles.

Also, some native methods are consolidated: save, saveAll -> save,
clipRect* -> clipRect.

Change-Id: I2eae4a633f6a463d9fbae2ca632661acc8b5cfc3
raphics/Canvas.cpp
a578ab00c41e5ac6cc4b69ff4ba61d2c94c5e47c 04-Jun-2014 Leon Scroggins III <scroggo@google.com> Merge "Ignore inPurgeable and inInputShareable."
854363e3d2fb2a9e41d8719f4a2f0f8b89440a46 04-Jun-2014 Raph Levien <raph@google.com> Fix incorrect getStringBounds (Minikin)

This patch wires up getStringBounds to do the layout with Minikin to get
accurate bounds, and with the correct typeface. It fixes bug 15416575
"getStringBounds gives wrong result in Minikin".

Change-Id: I5c020bc372acb1d785a33c3c296239c151bd8c87
raphics/MinikinUtils.cpp
raphics/MinikinUtils.h
raphics/Paint.cpp
f2114d5646194100242206b267ddd6e7194b7da9 02-Jun-2014 Raph Levien <raph@google.com> Better Minikin integration

This patch improves the Minikin integration in a number of ways,
including:

Software rendering does text decorations and handles alignment
correctly. This fixes bug 15139067 "Centered text isn't working".

Paint implements getTextPath. This fixes bug 15143354 "Text rendering in
Maps Navigation wrong typeface?"

Also a bit of refactoring, since there was duplicated code for iterating
font runs that's now a static method in MinikinUtils.

Change-Id: I4cfdb2c0559982376348325a757d95235fab1768
raphics/Canvas.cpp
raphics/MinikinUtils.cpp
raphics/MinikinUtils.h
raphics/Paint.cpp
raphics/TextLayoutCache.cpp
0aa39dc2dcfca20f4d9cbeb1699d48a4808f2c70 03-Jun-2014 Leon Scroggins III <scroggo@google.com> Ignore inPurgeable and inInputShareable.

These are discouraged anyway, due to the fact that using them may
result in decoding on the UI thread. Now that they are ignored, the
images will still be decoded; they just will never have their
memory purged, meaning there could be a RAM penalty. This is
acceptable, since apps are encouraged to instead use inBitmap to
manage bitmap memory.

This incidentally fixes BUG:15390468 by converting purgeable index8
(e.g. gif) images to non purgeable.

Change-Id: Ieaf3ab25d28d93fb94bdaea1eb3bd762f163b09a
raphics/BitmapFactory.cpp
raphics/Canvas.cpp
690d45157d01088778e4da398c31575be5aa35ce 03-Jun-2014 Raph Levien <raph@google.com> am faa91203: Merge "Support fallbacks for custom typefaces (Minikin)" into lmp-preview-dev

* commit 'faa912037ca4895eb99155a4a53354435ee413c2':
Support fallbacks for custom typefaces (Minikin)
1044046aa9dca4e46656cf2b06230b348e41d8d9 03-Jun-2014 Raph Levien <raph@google.com> am 8e3605e4: Merge "Check for NULL on TypefaceImpl unref" into lmp-preview-dev

* commit '8e3605e4de5a109792acca22c37976ac52ee571e':
Check for NULL on TypefaceImpl unref
596f0b1a03c1d733697f89757bcf3c80b9900c78 03-Jun-2014 Raph Levien <raph@google.com> Merge "Support fallbacks for custom typefaces (Minikin)" into lmp-preview-dev
a0cba0fde3e39723052a50e1f09e3b254da6c175 02-Jun-2014 Raph Levien <raph@google.com> Check for NULL on TypefaceImpl unref

It's possible for a TypefaceImpl to contain a null pointer, which was
causing crashes on unref. This patch just checks for NULL.

Fixes bug 15104801 "Aviate Launcher crashes on startup - Hammerhead L
AAV49B"

Change-Id: Idf9f176c54bf81ff3daacc0b33e95aa9d8bbe57f
raphics/TypefaceImpl.cpp
d573794d83a049fe59e289944f0cd77406dd776a 02-Jun-2014 Raph Levien <raph@google.com> Support fallbacks for custom typefaces (Minikin)

This patch adds the fallback font list to custom typefaces created from
files and assets, as well as those created by name. This is a fix for
the deskclock half of bug 15139067 "Centered text isn't working".

Change-Id: I0cc60951953dfb73817a98ddfee5713f0387ee90
raphics/FontFamily.cpp
raphics/MinikinSkia.h
9ec2eabe5ae9b17064412833ae11b113da453b75 02-Jun-2014 Florin Malita <fmalita@google.com> Merge "Add a native Canvas wrapper."
686534db8d84ce8d838ba90b4fafe3c48ce66e95 30-May-2014 Mike Reed <reed@google.com> switch to non-deprecated SkBlurStyle type

Will allow skia to remove SK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE

Change-Id: I0039dd7e0e807080d2b4f9e648df93123dd09e8d
raphics/MaskFilter.cpp
5c3d927e17e98e8fd4a9f3c86f7f4def0bcfa816 08-May-2014 Florin Malita <fmalita@google.com> Add a native Canvas wrapper.

Instead of storing a direct SkCanvas reference, Canvas now tracks
an opaque native wrapper class. The native wrapper can be used to
store additional info for emulating deprecated Skia features
(at this point it only stores a canvas).

Some notes:

* all native handle -> SkCanvas conversions are routed through a
handful of native utility methods.
* safeCanvasSwap() refactored as a lower level setNativeBitmp() - which
is what clients need.
* removed unused get_thread_msec() (Canvas.cpp)

Change-Id: I715a5a6f1e1621c1cfc1e510ae4f2ea15cf11114
raphics/Camera.cpp
raphics/Canvas.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/NinePatch.cpp
raphics/Picture.cpp
ca672f27581e5a0263d53b7b98551312d54f6efa 30-May-2014 Raph Levien <raph@google.com> am 953fe800: Merge "Language and variant selection for Minikin" into lmp-preview-dev

* commit '953fe800caf1771217ff1e828d6aa93fbc16729c':
Language and variant selection for Minikin
f9e3d311275c37fe5f2562993687a1627780a6d0 28-May-2014 Raph Levien <raph@google.com> Language and variant selection for Minikin

This is the frameworks/base side of what's needed to support language
selection (especially Han unification, but also compact/elegant
selection for scripts that require more vertical space).

This is part of the fix for bug 15179652 "Japanese font isn't shown on
LMP".

Change-Id: I8f0f3aa9a1915659f8d0b590cf1c56529356049a
raphics/FontFamily.cpp
raphics/MinikinUtils.cpp
8f8c08516456944ae7ab15fea641ffb316268381 27-May-2014 Leon Scroggins III <scroggo@google.com> Merge "Remove call to deprecated SkBitmap::asImageInfo."
28408c23958bb14d296574853d8a576177a36a5b 27-May-2014 Leon Scroggins III <scroggo@google.com> Remove call to deprecated SkBitmap::asImageInfo.

Instead, call SkBitmap::info().

Change-Id: Ib6e56c6e103afa5748405574043860449c33c467
raphics/BitmapFactory.cpp
5f6aa983d620eb123cd11943235daa68f725ef46 22-May-2014 Leon Scroggins III <scroggo@google.com> Fix FILTER_BITMAP_FLAG regression in DrawFilter.

Skia removed the corresponding kFilterBitmapFlag, replacing it with a
separate function: setFilterLevel. If the flag is set, turn it into a
call to setFilterLevel.

Corresponds to changes in I2736f3f68683651574d79a169ff0ab563e0a469e to
fix Paint.setFlags().

BUG:15112859
Change-Id: I269cbd7a624e5dde5688305e1ba97075ba73f4fd
raphics/DrawFilter.cpp
0fa2bd699ab5539c0ce6b79eb6b4b681734b8bb5 05-May-2014 Leon Scroggins III <scroggo@google.com> DO NOT MERGE Inspect SkShader to determine hw shader.

cherry-pick of Iaa7189178bda1c55f96da044d2a9fa602ba36034

Instead of duplicating internal info about SkShader, inspect the
SkShader installed on the SkPaint.

core/java/android/view/GLES20Canvas.java:
Remove setupModifiers, nResetModifiers, and nSetupShader.

core/jni/android/graphics/Shader.cpp:
Remove calls to create/destroy the (previously) attached SkiaShader.

core/jni/android_view_GLES20Canvas.cpp:
Remove native code for setupShader and resetModifiers.

graphics/java/android/graphics/BitmapShader.java:
graphics/java/android/graphics/ComposeShader.java:
graphics/java/android/graphics/LinearGradient.java:
graphics/java/android/graphics/RadialGradient.java:
graphics/java/android/graphics/Shader.java:
graphics/java/android/graphics/SweepGradient.java:
Remove code keeping track of native SkiaShader.

libs/hwui/Caches.h:
Include Extensions.h.

libs/hwui/DeferredDisplayList.cpp:
Compare shaders on the paint, instead of on DrawModifiers.

libs/hwui/DisplayList.cpp:
libs/hwui/DisplayList.h:
Remove vector of SkiaShaders.

libs/hwui/DisplayListOp.h:
Access the SkShader on mPaint.
Remove SetupShaderOp and ResetShaderOp.

libs/hwui/DisplayListRenderer.cpp:
libs/hwui/DisplayListRenderer.h:
Remove resetShader, setupShader, refShader, and mShaderMap.

libs/hwui/FontRenderer.cpp:
Pass SkShader to setupDrawShader and setupDrawShaderUniforms.

libs/hwui/OpenGLRenderer.cpp:
libs/hwui/OpenGLRenderer.h:
Add LayerShader, a class inheriting from SkShader, to mimic the
behavior of SkiaLayerShader. Unlike SkiaLayerShader, it can be set on
the SkPaint so it can be inspected later.
Set a LayerShader instead of a SkiaLayerShader.
setupDrawShader and setupDrawShaderUniforms now inspect an SkShader
passed in.
Inspect SkShader instead of mDrawModifiers.mShader.
Remove resetShader and setupShader.
setupDrawColorUniforms now takes a boolean indicating whether there is
a shader.
Add an inline function for accessing the SkShader on an SkPaint.
In setupDrawBlending(Layer*, bool), do not check the shader (which will
never be set), but do check whether the color filter may change the
alpha (newly fixed behavior).
In setupDrawBlending(SkPaint, ...), check the SkShader and whether the
color filter affects alpha (the latter is new behavior).

libs/hwui/Renderer.h:
Remove pure virtual functions setupShader and resetShader.

libs/hwui/ResourceCache.cpp:
libs/hwui/ResourceCache.h:
Remove functions for refing/unrefing shaders.

libs/hwui/SkiaShader.cpp:
libs/hwui/SkiaShader.h:
Much of this code was redundant and has been removed.
Convert structs into class with nothing but static functions for
calling describe/setupProgram.

libs/hwui/TextureCache.cpp:
libs/hwui/TextureCache.h:
Use the SkPixelRef as the key to the bitmap Lru cache, since shader
inspection will provide a different SkBitmap pointer (though it will
hold the correct SkPixelRef with the correct generation ID).

tests/CanvasCompare/src/com/android/test/hwuicompare/DisplayModifier.java:
tests/CanvasCompare/src/com/android/test/hwuicompare/ResourceModifiers.java:
Update manual test to have more shaders: radial, sweep, compose,
invalid compose.

BUG:10650594
Change-Id: I2e7182b3fc28268e7ca82fac6780540b6b45365c
raphics/Shader.cpp
d490aa426090fc358873821b47ef27ead0c97409 23-May-2014 Chris Craik <ccraik@google.com> Merge "Inspect SkShader to determine hw shader."
d1ad5e62fda248c6d185cde3cb6d9f01a223066c 05-May-2014 Leon Scroggins III <scroggo@google.com> Inspect SkShader to determine hw shader.

Instead of duplicating internal info about SkShader, inspect the
SkShader installed on the SkPaint.

core/java/android/view/GLES20Canvas.java:
Remove setupModifiers, nResetModifiers, and nSetupShader.

core/jni/android/graphics/Shader.cpp:
Remove calls to create/destroy the (previously) attached SkiaShader.

core/jni/android_view_GLES20Canvas.cpp:
Remove native code for setupShader and resetModifiers.

graphics/java/android/graphics/BitmapShader.java:
graphics/java/android/graphics/ComposeShader.java:
graphics/java/android/graphics/LinearGradient.java:
graphics/java/android/graphics/RadialGradient.java:
graphics/java/android/graphics/Shader.java:
graphics/java/android/graphics/SweepGradient.java:
Remove code keeping track of native SkiaShader.

libs/hwui/Caches.h:
Include Extensions.h.

libs/hwui/DeferredDisplayList.cpp:
Compare shaders on the paint, instead of on DrawModifiers.

libs/hwui/DisplayList.cpp:
libs/hwui/DisplayList.h:
Remove vector of SkiaShaders.

libs/hwui/DisplayListOp.h:
Access the SkShader on mPaint.
Remove SetupShaderOp and ResetShaderOp.

libs/hwui/DisplayListRenderer.cpp:
libs/hwui/DisplayListRenderer.h:
Remove resetShader, setupShader, refShader, and mShaderMap.

libs/hwui/FontRenderer.cpp:
Pass SkShader to setupDrawShader and setupDrawShaderUniforms.

libs/hwui/OpenGLRenderer.cpp:
libs/hwui/OpenGLRenderer.h:
Add LayerShader, a class inheriting from SkShader, to mimic the
behavior of SkiaLayerShader. Unlike SkiaLayerShader, it can be set on
the SkPaint so it can be inspected later.
Set a LayerShader instead of a SkiaLayerShader.
setupDrawShader and setupDrawShaderUniforms now inspect an SkShader
passed in.
Inspect SkShader instead of mDrawModifiers.mShader.
Remove resetShader and setupShader.
setupDrawColorUniforms now takes a boolean indicating whether there is
a shader.
Add an inline function for accessing the SkShader on an SkPaint.
In setupDrawBlending(Layer*, bool), do not check the shader (which will
never be set), but do check whether the color filter may change the
alpha (newly fixed behavior).
In setupDrawBlending(SkPaint, ...), check the SkShader and whether the
color filter affects alpha (the latter is new behavior).

libs/hwui/Renderer.h:
Remove pure virtual functions setupShader and resetShader.

libs/hwui/ResourceCache.cpp:
libs/hwui/ResourceCache.h:
Remove functions for refing/unrefing shaders.

libs/hwui/SkiaShader.cpp:
libs/hwui/SkiaShader.h:
Much of this code was redundant and has been removed.
Convert structs into class with nothing but static functions for
calling describe/setupProgram.

libs/hwui/TextureCache.cpp:
libs/hwui/TextureCache.h:
Use the SkPixelRef as the key to the bitmap Lru cache, since shader
inspection will provide a different SkBitmap pointer (though it will
hold the correct SkPixelRef with the correct generation ID).

tests/CanvasCompare/src/com/android/test/hwuicompare/DisplayModifier.java:
tests/CanvasCompare/src/com/android/test/hwuicompare/ResourceModifiers.java:
Update manual test to have more shaders: radial, sweep, compose,
invalid compose.

BUG:10650594

Change-Id: Iaa7189178bda1c55f96da044d2a9fa602ba36034
raphics/Shader.cpp
304bbd287c7a18f66f18daaed0d0aae78199bdd9 22-May-2014 Mathieu Chartier <mathieuc@google.com> Temporary fix for buffer overrun issue.

Allocating the bitmap using getSafeSize() causes problems since
getSafeSize64() < getSize() if there is a stride. Since everywhere
else uses getSize() it results in a lot of possible buffer overruns.
The fix reverts to using getSize instead of getSafeSize64.

Bug: 15089814
Change-Id: Ia471cf9715672d57bb7eb61bf735064aeb405ffe
raphics/Graphics.cpp
49f0db34811bc374eb6af0a6ba233325ff6f14cc 20-May-2014 Victoria Lease <violets@google.com> fix argument order in call to SkBlurDrawLooper constructor

This fixes all sorts of badness.

Bug: 15074512
Change-Id: I5e96983c58d19e0dc2d8fa61d1efa9dcff076ca1
raphics/Paint.cpp
b98de0dcd63a7b7987257a879a669c467a396a95 16-May-2014 Raph Levien <raph@google.com> Get rid of dirFlags log spam

I was logging the BiDi flags for debugging, did not mean to commit this.

Change-Id: I0a89c68fe17562f2ed38843efacbaa310dca24fa
raphics/TextLayoutCache.cpp
dbef65f1a170c8abd819a609aeb30797b2407c9a 15-May-2014 Svetoslav <svetoslavganov@google.com> Merge "Adding APIs to render PDF documents."
4c9355c35a0f62805739823a62ad41ca1cbc6502 07-May-2014 Mike Reed <reed@google.com> Frameworks changes to support latest Skia (r14729)

Required for a merge in external/skia
(I88b4d5cc81c357a8e223bd7860b1029590265200).

Includes two cherry-picks:

I456df543e1925b280f785c7b3bb81370157f9b09:
replace SkRasterizer* with NativeRasterizer* in JNI

I98adb200e023369d3ee75f21927fa98f23095a77:
Fix Paint.getFlags,setFlags wrt FILTER_BITMAP_FLAG

In Paint.setFlags(), turn FILTER_BITMAP_FLAG into a call to
SkPaint::setFilterLevel().

In Paint.getFlags(), read SkPaint::getFilterLevel() to determine
whether to include FILTER_BITMAP_FLAG in the result.

Fixes CTS tests with ToT Skia.

Change-Id: I2736f3f68683651574d79a169ff0ab563e0a469e
raphics/GraphicsJNI.h
raphics/LayerRasterizer.cpp
raphics/Paint.cpp
raphics/Rasterizer.cpp
1044a8211d86d4306ee7b075eb2bca9a43f3a492 15-May-2014 Raph Levien <raph@google.com> Merge "BiDi support for Minikin"
9e2b288ba89ad78ba601eef4843831b382a17bd5 15-May-2014 Raph Levien <raph@google.com> Merge "Proper refcounting for Minikin objects"
018646adac62f137fe6b2ad04182cc623a7037e0 15-May-2014 Raph Levien <raph@google.com> Merge "Parsing of XML font configuration files for Minikin"
2836c4722a156ec78d7f4101b394885a354f5dd6 15-May-2014 Raph Levien <raph@google.com> Merge "Start of Minikin integration"
2961769ea94f69c191a2dd785b2504666c7292d0 25-Apr-2014 Svetoslav <svetoslavganov@google.com> Adding APIs to render PDF documents.

We need to render PDF documents for two main use cases. First,
for print preview. Second, for resterizing the PDF document by
a print service before passing it to a printer which does not
natively support PDF (most consumer ones).

Adding PDF rendering APIs improves guarantees for print quality
as the same library is used for preview and rasterization. Also
print vendors do not have to license third-party rendering engines.
Last but not least as the platform uses PDF as its main print
format it should also be able to natively render it.

Change-Id: I57004a435db147663cafea40cf3296465aba7f99
raphics/Matrix.cpp
raphics/pdf/PdfRenderer.cpp
9d9ee3d666c63938311839002ec974673998c6d0 13-May-2014 Raph Levien <raph@google.com> BiDi support for Minikin

This patch plumbs the bidiFlags for the various text drawing and
measurement functions down to Minikin, so that the latter can do layout
in a BiDi-aware manner. With the corresponding changes to Minikin, it
is sufficient to correctly display RTL text in TextViews.

Change-Id: Ie904f297373b9ad418050a474506605c7c127b0f
raphics/Canvas.cpp
raphics/MinikinSkia.cpp
raphics/MinikinUtils.cpp
raphics/MinikinUtils.h
raphics/Paint.cpp
raphics/TextLayoutCache.cpp
15cf4757dc0099301662f8a26da561434cc07cfa 06-May-2014 Raph Levien <raph@google.com> Proper refcounting for Minikin objects

This patch introduces proper lifecycle maintenance (based on reference
counting) for Minkin objects, particularly FontFamily and
FontCollection. The patch depends on the corresponding Ref and Unref
methods being available in Minikin.

Change-Id: I91935e953d5a522e1adc496f2ce3a598be35de2b
raphics/FontFamily.cpp
raphics/TypefaceImpl.cpp
9a5b61ccc83303ceeec2059f58c1977af9faa9e3 30-Apr-2014 Raph Levien <raph@google.com> Parsing of XML font configuration files for Minikin

This patch improves Minikin-based font handling, to deal with error
conditions (missing fonts and so on), and also moves the parsing of
fallback_fonts.xml and system_fonts.xml into Java code.

Change-Id: Ib0debdbd56ad3b0196be6d2a35668d711c98f1e5
raphics/FontFamily.cpp
raphics/Typeface.cpp
raphics/TypefaceImpl.cpp
raphics/TypefaceImpl.h
1a73f732f91e97c9c66b808c245ddda36a10e987 31-Jan-2014 Raph Levien <raph@google.com> Start of Minikin integration

This is the current state of the Minikin integration. All changes are
hidden behind USE_MINIKIN #ifdef, so it should be safe to apply. To
play with the Minikin branch, set this in your BoardConfig.mk .

This change also merges in 64-bit changes that were happenening in
parallel.

Change-Id: Idd94553bcbe324c5875d0ff06495c966c3e95b7f
raphics/Canvas.cpp
raphics/FontFamily.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/MinikinSkia.cpp
raphics/MinikinSkia.h
raphics/MinikinUtils.cpp
raphics/MinikinUtils.h
raphics/Paint.cpp
raphics/Typeface.cpp
raphics/TypefaceImpl.cpp
raphics/TypefaceImpl.h
c42bfb95c6b7166b7916057af9df6e20d8c4c8ef 10-May-2014 John Reck <jreck@google.com> Merge "Refactor VirtualLightRefBase & JNI"
9fa4071c4768c63902c6a74a4b480b51a8b95d43 10-May-2014 John Reck <jreck@google.com> Refactor VirtualLightRefBase & JNI

Change-Id: I8e244e7109e59d5be96871b23bb9b1201c7f9eaa
raphics/CanvasProperty.cpp
32054b0b3edb350a5444c47753b2982312dd7ffd 09-May-2014 Chris Craik <ccraik@google.com> Fix Bitmap.cpp line endings

Change-Id: Icc0b067437fffaa599c92841518ad0d526112f59
raphics/Bitmap.cpp
5b554f010358d8f47e31d92a42aa3edc4a71ec47 08-May-2014 Derek Sollenberger <djsollen@google.com> Merge "Avoid caching shadow properties in Java & HWUI."
c29a0a4664a4b9871fadd668b632469a0db240b9 31-Mar-2014 Derek Sollenberger <djsollen@google.com> Avoid caching shadow properties in Java & HWUI.

bug: 10650594
Change-Id: I6f57df002710bb0567ed7e53fc0bfe96cfd504b8
raphics/Paint.cpp
c7282e57cd01f1576baac04356bf99bee34e4c18 07-May-2014 Jeff Brown <jeffbrown@google.com> Fix crash due to texture view callback threading invariants.

Allow the client of a SurfaceTexture to specify the Handler to
which the update callback should be directed to avoid unnecessary
scheduling ping-pong between threads.

Fixed an invalid assumption in TextureView that it is attached
to the main looper which could result in a crash under certain
circumstances. In normal app processes, it is true that TextureViews
must be created on the main looper since hardware rendering is
currently only supported on the main looper. However, in the
system server, UI components run a different thread. Although
hardware rendering is normally disabled in the system server,
it may be enabled for certain developer features.

Bug: 14445309
Change-Id: I5ae17ad018b9ef05ba87ec2f972c7c82e2bca70a
raphics/SurfaceTexture.cpp
52244fff29042926e21fa897ef5ab11148e35299 02-May-2014 John Reck <jreck@google.com> Add CanvasProperty for drawCircle

Change-Id: Icbcc030f5033d2094e567d7c519b9d672f2aac1c
raphics/CanvasProperty.cpp
fae7bedcf0a782ed7085d34b7a6d913169614aa6 01-May-2014 Elliott Hughes <enh@google.com> am f84493ec: am 91ff3c18: am 7d3f9e97: Merge "Fix for native leaks in YuvToJpegEncoder.cpp"

* commit 'f84493ec95bfce41106673645a3e56b185e54df5':
Fix for native leaks in YuvToJpegEncoder.cpp
91ff3c18dbb61ed0087f741dd2bdf911ecf42fef 30-Apr-2014 Elliott Hughes <enh@google.com> am 7d3f9e97: Merge "Fix for native leaks in YuvToJpegEncoder.cpp"

* commit '7d3f9e9730b100de4c0e643e13bf59bf54ef7819':
Fix for native leaks in YuvToJpegEncoder.cpp
7d3f9e9730b100de4c0e643e13bf59bf54ef7819 30-Apr-2014 Elliott Hughes <enh@google.com> Merge "Fix for native leaks in YuvToJpegEncoder.cpp"
293513a59d36cd96a3e474dde5981380d372d8c9 30-Apr-2014 Bill Yi <byi@google.com> Merge commit '0b62467b142b61ee1e449ba958ba37dfd961ef56' into HEAD
7979388d4f7d5d9dbfcf7e1cc4709f8088c034ae 25-Apr-2014 Chris Craik <ccraik@google.com> Support Oval GradientDrawable outlines, and ShapeDrawable

Change-Id: Ifc9e55757d3325cb28a1a812ec696512d4a18b39
raphics/Path.cpp
4d1c1538e2422d0a5b19ad1cd2fb353ed6279a88 24-Apr-2014 Chris Craik <ccraik@google.com> Add floats-only drawRoundRect to Canvas

Change-Id: Ib0033a2d2486a808a44984ec4adf7fef76d9ea17
raphics/Canvas.cpp
0613657426aecb7ed6141c133f100baf24166ae0 17-Apr-2014 Raph Levien <raph@google.com> Merge changes Ia693f512,If3b7d41f

* changes:
Enable elegant text metrics in Quantum theme
Add elegantTextHeight text appearance attribute
53c0077256afebb0312f01ef4f60a7445da1f5d9 14-Apr-2014 Raph Levien <raph@google.com> Add elegantTextHeight text appearance attribute

This patch adds an elegantTextHeight text appearance attribute and
plumbs it through to the paint. This attribute selects the elegant
variant of fonts (when appropriate, which is typically Arabic and indic
scripts), and also specifies larger vertical metrics, to avoid clipping.

The intent is for this to be the default for quantum themes, but this
patch doesn't change any default behavior, just adds the attribute.

The larger vertical metrics are applied to top and bottom, but should
not affect line spacing in the common case. Also, with the setting,
metrics are no longer dependent on the font, so setting a custom font
will preserve layout and spacing.

Change-Id: If3b7d41f141deff50ca078f479ca90c2aa07829a
raphics/Paint.cpp
5932b0d8fc313f9e4f2c8e5c431ac0e270f9f259 17-Apr-2014 Skia_Android Canary Bot <31977622648@project.gserviceaccount.com> Call SkShader::isOpaque() to determine opaqueness.

It is invalid to call SkShader::getFlags() before calling
SkShader::setContext() - it will always return 0. Instead, call
SkShader::isOpaque().

Change-Id: If35108dc7f0eca55d2ec8466b8a50fd54dfb13a2
raphics/Shader.cpp
2e0103eb340822f9d580c1aa8492bae8394b8243 04-Apr-2014 Leon Scroggins III <scroggo@google.com> Remove SkFloatToScalar.

Now that SkScalar is always float (it may someday be double, but
float to double is trivial), remove callers of SkFloatToScalar,
which is deprecated in Skia.

BUG:13694396

Change-Id: I524a9bb6f7702bc810bac55fb9d2cd5361a01cf7
raphics/Camera.cpp
raphics/Canvas.cpp
raphics/Graphics.cpp
raphics/Interpolator.cpp
raphics/LayerRasterizer.cpp
raphics/MaskFilter.cpp
raphics/Matrix.cpp
raphics/Movie.cpp
raphics/NinePatch.cpp
raphics/Paint.cpp
raphics/Path.cpp
raphics/PathEffect.cpp
raphics/PathMeasure.cpp
raphics/Shader.cpp
raphics/TextLayout.cpp
cc11f15f76a62ded3e403cb2bc818c6aa5bf261c 31-Mar-2014 Leon Scroggins <scroggo@google.com> Update to call new Skia APIs.

I816129d49c0118453222916f3c818eccac33663d merges a new version of
Skia that updates various APIs. Call the new ones.

SkBitmap::copyTo now takes an SkColorType instead of an
SkBitmap::Config, so do the conversion with
SkBitmapConfigToColorType or use the enum when it makes sense.

Call SkImageDecoder::decodeSubset instead of (deprecated)
SkImageDecoder::decodeRegion.

Override SkCanvas::ClipVisitor::clipRRect in ClipCopier.

In Canvas::clip calls, call SkCanvas::isClipEmpty(), which was
previously called inside the clip call, to determine the return value.

For various SkPaint effects, call the new factories (as the constructors
have been made protected).

Implement SkJavaOutputStream::bytesWritten(), overriding a new pure
virtual function on SkWStream.

Update Matrix calls to always return true (since SkMatrix calls no
longer return a value).

Depends on I816129d49c0118453222916f3c818eccac33663d (skia).

Change-Id: I5cdcea827ebff587df0bbddc0965e3e0fbf48002
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/BitmapRegionDecoder.cpp
raphics/Canvas.cpp
raphics/ColorFilter.cpp
raphics/CreateJavaOutputStreamAdaptor.cpp
raphics/MaskFilter.cpp
raphics/Matrix.cpp
raphics/PathEffect.cpp
raphics/Xfermode.cpp
4a857b1d471a51ed5dc0ad27fb2ab62ab78822e0 27-Mar-2014 Leon Scroggins <scroggo@google.com> Merge "Update framework to use M34 version of Skia."
ecd072161ec57ba8dfb26659511c0f6605601560 27-Mar-2014 Narayan Kamath <narayan@google.com> resolved conflicts for merge of 22d07464 to master

Change-Id: Ic037261eedd6e224938c960d2b4597590c81ed9d
46cb9bdbf56b27cbf2ab878b41d21e30896a4fea 06-Mar-2014 Leon Scroggins <scroggo@google.com> Update framework to use M34 version of Skia.

These changes are needed due to changes in the Skia API.

Depends on https://googleplex-android-review.git.corp.google.com/#/c/439626/1
(Ic3cf846b74d6f10ec30c477b50fd774cc30ad52c)

BitmapFactory.cpp:
Use SkColorType instead of SkBitmap::Config, where possible.
Call SkBitmap::info() instead of deprecated SkBitmap::asImageInfo().
Remove calls to deprecated SkBitmap::getSize64().

Canvas.cpp:
ColorFilter.cpp:
Matrix.cpp
Remove the deprecated SK_SCALAR_IS_FIXED path. Leave in an else case for
SK_SCALAR_IS_FLOAT, to allow for eventual SK_SCALAR_IS_DOUBLE path.

Graphics.cpp:
Like in BitmapFactory.cpp, use new methods for determining the size of
pixels.

Paint.cpp:
Use more precise SkScalar_ToInt versions of macros.

TextLayoutCache.cpp:
Fix bug in macro definition for HB_SurrogateToUcs4.
Use the new name for SkCreateTypefaceForScriptNG.

android_view_SurfaceControl.cpp:
Replace ScreenshotPixelRef with a Skia pixel ref.

This is a merge from master-skia branch:
https://googleplex-android-review.git.corp.google.com/#/c/430554/
(Ie11503bcefd3883c466279fde5ce147c8a72b452)

Change-Id: Idf15746f93dabeb7862ac02cc6bd925f0dcc68ba
raphics/BitmapFactory.cpp
raphics/Canvas.cpp
raphics/ColorFilter.cpp
raphics/Graphics.cpp
raphics/Matrix.cpp
raphics/Paint.cpp
raphics/TextLayoutCache.cpp
22d074643ed0d010ebfdb0fca685d65eb2632e58 27-Mar-2014 Narayan Kamath <narayan@google.com> resolved conflicts for merge of eaab4df0 to klp-modular-dev-plus-aosp

Change-Id: I871431e5a3ce45a33563ced845e044d37471689b
f5df700e6ce056ebfa322314d970e52d6facc35a 25-Mar-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Make frameworks/base code more portable

Changes in this patch include

[x] Use %zu for size_t, %zd for ssize_t

[x] Some minor changes have been done to conform with
standard JNI practice (e.g. use of jint instead of int
in JNI function prototypes)

Change-Id: Id1aaa7894a7d0b85ac7ecd7b2bfd8cc40374261f
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
raphics/TextLayoutCache.cpp
163b865564fdb4d491c54ee04efb17af80a18689 25-Mar-2014 Narayan Kamath <narayan@google.com> am ea96d791: am 5f0d44f6: Merge "Fix scaleNinePatch."

* commit 'ea96d791c7eca3eb5d003b8559b89a573f81dac9':
Fix scaleNinePatch.
ab9efda69fb0a604fa83f08cb33ce634ca056ef4 25-Mar-2014 Narayan Kamath <narayan@google.com> am ea96d791: am 5f0d44f6: Merge "Fix scaleNinePatch."

* commit 'ea96d791c7eca3eb5d003b8559b89a573f81dac9':
Fix scaleNinePatch.
02eb6bfd66d0afc4b1d81824558e136649a5a4df 11-Mar-2014 Narayan Kamath <narayan@google.com> Fix scaleNinePatch.

Use yDivs for yDivs, and not xDivs.

bug: 13394494

(cherry picked from commit 42a51ae8812bccde7ff370cc2688f7955e489ad4)

Change-Id: Ia0a7d701a170945216ab247a483e7f972b6fe17e
raphics/BitmapFactory.cpp
1e0ae4fa4b23edd5e3015d23845f2aa9050a0435 20-Mar-2014 Victoria Lease <violets@google.com> am ca58036d: am cfd46dc4: am 610d401c: am e9c7fd2f: am 55371beb: am 754bf6ab: am c8868db2: am 737d3e5d: am 6b96ecca: am 32753f4f: am 31912122: am 6eb28103: am 183f97b7: am 1c12f9e7: malloc some advances

* commit 'ca58036dd8018bec81fc5ab9d0376cd35b363125':
malloc some advances
3486659584176d81dc6dfa5ad1cd63f1d15306b4 20-Mar-2014 Victoria Lease <violets@google.com> am cfd46dc4: am 610d401c: am e9c7fd2f: am 55371beb: am 754bf6ab: am c8868db2: am 737d3e5d: am 6b96ecca: am 32753f4f: am 31912122: am 6eb28103: am 183f97b7: am 1c12f9e7: malloc some advances

* commit 'cfd46dc4847d5ef1ed14484717cf857ae5f67cae':
malloc some advances
ca58036dd8018bec81fc5ab9d0376cd35b363125 19-Mar-2014 Victoria Lease <violets@google.com> am cfd46dc4: am 610d401c: am e9c7fd2f: am 55371beb: am 754bf6ab: am c8868db2: am 737d3e5d: am 6b96ecca: am 32753f4f: am 31912122: am 6eb28103: am 183f97b7: am 1c12f9e7: malloc some advances

* commit 'cfd46dc4847d5ef1ed14484717cf857ae5f67cae':
malloc some advances
610d401cb580ee233c008acf8fc076047a0ffdb4 19-Mar-2014 Victoria Lease <violets@google.com> am e9c7fd2f: am 55371beb: am 754bf6ab: am c8868db2: am 737d3e5d: am 6b96ecca: am 32753f4f: am 31912122: am 6eb28103: am 183f97b7: am 1c12f9e7: malloc some advances

* commit 'e9c7fd2f2ee7840c61dc66ead3737e437f4e8c10':
malloc some advances
754bf6abc0f5a5a26eda4081ce01b1f013a0e1e2 19-Mar-2014 Victoria Lease <violets@google.com> am c8868db2: am 737d3e5d: am 6b96ecca: am 32753f4f: am 31912122: am 6eb28103: am 183f97b7: am 1c12f9e7: malloc some advances

* commit 'c8868db2a025a97e439f8a9adde565c9c83f2204':
malloc some advances
6eb2810318262ff36014c52384ed3cdea19bd34e 19-Mar-2014 Victoria Lease <violets@google.com> am 183f97b7: am 1c12f9e7: malloc some advances

* commit '183f97b72faf7a0f45ad66e1b3fd9a4343cc7482':
malloc some advances
183f97b72faf7a0f45ad66e1b3fd9a4343cc7482 19-Mar-2014 Victoria Lease <violets@google.com> am 1c12f9e7: malloc some advances

* commit '1c12f9e76298c757423155ad812890d27effafe8':
malloc some advances
72191f3dc186e7dbe36096fdadad6845c735f8a8 18-Mar-2014 Dan Stoza <stoza@google.com> Merge "Remove deprecated BufferQueue constructor"
1c12f9e76298c757423155ad812890d27effafe8 18-Mar-2014 Victoria Lease <violets@google.com> malloc some advances

Bug: 13506939
Change-Id: I87ad616960c4f16bc55d8b906049dbd4f001d6a5
(cherry picked from commit 3af2a37e057b31617b8f4eeb22ac3ef85c3fd5aa)
raphics/Paint.cpp
5b3dad0804a54b71ace9920f9f5edab53041af15 18-Mar-2014 Narayan Kamath <narayan@google.com> am 6cf9aa2e: am b4b431b0: am d2133079: am 7c0dfed5: Merge "Pass int32_t for JNI calls to java Input/Output streams."

* commit '6cf9aa2e5cb0e65ecda9617304af19c827404e1a':
Pass int32_t for JNI calls to java Input/Output streams.
b4b431b0d2f6d57afe80c4119e5f41e4fb72e7d9 18-Mar-2014 Narayan Kamath <narayan@google.com> am d2133079: am 7c0dfed5: Merge "Pass int32_t for JNI calls to java Input/Output streams."

* commit 'd2133079c085cb0879facc8ee72678524d22571a':
Pass int32_t for JNI calls to java Input/Output streams.
ddcaf0d1786bfed32b9ea6d583701a91a7d5893a 18-Mar-2014 Narayan Kamath <narayan@google.com> am d2133079: am 7c0dfed5: Merge "Pass int32_t for JNI calls to java Input/Output streams."

* commit 'd2133079c085cb0879facc8ee72678524d22571a':
Pass int32_t for JNI calls to java Input/Output streams.
3af2a37e057b31617b8f4eeb22ac3ef85c3fd5aa 18-Mar-2014 Victoria Lease <violets@google.com> malloc some advances

Bug: 13506939
Change-Id: I87ad616960c4f16bc55d8b906049dbd4f001d6a5
raphics/Paint.cpp
f096ed68e1ee5810f436ca820c1eada4b1a182a5 17-Mar-2014 Leon Scroggins III <scroggo@google.com> am 2fd045c0: DO NOT MERGE - merge nativeDecodeFileDescriptor fixes into KLP-MR2 BUG:13191516

* commit '2fd045c092b08772be81a6d58bbb95e5e608403f':
DO NOT MERGE - merge nativeDecodeFileDescriptor fixes into KLP-MR2 BUG:13191516
96978ee290ea0ef666c49ffa8733a8c74304c9f1 17-Mar-2014 Leon Scroggins III <scroggo@google.com> am f8d8777d: Update framework to use M33 Skia. DO NOT MERGE

* commit 'f8d8777dddf91c741981b4f795f2fb2b1d81c1b6':
Update framework to use M33 Skia. DO NOT MERGE
2fd045c092b08772be81a6d58bbb95e5e608403f 14-Jan-2014 Leon Scroggins III <scroggo@google.com> DO NOT MERGE - merge nativeDecodeFileDescriptor fixes into KLP-MR2
BUG:13191516

Original CLs below:

In nativeDecodeFileDescriptor, use fdopen.

Instead of attempting to mmap the entire file, create an
SkFILEStream from a FILE.

BUG:11669944
BUG:11028218
Cherry-pick from: If67da91484acc79f9f3dde6d05201409c0c75e41

-------------------------------------------------------------------------

Decode file descriptor from the correct offset.

Fix a few bugs in nativeDecodeFileDescriptor:
1. Restore the FD's offset when exiting the function.
2. Copy the data when potentially using an SkImageRef.
The old behavior would have continued to modify the
file descriptor's offset each time a new decode was
required. The copy ensures that the file descriptor
remains unchanged.
3. Buffer the file stream.
Prior to this change, if the image was not a PNG,
the stream would be rewound to the beginning of the
file, even if the file descriptor was passed in with
an offset. Thanks to the buffer, the stream is only
rewound to the original offset.

Depends on https://googleplex-android-review.googlesource.com/#/c/415821/1
in external/skia

BUG:12807677
BUG:12895876
Cherry-pick from: I38b8cf5d210dbbc0107e6562e3884867de57fc4b
raphics/BitmapFactory.cpp
f8d8777dddf91c741981b4f795f2fb2b1d81c1b6 03-Dec-2013 Leon Scroggins III <scroggo@google.com> Update framework to use M33 Skia. DO NOT MERGE

(These CLs are already in master.)

Bug: 13246311

This cherry-picks 7 CLs:

-----------------------------------------------------------------------

Remove calls to deprecated SkBitmap::setIsOpaque()

setIsOpaque() has been removed from ToT Skia.

Update setters for mIsPremultiplied and hasAlpha to take the
other into consideration.

cherry-pick from: I1b36b0b0ce7126031eb7b769b563c17dcd4b306a

-----------------------------------------------------------------------

Merge AssetStream with AssetStreamAdaptor.

Add enums to the constructor for AssetStreamAdaptor to choose the
different behaviors used by the (former) two different classes.

The old clients of AssetStream now get the following features of
AssetStreamAdaptor
- Debugging statements on error.
- The stream is an SkStreamRewindable.
- getLength() returns the correct value, and the old way of getting
the length (read(NULL, 0)) is no longer implemented, since it is
no longer used.
- isAtEnd() returns the correct value. ToT Skia makes it pure virtual,
so some implementation is necessary.

cherry-pick from: I2a5395914e4f53830aaefee396556459083a1c56

-----------------------------------------------------------------------

Deprecate Android-specific SkPaint functions.

The following functions were problematic:
const SkGlyph& getUnicharMetrics(SkUnichar, const SkMatrix*);
const SkGlyph& getGlyphMetrics(uint16_t, const SkMatrix*);
const void* findImage(const SkGlyph&, const SkMatrix*);

Replacing them with calls through SkGlyphCache solved a nasty crash
bug, so they have all been deprecated.

Bug: 11968757
cherry-pick from: Id746315d41aec5b211b78b172a883c2061130f08

-----------------------------------------------------------------------

pass SkGlyphCache into updateGlyphCache()

Doing so prevents us from double-locking the glyph cache, thereby
effectively locking ourselves out of reusing work that we'd just done.

Bug: 11968757
cherry-pick from: I5c552f2d0bbe30af2ce9054ba684e7da756a0d89

-----------------------------------------------------------------------

Updates to the Skia API needed to merge the WebView m33 version of Skia.

cherry-pick from: I0f63b53f2aae58871413b132742fc84138f069a3

Bugfix for screenshots (recent apps) due to incorrect rowBytes computation

bug: 12915192
cherry-pick from: I4d5fe2a2f75baf66099e0970fb646686a1992714

-----------------------------------------------------------------------

Fix bug in AndroidPixelRef where we did not store the correct imageInfo for a recycled bitmap.

cherry-pick from: I882483b78886e2f19fa4e43a86e69f5a82b3b7e5

-----------------------------------------------------------------------

Change-Id: Ie2b731a9f0795802418cfecddb4b684c92c64d33

Conflicts:
core/jni/android/graphics/Bitmap.cpp
core/jni/android/graphics/Graphics.cpp
core/jni/android/graphics/Typeface.cpp
graphics/java/android/graphics/Bitmap.java
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/BitmapRegionDecoder.cpp
raphics/Canvas.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/Movie.cpp
raphics/NinePatchPeeker.cpp
raphics/Paint.cpp
raphics/Region.cpp
raphics/TextLayoutCache.cpp
raphics/Typeface.cpp
raphics/Utils.cpp
raphics/Utils.h
pengl/util.cpp
2bb39d7a43fdb28ecdafd65ea4b89dc05c1ad7be 05-Mar-2014 Ashok Bhat <ashok.bhat@arm.com> Pass int32_t for JNI calls to java Input/Output streams.

Passing size_t is problematic on 64 bit platforms where
it's 8 bytes in size. Conversion to int32_t is safe because
the size argument is always clamped to fCapacity, which is
4 bytes wide.

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Change-Id: I58558561a4f56451485f1a5fc6cdeda677247071
raphics/CreateJavaOutputStreamAdaptor.cpp
0dc146be5a6cd0c33910d5b18885df46873a93cb 12-Mar-2014 Dan Stoza <stoza@google.com> Remove deprecated BufferQueue constructor

Bug: 13415624
Change-Id: Ib9788bca98fca22e0e4d81756d4aa3b29d5d5af2
raphics/SurfaceTexture.cpp
a742ca4017c93c18c421af20651494624469ed78 11-Mar-2014 Narayan Kamath <narayan@google.com> am bbf82665: am 6e2fb587: Merge "LP64: Make 9 patches architecture agnostic."

* commit 'bbf826659e8e5d0be683b2459207c495303d53b6':
LP64: Make 9 patches architecture agnostic.
42a51ae8812bccde7ff370cc2688f7955e489ad4 11-Mar-2014 Narayan Kamath <narayan@google.com> Fix scaleNinePatch.

Use yDivs for yDivs, and not xDivs.

bug: 13394494
Change-Id: I4ca5fe33cf61922a894f071927ef08b2d7db7dd0
raphics/BitmapFactory.cpp
b5c4e7fd3866bbe30d7ea4d7bc463da5a70970e2 10-Mar-2014 Narayan Kamath <narayan@google.com> resolved conflicts for merge of 92860a74 to master

Change-Id: I3036ef9f1251c756092dc5ee2c4fed8146855e1e
6381dd4ff212a95be30d2b445d40ff419ab076b4 03-Mar-2014 Narayan Kamath <narayan@google.com> LP64: Make 9 patches architecture agnostic.

The Res_png_9patch struct had several pointer members
whose size differed between 32 and 64 bit platforms.

These members have been replaced by uint32_t offsets
to serialized data. The serialized form for 9patches
places a Res_png_9patch object at the beginning of
serialized data, followed by int32_t arrays of xDivs,
yDivs and colors.

Note that these offsets are not strictly required,
since they can be computed from the values of numXDivs,
numYDivs & numColors, however they are called in tight
loops so having them computed once is a beneficial.

This change also removed the unused patch_equals function
from aapt's Image.cpp.

Change-Id: I3b9ac8ae5c05510d41377cae4dff1c69b40c2531
raphics/BitmapFactory.cpp
raphics/NinePatchImpl.cpp
raphics/NinePatchPeeker.cpp
raphics/NinePatchPeeker.h
b2235d5db74e26d6f3695eac672096d2cf430ade 07-Mar-2014 Narayan Kamath <narayan@google.com> am fca204a4: am 05cebdc2: Merge "Fix several bad function definitions."

* commit 'fca204a4b8771b800383c91465a48eb2cd8b3ba2':
Fix several bad function definitions.
5eea60a0ef9dd6bea7a4554ac67b52d333e3ef46 07-Mar-2014 Leon Scroggins III <scroggo@google.com> am 74ca3fd3: am bc57651f: Merge "DO NOT MERGE - merge nativeDecodeFileDescriptor fixes into KLP-MR2 BUG:13191516" into klp-dev

* commit '74ca3fd34dac9674f61313594e2863ffecd79c7a':
DO NOT MERGE - merge nativeDecodeFileDescriptor fixes into KLP-MR2 BUG:13191516
42ae4cf2ce5ba02c2211813452badc07eab33735 07-Mar-2014 Leon Scroggins III <scroggo@google.com> Merge "resolved conflicts for merge of 8d3281f5 to klp-dev-plus-aosp" into klp-dev-plus-aosp
278250dafb5ebb0f9b66c46b32e7dd1251cdb6ff 14-Jan-2014 Leon Scroggins III <scroggo@google.com> DO NOT MERGE - merge nativeDecodeFileDescriptor fixes into KLP-MR2
BUG:13191516

Original CLs below:

In nativeDecodeFileDescriptor, use fdopen.

Instead of attempting to mmap the entire file, create an
SkFILEStream from a FILE.

BUG:11669944
BUG:11028218
Cherry-pick from: If67da91484acc79f9f3dde6d05201409c0c75e41

-------------------------------------------------------------------------

Decode file descriptor from the correct offset.

Fix a few bugs in nativeDecodeFileDescriptor:
1. Restore the FD's offset when exiting the function.
2. Copy the data when potentially using an SkImageRef.
The old behavior would have continued to modify the
file descriptor's offset each time a new decode was
required. The copy ensures that the file descriptor
remains unchanged.
3. Buffer the file stream.
Prior to this change, if the image was not a PNG,
the stream would be rewound to the beginning of the
file, even if the file descriptor was passed in with
an offset. Thanks to the buffer, the stream is only
rewound to the original offset.

Depends on https://googleplex-android-review.googlesource.com/#/c/415821/1
in external/skia

BUG:12807677
BUG:12895876
Cherry-pick from: I38b8cf5d210dbbc0107e6562e3884867de57fc4b
raphics/BitmapFactory.cpp
e648c19bf33ce78b3f67b7ffd95c92fd6996c418 07-Mar-2014 Leon Scroggins III <scroggo@google.com> resolved conflicts for merge of 8d3281f5 to klp-dev-plus-aosp

Change-Id: If2855ff4f7a1e7645c69af378955868f44187376
5e49b497ae2019586937aae0e8159292363728b5 03-Dec-2013 Leon Scroggins III <scroggo@google.com> Update framework to use M33 Skia. DO NOT MERGE

(These CLs are already in master.)

Bug: 13246311

This cherry-picks 7 CLs:

-----------------------------------------------------------------------

Remove calls to deprecated SkBitmap::setIsOpaque()

setIsOpaque() has been removed from ToT Skia.

Update setters for mIsPremultiplied and hasAlpha to take the
other into consideration.

cherry-pick from: I1b36b0b0ce7126031eb7b769b563c17dcd4b306a

-----------------------------------------------------------------------

Merge AssetStream with AssetStreamAdaptor.

Add enums to the constructor for AssetStreamAdaptor to choose the
different behaviors used by the (former) two different classes.

The old clients of AssetStream now get the following features of
AssetStreamAdaptor
- Debugging statements on error.
- The stream is an SkStreamRewindable.
- getLength() returns the correct value, and the old way of getting
the length (read(NULL, 0)) is no longer implemented, since it is
no longer used.
- isAtEnd() returns the correct value. ToT Skia makes it pure virtual,
so some implementation is necessary.

cherry-pick from: I2a5395914e4f53830aaefee396556459083a1c56

-----------------------------------------------------------------------

Deprecate Android-specific SkPaint functions.

The following functions were problematic:
const SkGlyph& getUnicharMetrics(SkUnichar, const SkMatrix*);
const SkGlyph& getGlyphMetrics(uint16_t, const SkMatrix*);
const void* findImage(const SkGlyph&, const SkMatrix*);

Replacing them with calls through SkGlyphCache solved a nasty crash
bug, so they have all been deprecated.

Bug: 11968757
cherry-pick from: Id746315d41aec5b211b78b172a883c2061130f08

-----------------------------------------------------------------------

pass SkGlyphCache into updateGlyphCache()

Doing so prevents us from double-locking the glyph cache, thereby
effectively locking ourselves out of reusing work that we'd just done.

Bug: 11968757
cherry-pick from: I5c552f2d0bbe30af2ce9054ba684e7da756a0d89

-----------------------------------------------------------------------

Updates to the Skia API needed to merge the WebView m33 version of Skia.

cherry-pick from: I0f63b53f2aae58871413b132742fc84138f069a3

Bugfix for screenshots (recent apps) due to incorrect rowBytes computation

bug: 12915192
cherry-pick from: I4d5fe2a2f75baf66099e0970fb646686a1992714

-----------------------------------------------------------------------

Fix bug in AndroidPixelRef where we did not store the correct imageInfo for a recycled bitmap.

cherry-pick from: I882483b78886e2f19fa4e43a86e69f5a82b3b7e5

-----------------------------------------------------------------------

Change-Id: Ie2b731a9f0795802418cfecddb4b684c92c64d33
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/BitmapRegionDecoder.cpp
raphics/Canvas.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/Movie.cpp
raphics/NinePatchPeeker.cpp
raphics/Paint.cpp
raphics/Region.cpp
raphics/TextLayoutCache.cpp
raphics/Typeface.cpp
raphics/Utils.cpp
raphics/Utils.h
pengl/util.cpp
5be83edd15e11420287cc0af93a95d5a6dfae68f 04-Mar-2014 Chris Craik <ccraik@google.com> Add Path.isConvex, and force View outlines to be convex

Change-Id: Idf3f1ee44240d77f7a7ddd0da898da8aa5d41864
raphics/Path.cpp
adbd2ba1bcc222ce47e24d0db180bb85eefae371 28-Feb-2014 Chris Craik <ccraik@google.com> Call correct MaskFilter factory method

Change-Id: Ibc30361427cc484443579930f729145ef19c6916
raphics/MaskFilter.cpp
67862524056ee2e73a94395139bb8bd0ec1ef38a 28-Feb-2014 Chris Craik <ccraik@google.com> Fix use of Skia deprecated methods

Change-Id: Ib89c20fc94bcce29b7490d6f55c73492735befda
raphics/MaskFilter.cpp
raphics/Shader.cpp
eece0dda56ae29fff6e9003df97594f6ac50b6e2 27-Feb-2014 Derek Sollenberger <djsollen@google.com> Fix includes so that they no longer rely on the global Skia includes directories.

bug:13225538
Change-Id: Ia5d816dc665f81c7985f21036af4fd0a63c560cf
raphics/Path.cpp
pengl/util.cpp
b644a3b84521e2155a5af985a4d4ed305474e567 17-Jan-2014 Derek Sollenberger <djsollen@google.com> Updates to the Skia API needed to merge the WebView m33 version of Skia.

This is a cherry-pick of 2 CLs:

21969a2b26945da3fd86aef7c93479e4fb359a65
c7a581cf7691db5c61e6694aa51daaa994004bd9

Change-Id: I6fd9366fbba0a336de1df794be9497983bfd13ae
raphics/BitmapFactory.cpp
raphics/Canvas.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/Paint.cpp
raphics/Region.cpp
2d5cf4f6db75d00285306b2d53bc6c0c6532d86e 20-Feb-2014 Derek Sollenberger <djsollen@google.com> Update framework to enable Skia to run in debug mode.

Change-Id: I8ba605cfae61b584dad27e3245c4482c8dfdff2e
raphics/Bitmap.cpp
raphics/Utils.cpp
047b938f7188c21c07669108c5c68b2358f6b158 06-Feb-2014 Narayan Kamath <narayan@google.com> Fix several bad function definitions.

We claim these functions want jlong as input (8 bytes wide)
but the definitions use pointer types or jints
(4 bytes wide for 32 bit).

bug: 12890271

(cherry picked from 017546e65280a3389b6167f5fc3b5d1c3001154a)

Change-Id: Iede02be90e6a3c9a2db1fe04dcd0db99abe37097
raphics/Canvas.cpp
73c04711ca13c99f29a84de8cfc6c780811a8f63 13-Feb-2014 Leon Scroggins <scroggo@google.com> Remove call to setIsOpaque (again).

The call was removed in I1b36b0b0ce7126031eb7b769b563c17dcd4b306a,
since setIsOpaque was deprecated in Skia.

It was accidentally reintroduced in
Id5793fa0ebc17ee8b1eecf4b3f327977fdccff71. This line is redundant
with the lines above it (which call the replacement for setIsOpaque,
setAlphaType).

Change-Id: I6520f796d639721987418ec0ecae82b3674dcbfd
raphics/Bitmap.cpp
a1cffb429c57eb961282160ae4631d70bfa55204 11-Feb-2014 Narayan Kamath <narayan@google.com> am d350af96: am b90fc64b: am f44a3f1e: Merge "Use long for pointers in EmojiFactory and PdfDocument"

* commit 'd350af9695018e81f85600fb7dd906003cbaf62e':
Use long for pointers in EmojiFactory and PdfDocument
3393f390a5145056f9d67a2357125bd995fceac7 10-Feb-2014 Leon Scroggins III <scroggo@google.com> Merge "Decode file descriptor from the correct offset."
76d3a1b8d035d27bc80b0f2fc480a903bd001514 10-Dec-2013 Derek Sollenberger <djsollen@google.com> Removing SkiaColorFilter and inspecting the native object directly.

bug: 10650594
Change-Id: I4fcf66d008765afa0e35d011f58bc792183cb74f
raphics/ColorFilter.cpp
2826e5f20295a1adb3b341c8b32f27d748e2ee19 06-Feb-2014 Leon Scroggins III <scroggo@google.com> Decode file descriptor from the correct offset.

Fix a few bugs in nativeDecodeFileDescriptor:
1. Restore the FD's offset when exiting the function.
2. Copy the data when potentially using an SkImageRef.
The old behavior would have continued to modify the
file descriptor's offset each time a new decode was
required. The copy ensures that the file descriptor
remains unchanged.
3. Buffer the file stream.
Prior to this change, if the image was not a PNG,
the stream would be rewound to the beginning of the
file, even if the file descriptor was passed in with
an offset. Thanks to the buffer, the stream is only
rewound to the original offset.

Depends on https://googleplex-android-review.googlesource.com/#/c/415821/1
in external/skia

BUG:12807677
BUG:12895876
Change-Id: I38b8cf5d210dbbc0107e6562e3884867de57fc4b
raphics/BitmapFactory.cpp
017546e65280a3389b6167f5fc3b5d1c3001154a 06-Feb-2014 Narayan Kamath <narayan@google.com> Fix several bad function definitions.

We claim these functions want jlong as input (8 bytes wide)
but the definitions use pointer types or jints
(4 bytes wide for 32 bit).

bug: 12890271
Change-Id: I6a167a4f3aac1e22ddea33d067caaef6a11b418c
raphics/Canvas.cpp
9b311c900dcc3666febf52c1bed8eae7ce1f2815 05-Feb-2014 Andy McFadden <fadden@android.com> Pass a thread name to AttachCurrentThread

Reduces logspam from ART.

Bug 12896873

Change-Id: I82ae8e2dbba3918071d9c28f5ae5c882f8dcab3a
raphics/SurfaceTexture.cpp
7c68a4076e1ef141db5ac338d675646a278f0eb8 16-Jul-2012 Pawel Augustyn <pawel.augustyn@sonymobile.com> Fix for native leaks in YuvToJpegEncoder.cpp

Objects allocated by Get<object>ArrayElements function,
should be released. Add a fix to release this objects
in error cases.

Change-Id: Idf834523d93bb2dfd6b872e3b2179b7f1bba38f3
raphics/YuvToJpegEncoder.cpp
56f57ccbd4fbbf4d572cc966d1cb76d7ae7ad334 31-Jan-2014 George Mount <mount@google.com> Revert "Add Path trimming."

Bug 12489442
This reverts commit 7fe03a267e6edb65142444765ce29ad5ff126052.

Change-Id: Idf434d79683e170364838388c7933a8591f7f4d3
raphics/Path.cpp
cdf34469b3a49b73ffa4ab2766b55d7c0946fab1 23-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> Use long for pointers in EmojiFactory and PdfDocument

Change-Id: I275c9ce390dd9e01f772e2044c74cebdb0701de6
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
raphics/pdf/PdfDocument.cpp
1e7011fb2903b6b10a78890b2f85ca026e49b168 29-Jan-2014 Narayan Kamath <narayan@google.com> Merge "Path.native_trim should return long, not int."
11f66d0874669cb23be87202f84b98be9ea7bbc8 29-Jan-2014 Narayan Kamath <narayan@google.com> am 1caea796: am c74f7619: am cdc095ae: am 7be33110: am d4ccffd3: Merge "AArch64: Use long for pointers in graphics/Interpolator"

* commit '1caea796c9f3154048c02db6f46c458e8a80c32c':
AArch64: Use long for pointers in graphics/Interpolator
c42de09a947fa511cc75a624c40b2d2816b8c0ee 29-Jan-2014 Narayan Kamath <narayan@google.com> am 67ac8120: am 0cc4bb1f: am e4fc5c17: am 74db9ddb: am 887b1ca8: Merge "AArch64: Use long for pointers in SurfaceTexture"

* commit '67ac8120bf4e01b1de9d46673142d7fb92615616':
AArch64: Use long for pointers in SurfaceTexture
d4ccffd3ba7f7c27ddfc56231cf7f2424842b1e3 29-Jan-2014 Narayan Kamath <narayan@google.com> Merge "AArch64: Use long for pointers in graphics/Interpolator"
887b1ca87941095797a246b2d68ec2626a7cfc43 29-Jan-2014 Narayan Kamath <narayan@google.com> Merge "AArch64: Use long for pointers in SurfaceTexture"
e55bc7f1575fc5dacac70c4cb209e6aa0c582e71 29-Jan-2014 Narayan Kamath <narayan@google.com> Path.native_trim should return long, not int.

Change-Id: Idafc4c58eb86ad1af614d31f8cb05216bd869482
raphics/Path.cpp
5753b45516607988d5e84fee448d020911dde5d1 13-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Use long for pointers in graphics/Camera

For storing pointers, long is used in
android/graphics/Camera class, as native
pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use of
jint instead of int in JNI function prototypes)

Change-Id: Ic05ebf2051a225a1638a43f476bab6176c0b5c38
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
raphics/Camera.cpp
a0398430fcf365fba6e42ad0bdca2fbf45ed6fe0 20-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Make graphics classes 64-bit compatible

Changes in this patch include

[x] Long is used to store native pointers as they can
be 64-bit.

[x] Some minor changes have been done to conform with
standard JNI practice (e.g. use of jint instead of int
in JNI function prototypes)

[x] AssetAtlasManager is not completely 64-bit compatible
yet. Specifically mAtlasMap member has to be converted
to hold native pointer using long. Added a TODO to
AssetAtlasManager.java to indicate the change required.

Change-Id: I940433f601c6db998c1a8ffff338f5361200d5ed
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/Canvas.cpp
raphics/ColorFilter.cpp
raphics/DrawFilter.cpp
raphics/Graphics.cpp
raphics/LayerRasterizer.cpp
raphics/MaskFilter.cpp
raphics/Matrix.cpp
raphics/NinePatch.cpp
raphics/Paint.cpp
raphics/Path.cpp
raphics/PathEffect.cpp
raphics/Picture.cpp
raphics/PorterDuff.cpp
raphics/Rasterizer.cpp
raphics/Region.cpp
raphics/Shader.cpp
raphics/Typeface.cpp
raphics/Xfermode.cpp
pengl/util.cpp
36bef0bf30d6bae48cf3837df351075ca4fce654 20-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Make graphics classes 64-bit compatible

This a merger of two commits submitted to AOSP by
the following authors:

ashok.bhat@arm.com, david.butcher@arm.coma
craig.barber@arm.com, kevin.petit@arm.com and
marcus.oakland@arm.com

Due to the very large number of internal conflicts, I
have chosen to cherry-pick this change instead
of letting it merge through AOSP because the merge
conflict resolution would be very hard to review.

Commit messages below:

================================================
AArch64: Make graphics classes 64-bit compatible

Changes in this patch include

[x] Long is used to store native pointers as they can
be 64-bit.

[x] Some minor changes have been done to conform with
standard JNI practice (e.g. use of jint instead of int
in JNI function prototypes)

[x] AssetAtlasManager is not completely 64-bit compatible
yet. Specifically mAtlasMap member has to be converted
to hold native pointer using long. Added a TODO to
AssetAtlasManager.java to indicate the change required.

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

==================================================================

AArch64: Use long for pointers in graphics/Camera

For storing pointers, long is used in
android/graphics/Camera class, as native
pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use of
jint instead of int in JNI function prototypes)

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

===================================================================

Change-Id: Id5793fa0ebc17ee8b1eecf4b3f327977fdccff71
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/Camera.cpp
raphics/Canvas.cpp
raphics/ColorFilter.cpp
raphics/DrawFilter.cpp
raphics/Graphics.cpp
raphics/LayerRasterizer.cpp
raphics/MaskFilter.cpp
raphics/Matrix.cpp
raphics/NinePatch.cpp
raphics/Paint.cpp
raphics/Path.cpp
raphics/PathEffect.cpp
raphics/Picture.cpp
raphics/PorterDuff.cpp
raphics/Rasterizer.cpp
raphics/Region.cpp
raphics/Shader.cpp
raphics/Typeface.cpp
raphics/Xfermode.cpp
pengl/util.cpp
2f4e0c24ab33895a60baf9918cb6cb47a989b81c 27-Jan-2014 Mathieu Chartier <mathieuc@google.com> am 698d3673: am 4a750c1f: am 15594557: am 137d74d8: am db525724: Merge "Fix dest == src bugs in Matrix.cpp."

* commit '698d36731700b168e5debf8c3904d1106f4da20a':
Fix dest == src bugs in Matrix.cpp.
7023df08f14ec5dee76ac54c03e870f84e297636 27-Jan-2014 Narayan Kamath <narayan@google.com> Revert "AArch64: Make graphics classes 64-bit compatible"

This reverts commit 18b4cbeedef21c1fa666a110a157bab66edff976.

Change-Id: I0c52983a3ab1ace3ff743de546a43eca28e5cb0e
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/Camera.cpp
raphics/Canvas.cpp
raphics/ColorFilter.cpp
raphics/DrawFilter.cpp
raphics/Graphics.cpp
raphics/LayerRasterizer.cpp
raphics/MaskFilter.cpp
raphics/Matrix.cpp
raphics/NinePatch.cpp
raphics/Paint.cpp
raphics/Path.cpp
raphics/PathEffect.cpp
raphics/Picture.cpp
raphics/PorterDuff.cpp
raphics/Rasterizer.cpp
raphics/Region.cpp
raphics/Shader.cpp
raphics/Typeface.cpp
raphics/Xfermode.cpp
pengl/util.cpp
18b4cbeedef21c1fa666a110a157bab66edff976 20-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Make graphics classes 64-bit compatible

This a merger of two commits submitted to AOSP by
the following authors:

ashok.bhat@arm.com, david.butcher@arm.coma
craig.barber@arm.com, kevin.petit@arm.com and
marcus.oakland@arm.com

Due to the very large number of internal conflicts, I
have chosen to cherry-pick this change instead
of letting it merge through AOSP because the merge
conflict resolution would be very hard to review.

Commit messages below:

================================================
AArch64: Make graphics classes 64-bit compatible

Changes in this patch include

[x] Long is used to store native pointers as they can
be 64-bit.

[x] Some minor changes have been done to conform with
standard JNI practice (e.g. use of jint instead of int
in JNI function prototypes)

[x] AssetAtlasManager is not completely 64-bit compatible
yet. Specifically mAtlasMap member has to be converted
to hold native pointer using long. Added a TODO to
AssetAtlasManager.java to indicate the change required.

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

==================================================================

AArch64: Use long for pointers in graphics/Camera

For storing pointers, long is used in
android/graphics/Camera class, as native
pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use of
jint instead of int in JNI function prototypes)

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

===================================================================

Change-Id: Ib3eab85ed97ea3e3c227617c20f8d213f17d4ba0
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/Camera.cpp
raphics/Canvas.cpp
raphics/ColorFilter.cpp
raphics/DrawFilter.cpp
raphics/Graphics.cpp
raphics/LayerRasterizer.cpp
raphics/MaskFilter.cpp
raphics/Matrix.cpp
raphics/NinePatch.cpp
raphics/Paint.cpp
raphics/Path.cpp
raphics/PathEffect.cpp
raphics/Picture.cpp
raphics/PorterDuff.cpp
raphics/Rasterizer.cpp
raphics/Region.cpp
raphics/Shader.cpp
raphics/Typeface.cpp
raphics/Xfermode.cpp
pengl/util.cpp
768480c2458fda63f5eaab37c03e0671d759c514 26-Jan-2014 Mathieu Chartier <mathieuc@google.com> Fix dest == src bugs in Matrix.cpp.

The main bug was that the AutoJavaFloatArray autoSrc was not passing in
read only. This meant that the destructor overwrote the data which
the autoDst AutoJavaFloatArray had written in it's destructor.
This case only happened if src == dest and the arrays were copies.
Also improved performance by passing in read only a few other places.

Bug: 12570144

Change-Id: Idc8764087dc165433c584b87a0f9d4ed0ec795e8
raphics/Matrix.cpp
4d7f9450663468abf5e41e24b7d3b1d5c3ea6143 16-Jan-2014 Narayan Kamath <narayan@google.com> am 8492e88a: am 077386db: am 6b81bfd1: am caea42fd: am 98002dfb: Merge "AArch64: Use long for pointers in graphics/PathMeasure"

* commit '8492e88a23ee4ac32f05b277654e0f9455fefa9b':
AArch64: Use long for pointers in graphics/PathMeasure
f25afde8dd24e6a23e3a25c05c9ad2965d0ac96e 16-Jan-2014 Narayan Kamath <narayan@google.com> am 419267a1: am 213f243f: am 87a82800: am aef12450: am 1b0f0be0: Merge "Make YuvToJpegEncoder more JNI compliant"

* commit '419267a164ba586a81a8e669863a494d2a88a44c':
Make YuvToJpegEncoder more JNI compliant
6606d16e097480e061546306cc95a729f5dccae8 16-Jan-2014 Narayan Kamath <narayan@google.com> am 6706888e: am 775667c0: am 03e8be75: am 8796ab7f: am bb35356d: Merge changes Id54087dd,I946325e4,I2a2b2e68

* commit '6706888e24aee04c2c914c44e5ef5b1510cf8013':
AArch64: Use long for pointers in BitmapRegionDecoder
AArch64: Use long for pointers in Movie class
AArch64: Add AssetInputStream.getNativeAsset
a2f9042f4eec167bad04ba8923723cd9458699b5 13-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Use long for pointers in graphics/Interpolator

For storing pointers, long is used in
android/graphics/Interpolator class, as native
pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use
of jint instead of int in JNI function prototypes)

Change-Id: I1e181476a4fe5273ff190cf34c4a7487aa1aecf4
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
raphics/Interpolator.cpp
72aa313ff4c91e7b2aae3d37067f9201b2b0fdbe 13-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Use long for pointers in SurfaceTexture

Long is used in SurfaceTexture class to store
pointers as native pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use
of jint instead of int in JNI function prototypes)

Change-Id: I771aa62c42bc865e644c63fd48f309782dd03e73
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
raphics/SurfaceTexture.cpp
98002dfb60a20caf62d6682659547c042a4a3342 16-Jan-2014 Narayan Kamath <narayan@google.com> Merge "AArch64: Use long for pointers in graphics/PathMeasure"
1b0f0be0979cbe00641d5d386691e87d668a2aa8 16-Jan-2014 Narayan Kamath <narayan@google.com> Merge "Make YuvToJpegEncoder more JNI compliant"
0102f8a87a7571b1ff537a1293d67ae8fa001167 14-Jan-2014 Leon Scroggins III <scroggo@google.com> In nativeDecodeFileDescriptor, use fdopen.

Instead of attempting to mmap the entire file, create an
SkFILEStream from a FILE.

BUG:11669944
BUG:11028218
Change-Id: If67da91484acc79f9f3dde6d05201409c0c75e41
raphics/BitmapFactory.cpp
8790be6de3644e332ec6a17c855da89ffc13a9bf 03-Dec-2013 Leon Scroggins III <scroggo@google.com> Remove calls to deprecated SkBitmap::setIsOpaque()

setIsOpaque() has been removed from ToT Skia.

Update setters for mIsPremultiplied and hasAlpha to take the
other into consideration.

Change-Id: I1b36b0b0ce7126031eb7b769b563c17dcd4b306a
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
b091d47a2e31a30581aa210419ff09bcc8715cdf 08-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Use long for pointers in BitmapRegionDecoder

For storing pointers, long is used in BitmapRegionDecoder
class, as native pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use
of jint instead of int in JNI function prototypes)

In addition, Graphics.cpp has been changed to work
with modified BitmapRegionDecoder.

Change-Id: Id54087dd3bfb29577e8b762e70946793369dc701
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
raphics/BitmapRegionDecoder.cpp
raphics/Graphics.cpp
dcaf5593ddbfe8e1cacaf07813b1e827ba4dba8c 08-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Use long for pointers in Movie class

For storing pointers, long is used in Movie class,
as native pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use
of jint instead of int in JNI function prototypes)

Change-Id: I946325e4af6cb9282012bebdaee89e1117d8797b
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
raphics/Movie.cpp
39029b29906fb064fc1e408983809b9b7ad74095 10-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> Make YuvToJpegEncoder more JNI compliant

Minor changes have been done to conform with standard
JNI practice (e.g. use of jint instead of int in JNI
function prototypes)

Change-Id: I4015138921cc18ecae52daaa6710b3c9efd68e87
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
raphics/YuvToJpegEncoder.cpp
0c10cc6052dc279f020e4adf069961e6e8f9dd6e 10-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Use long for pointers in graphics/PathMeasure

For storing pointers, long is used in
android/graphics/PathMeasure class, as native
pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use
of jint instead of int in JNI function prototypes)

Change-Id: I4599a9d5f7dcf9c39838db96d9033059114d3a49
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
raphics/PathMeasure.cpp
b9c58ab617c257dbece105167b21e94faad67320 03-Dec-2013 Leon Scroggins III <scroggo@google.com> Merge AssetStream with AssetStreamAdaptor.

Add enums to the constructor for AssetStreamAdaptor to choose the
different behaviors used by the (former) two different classes.

The old clients of AssetStream now get the following features of
AssetStreamAdaptor
- Debugging statements on error.
- The stream is an SkStreamRewindable.
- getLength() returns the correct value, and the old way of getting
the length (read(NULL, 0)) is no longer implemented, since it is
no longer used.
- isAtEnd() returns the correct value. ToT Skia makes it pure virtual,
so some implementation is necessary.

Change-Id: I2a5395914e4f53830aaefee396556459083a1c56
raphics/BitmapFactory.cpp
raphics/Movie.cpp
raphics/TypefaceImpl.cpp
raphics/Utils.cpp
raphics/Utils.h
7fe03a267e6edb65142444765ce29ad5ff126052 23-Nov-2013 George Mount <mount@google.com> Add Path trimming.

Change-Id: Iafcf127a5136883ad4c0185d3c15f96d67f38d0d
raphics/Path.cpp
ebcb32f58a6220802ca129ea33f47b4b69931a10 05-Dec-2013 The Android Open Source Project <initial-contribution@android.com> Merge commit 'bac61807d3bcfff957b358cb9ad77850bd373689' into HEAD

Change-Id: I29374270c8e0c2f2859efaf1d55af9f73da0f8d7
e2aad50479c537518d2808ced9e4eb9554c113e5 05-Dec-2013 Brian Carlstrom <bdc@google.com> am 4a657244: am 59595f7a: am 8026b2ce: Merge "Use exceptionCheck after VMRuntime.newNonMovableArray/addressOf."

* commit '4a657244b3de44cf28aae952b8dc76f8598c61cb':
Use exceptionCheck after VMRuntime.newNonMovableArray/addressOf.
59595f7a3e8efcefc62bbcf8e085b6da6d8ea339 05-Dec-2013 Brian Carlstrom <bdc@google.com> am 8026b2ce: Merge "Use exceptionCheck after VMRuntime.newNonMovableArray/addressOf."

* commit '8026b2ce23396262ad1f1e7a75093cd0e2467d4b':
Use exceptionCheck after VMRuntime.newNonMovableArray/addressOf.
a1a19d28d0e432c2d90e4fd73146891c57d01479 05-Dec-2013 Mathieu Chartier <mathieuc@google.com> Use exceptionCheck after VMRuntime.newNonMovableArray/addressOf.

Since VMRuntime.newNonMovableArray and VMRuntime.addressOf are java
methods implemented in Native, they don't necessarily return NULL
when an exception is thrown. Checking the exception instead of the
return value fixes errors which may occur if the runtime returns
garbage when an exception is pending.

Bug: 11971220
Change-Id: I70478834c9f14cc5d9e666e1e174d3fd09269719
raphics/Graphics.cpp
aec09b6b98aa75fac426cff6f39a46ae5850594b 04-Dec-2013 Leon Scroggins III <scroggo@google.com> Merge "Call SkBitmap::config() instead of ::getConfig()"
385739be8c05ea40cd9c17ae02530dd90e0157bd 04-Dec-2013 Victoria Lease <violets@google.com> Merge "Deprecate Android-specific SkPaint functions."
43b692d9a18224e89fc09a0e68d097322e0ef6bb 04-Dec-2013 Victoria Lease <violets@google.com> Deprecate Android-specific SkPaint functions.

The following functions were problematic:
const SkGlyph& getUnicharMetrics(SkUnichar, const SkMatrix*);
const SkGlyph& getGlyphMetrics(uint16_t, const SkMatrix*);
const void* findImage(const SkGlyph&, const SkMatrix*);

Replacing them with calls through SkGlyphCache solved a nasty crash
bug, so they have all been deprecated.

Bug: 11968757
Change-Id: Id746315d41aec5b211b78b172a883c2061130f08
raphics/TextLayoutCache.cpp
4b9a19a8f865970e0079f431c8c2c2a8e4333ae9 03-Dec-2013 Leon Scroggins III <scroggo@google.com> Call SkBitmap::config() instead of ::getConfig()

getConfig() has been deprecated.

Change-Id: I32066256ab82ac4760c752c80856d1b56d291fae
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/NinePatchImpl.cpp
pengl/util.cpp
82b7b0b2af24704c6eb465665024ea6aaf7699c2 02-Dec-2013 Leon Scroggins III <scroggo@google.com> Remove call to deprecated function.

setPrefConfigTable(array) is being removed in
https://codereview.chromium.org/99473004

Change-Id: I2d7e25052861f7f1d54e2418c11204d51bb88b1e
raphics/NinePatchPeeker.cpp
dbccd44a638ae8705a5b14bff8b2dd74abc26045 22-Nov-2013 The Android Open Source Project <initial-contribution@android.com> Merge commit 'b873a17ce7be0a9771c24999adca6964431728f6' into HEAD

Change-Id: I938755073e70602cc8f51ce9bd420fdcf870cecd
f8627d658d8c7edf43a49b5f6f2727ce64822f7e 21-Nov-2013 Derek Sollenberger <djsollen@google.com> Merge "framework changes needed to support Skia at r12108."
ed79ff0026a44741237a6eb5e3810dbf5d765154 20-Nov-2013 Derek Sollenberger <djsollen@google.com> framework changes needed to support Skia at r12108.

Change-Id: I231e187e7d2db84fa06bd6783c9b49abba5b4e70
raphics/Bitmap.cpp
raphics/BitmapRegionDecoder.cpp
pengl/util.cpp
34d8519de44f301ce0b7196e248e58345d3cd35a 20-Nov-2013 George Mount <mount@google.com> Merge "Add animations along a Path."
c96c7b2e54965e30c8fb82295f1ca9f891ebd5e7 23-Aug-2013 George Mount <mount@google.com> Add animations along a Path.

Change-Id: If03bd10a3961ff874e33489e1253146b8dadca33
raphics/Path.cpp
aff6ea9516ebb4c7e5bf487f7c867f31e8fbbd96 18-Nov-2013 Raph Levien <raph@google.com> Merge "Initial integration of Minikin to framework"
a033630e805c407080221e20b236b6054f324670 23-May-2013 Raph Levien <raph@google.com> Initial integration of Minikin to framework

With this patch, framework does at least some of its text rendering
using Minikin instead of TextLayoutCache. There's a lot of stuff broken
and not yet implemented, but the phone will boot.

Changes are hidden behind USE_MINIKIN, which should be set in
BoardConfig.mk for the brave. Without that, there are changes to
signatures in JNI methods and so on, but shouldn't be any visible
changes.

This commit also introduces a new abstraction for Typeface:

The new TypefaceImpl abstraction represents the functionality that
corresponds to a Java Typeface object. Currently it is backed by
SkTypeface, but in the migration to Minikin it is a FontCollection
combined with a FontStyle. This patch introduces a USE_MINIKIN
preprocessor switch, so there is no substantial change to existing
Skia-based code, but which lets us start replacing the implementation
with the Minikin version.

Change-Id: I532c4c2d32d4f4c1f349dc1db37caa112af587ea
raphics/Canvas.cpp
raphics/MinikinSkia.cpp
raphics/MinikinSkia.h
raphics/Paint.cpp
raphics/Typeface.cpp
raphics/TypefaceImpl.cpp
raphics/TypefaceImpl.h
765c9dfd54a57a062ce9702eb843b3d2dea716e7 08-Nov-2013 Svetoslav <svetoslavganov@google.com> am ebd616e8: am 134631b9: am 90242fe5: Merge "Switch to the new Skia PDF generation APIs." into klp-dev

* commit 'ebd616e88dab185bbf5b309d29c92a9eea9817e0':
Switch to the new Skia PDF generation APIs.
ebd616e88dab185bbf5b309d29c92a9eea9817e0 08-Nov-2013 Svetoslav <svetoslavganov@google.com> am 134631b9: am 90242fe5: Merge "Switch to the new Skia PDF generation APIs." into klp-dev

* commit '134631b9078df0b9277fb3b8319bf3b85f690727':
Switch to the new Skia PDF generation APIs.
35aacf2eb325d24c67d01f4dbd706ed26ab9e8c3 07-Nov-2013 Svetoslav <svetoslavganov@google.com> Switch to the new Skia PDF generation APIs.

The new Skia PDF generation APIs are a small extension to
the code that converts drawing commands to PDF (SkPDFDevice)
and this new functionality is exposed via new APIs. This
change switches to using these new APIs allowing us to
capitalize on the new perspective support for PDF
generation.

bug:11561776

Change-Id: Ief61f7ff6a5a22c27d3acbe99a48910cb679f594
raphics/pdf/PdfDocument.cpp
d0d4b00ac5010bd3ea309a9a99147cf318a66cb7 06-Nov-2013 Victoria Lease <violets@google.com> am dd3776d6: am 30a3ef6c: am c89eaf91: Merge "Fix for Typeface.create(Typeface, style) semantics changed in KK" into klp-dev

* commit 'dd3776d673776785f32aa7d813871a38de906c5d':
Fix for Typeface.create(Typeface, style) semantics changed in KK
dd3776d673776785f32aa7d813871a38de906c5d 06-Nov-2013 Victoria Lease <violets@google.com> am 30a3ef6c: am c89eaf91: Merge "Fix for Typeface.create(Typeface, style) semantics changed in KK" into klp-dev

* commit '30a3ef6c85011ba82a777e6eef7f026323019f35':
Fix for Typeface.create(Typeface, style) semantics changed in KK
4f0064fa3448c95e116a8d5646547a7a0fa8a432 06-Nov-2013 Raph Levien <raph@google.com> Fix for Typeface.create(Typeface, style) semantics changed in KK

This is a fix for bug 11553661. The "closest match" heuristic for
resolving a typeface when an exact match was not found changed between
JB MR2 and KK, resulting in loss of custom typeface when StyleSpan was
applied. This patch reinstates the logic that had been present. Also
reported externally as:
https://code.google.com/p/android/issues/detail?id=61771

Change-Id: Ia432fca07c4bf3b830ee2487cd8f5267a9cfb7ff
raphics/Typeface.cpp
ec1ae35c3e5456d2e0d3d262be528652526c9dbb 21-Oct-2013 Victoria Lease <violets@google.com> am ed82a648: am 54b7e3e8: am a80d6424: Merge "Implement language-specific GSUB processing" into klp-dev

* commit 'ed82a6482806b44fa816b8224d8c06fbffcd5bd3':
Implement language-specific GSUB processing
ed82a6482806b44fa816b8224d8c06fbffcd5bd3 21-Oct-2013 Victoria Lease <violets@google.com> am 54b7e3e8: am a80d6424: Merge "Implement language-specific GSUB processing" into klp-dev

* commit '54b7e3e81c39a5e94fd3dcd67cc4eba0f56351f2':
Implement language-specific GSUB processing
b1ce729fd055b6740ca112f6bf21cc82eba44701 18-Oct-2013 Elliott Hughes <enh@google.com> am 9f13a608: am 2ec939ba: am cf4c7bdd: Merge "Fix whitespace issues after casts."

* commit '9f13a608a703d4d12bbfc65472de766ece0037da':
Fix whitespace issues after casts.
9f13a608a703d4d12bbfc65472de766ece0037da 18-Oct-2013 Elliott Hughes <enh@google.com> am 2ec939ba: am cf4c7bdd: Merge "Fix whitespace issues after casts."

* commit '2ec939bac6263fefee2605d2b50136955cfcba6d':
Fix whitespace issues after casts.
f585655b4e301c31e59b994699d6de13ec8a672f 18-Oct-2013 Elliott Hughes <enh@google.com> am 4a5b3f0a: am ac6e036a: Merge "Remove dependency on jniGetNonMovableArrayElements."

* commit '4a5b3f0ad0b742fbdce154236b15185aaff87ffb':
Remove dependency on jniGetNonMovableArrayElements.
6ecb7a9a27c96e50525de2bc5c78391bf401bf72 18-Oct-2013 Mathieu Chartier <mathieuc@google.com> Fix whitespace issues after casts.

Change-Id: Ief3e50fbedd193e22509aac783f16ba1288908de
raphics/Graphics.cpp
7384b428c445f07540fd6a80a21727d03be65d96 18-Oct-2013 Mathieu Chartier <mathieuc@google.com> Remove dependency on jniGetNonMovableArrayElements.

jniGetNonMovableArrayElements is not safe and is going to be deleted.

Change-Id: I6daae1e4ac9e01ca593cda522fdbeb774eef1eff
(cherry picked from commit 75a5038849cecf38aba72721272ff07cca09501f)
raphics/Graphics.cpp
75a5038849cecf38aba72721272ff07cca09501f 18-Oct-2013 Mathieu Chartier <mathieuc@google.com> Remove dependency on jniGetNonMovableArrayElements.

jniGetNonMovableArrayElements is not compaction safe and is going
to be deleted.

Change-Id: I6daae1e4ac9e01ca593cda522fdbeb774eef1eff
raphics/Graphics.cpp
677726b376402937f53ddb192dc97078b92b7c9e 08-Oct-2013 Raph Levien <raph@google.com> Implement language-specific GSUB processing

This patch allows HarfBuzz to select language-specific features based
on the language. It is a fix for bug 7004056.

Change-Id: I63f01b9580250728b900f19f357cefdeb9d36c72
raphics/TextLayoutCache.cpp
6034ee95a0d703f535391728c6e63451b7ca35b1 08-Oct-2013 Leon Scroggins III <scroggo@google.com> am 25c4e987: am 97b707d5: am 80a058b3: Merge "Do not attempt to decode NULL SkData." into klp-dev

* commit '25c4e98711d29a69db96526e3c72604f7dbb1005':
Do not attempt to decode NULL SkData.
80a058b3033200835f86ee0e61367a87a470cde8 08-Oct-2013 Leon Scroggins III <scroggo@google.com> Merge "Do not attempt to decode NULL SkData." into klp-dev
f65183fd76aa82eedaebcbde9395a5dba42fc969 07-Oct-2013 Leon Scroggins III <scroggo@google.com> Do not attempt to decode NULL SkData.

NewFromFD fails if mmap fails. In that case, it returns a NULL
SkData. SkMemoryStream handles NULL input by calling SkData::NewEmpty,
which is not threadsafe. If the SkMemoryStream were to get some
busted SkData, its call to read might fail. Sidestep this problem
by not creating the SkMemoryStream if the SkData is NULL, skipping
the call to SkData::NewEmpty.

BUG:11028218
Change-Id: Id70299bef1c85ffb5d17102fdb5ea071b0bee68a
raphics/BitmapFactory.cpp
28ff40405dc30d82d53472f2b28436234e8c9f65 05-Oct-2013 Victoria Lease <violets@google.com> am e8200873: am 0d5a719d: am b088c9e0: Merge "reset mShapingPaint\'s SkTypeface before we use it" into klp-dev

* commit 'e8200873598cf872062126b86edd933620f594aa':
reset mShapingPaint's SkTypeface before we use it
8450a6ef8b4282491857fd5af6574019983ec243 05-Oct-2013 Victoria Lease <violets@google.com> reset mShapingPaint's SkTypeface before we use it

Harfbuzz works in TTF glyph-space, but most of Skia works in
fallback glyph-space. shapeFontRun() helpfully calculates the
baseGlyphCount needed to convert between the two, but leaves
mShapingPaint's SkTypeface set to the specific TTF being shaped
rather than the original SkTypeface that was requested. Needless
to say, this causes all manner of horrific malady when glyph
indices are calculated in one glyph-index-space and then applied
to another.

To fix this issue, I reset mShapingPaint's SkTypeface when done
with the Harfbuzz shaping operation so that the baseGlyphCount only
gets applied once.

Change-Id: Ia886f89d667634e15e5fc8d7af443c9d1ba89622
raphics/TextLayoutCache.cpp
5380709c780fae2f3bf9862d40176b86b0de85df 24-Sep-2013 Derek Sollenberger <djsollen@google.com> am fad41c8f: am 5db1f5aa: Merge "Fix Java API error where requesting another style for a provided family fails" into klp-dev

* commit 'fad41c8fd1024a8257bdced18dbcbc9cd67e407a':
Fix Java API error where requesting another style for a provided family fails
fe8e21fd80f0594f2be341643ef52d2095eda3b6 23-Sep-2013 Derek Sollenberger <djsollen@google.com> Fix Java API error where requesting another style for a provided family fails

Internally the API uses the same code path as SkTypeface::CreateFromName which
returns NULL if the requested style is not supported by the existing family.
However, the existing Java API expects that we return the default font in the
requested style so this CL ensures that we do.

bug: 10860066
Change-Id: Ide3a0cc24015e97fa35aef283b42e7d7d11edd9c
raphics/Typeface.cpp
6e1e8b17c575bc6a115bcbbec47040d5f58740b7 20-Sep-2013 Svetoslav <svetoslavganov@google.com> am c0e1ae01: am facc08c7: Merge "Move PdfDocument to android.graphics.pdf" into klp-dev

* commit 'c0e1ae0176b2ce23ea1b19883507cd920712289a':
Move PdfDocument to android.graphics.pdf
29baa03ba582a6a831a5aa463eba6261461592a3 20-Sep-2013 Leon Scroggins III <scroggo@google.com> am 2360ada9: am 57989c0e: Merge "Skip writing zeroes to java allocated memory." into klp-dev

* commit '2360ada939b0abd4a6cca794288ff06701219f19':
Skip writing zeroes to java allocated memory.
8fa4e29f167af0d0541f496e1bb24f6a6af75e9d 20-Sep-2013 Derek Sollenberger <djsollen@google.com> am 23b7bc1b: am a2c6209f: Merge "Update SkTypeface::CreateFromName to handle NULL if familyName does not match" into klp-dev

* commit '23b7bc1b4409ca5844db5f17992b906aa3e63927':
Update SkTypeface::CreateFromName to handle NULL if familyName does not match
facc08c7757cef56da6d10e78ce99ef7949700e3 20-Sep-2013 Svetoslav <svetoslavganov@google.com> Merge "Move PdfDocument to android.graphics.pdf" into klp-dev
6811f4e92cbb64e72a0d13eb9b99b5894bd59c76 19-Sep-2013 Svetoslav <svetoslavganov@google.com> Move PdfDocument to android.graphics.pdf

1. Move PdfDocument to android.graphics.pdf.

2. Changed the PdfDocument as per API concil request.

3. Updated the documentation.

bug:10461180
bug:10552565
bug:10681585
bug:10552336

Change-Id: I08e15b34cf37bb064248c887e6f59808019cafe8
raphics/pdf/PdfDocument.cpp
rint/android_print_pdf_PdfDocument.cpp
57989c0e042c4f4e9362d875cf3df481243c0488 20-Sep-2013 Leon Scroggins III <scroggo@google.com> Merge "Skip writing zeroes to java allocated memory." into klp-dev
1ffe727c0616ca11092a45c3dfb94479fe55fdd9 19-Sep-2013 Leon Scroggins III <scroggo@google.com> Skip writing zeroes to java allocated memory.

If pixel memory was just allocated by Java, tell our decoders not
to write 0s, since the memory was initialized to 0. Likewise,
when drawing to a bitmap with memory just allocated by Java, do
not erase to 0.

Depends on a change to external/skia to add the new option on
image decoders:
https://googleplex-android-review.git.corp.google.com/362663

BUG:10016979
Change-Id: I9a3dc969870f8516e7d8495fe96d0a6b8225eda2
raphics/BitmapFactory.cpp
89ec829908c8ff405b88b82f9e3a67bb53caefa3 18-Sep-2013 Derek Sollenberger <djsollen@google.com> Update SkTypeface::CreateFromName to handle NULL if familyName does not match

This is a multi-project change with a dependency on external/skia

bug: 10730965
Change-Id: Ida880a86ebd182a221333bbd85eaa30d047a1618
raphics/Typeface.cpp
44f65cb5fd3b36dbf06f76da62cd6c495358985b 18-Sep-2013 Leon Scroggins III <scroggo@google.com> am 2e4e9889: am 3490228e: Merge "Use a native buffer for decoding images." into klp-dev

* commit '2e4e98895b17ef248f5071202a3610ac715eaf0e':
Use a native buffer for decoding images.
7315f1baee19476363235127bc1438e2a291fa15 11-Sep-2013 Leon Scroggins III <scroggo@google.com> Use a native buffer for decoding images.

Fixes BUG:10725383

Depends on https://googleplex-android-review.git.corp.google.com/#/c/357300/
in external/skia.

In the previous fix for BUG:8432093 and BUG:6493544
(https://googleplex-android-review.googlesource.com/#/c/346191/),
instead of calling mark on the provided input stream, we
copied the entire stream in native code (except in one case;
more details below), allowing rewind no matter how much of
the stream had been read. This was because two decoders
may rewind after reading an arbitrary amount of the stream:
SkImageDecoder_wbmp and SkImageDecoder_libjpeg.

It turns out that the jpeg decoder does not need this rewind
after arbitrary length (it is a failure recovery case, and
libjpeg has a default recovery we can use - the above referenced
CL in Skia uses the default).

Although the wbmp decoder could read any amount given a
stream with the "right" data, and then return false, such a
stream would not be a valid stream of another format, so it
is okay for this rewind to fail.

Further, the previous fix was inefficient in the common case
where the caller decodes just the bounds, resets, then decodes
the entire image (since we have copied the entire stream twice).
The copy also resulted in the crashes seen in BUG:10725383.

In this CL, buffer only the amount of input needed by
SkImageDecoder::Factory to determine the type of image decoder
needed. Do not mark the input stream provided by the caller,
so their mark (if any) can remain in tact. The new Skia class
SkFrontBufferedStream allows buffering just the beginning
of the stream.

core/jni/android/graphics/BitmapFactory.cpp:
Instead of calling GetRewindableStream (which has been removed),
call CreateJavaInputStreamAdaptor. Then wrap it in an
SkFrontBufferedStream, with a large enough buffer to determine
which type of image is used.

core/jni/android/graphics/CreateJavaOutputStreamAdaptor.h:
core/jni/android/graphics/CreateJavaOutputStreamAdaptor.cpp:
Remove mark, markSupported, and rewind. CreateJavaInputStreamAdaptor
now turns an SkStream which is not rewindable. If the caller
needs rewind that needs to be handled differently (for example,
by using SkFrontBufferedStream, as is done in BitmapFactory and
Movie.
Remove RewindableJavaStream and GetRewindableStream.
Remove code specific to ByteArrayInputStream, which makes slow
JNI calls. Instead, depend on the caller to buffer the input
in the general case. There is no reason to special case this
stream (especially since we already have decodeByteArray).
Remove CheckForAssetStream, which is now always special cased
in Java.

core/jni/android/graphics/Movie.cpp:
Call CreateJavaInputStreamAdaptor and use an SkFrontBufferedStream.
Add a native function for decoding an Asset, and remove old
call to CheckForAssetStream.

graphics/java/android/graphics/BitmapFactory.java:
Write a helper function for decoding a stream to consolidate
common code.
Buffer enough of the input so that SkImageDecoder::Factory
can rewind after having read enough to determine the type.
Unlike the old code, do NOT mark the caller's stream. This is
handled in native code. The caller's mark (if any) is left alone.

graphics/java/android/graphics/Movie.java:
Check for an Asset stream before passing to native, and
call a native function for handling the asset directly.

BUG:6493544
BUG:8432093
BUG:10725383

Change-Id: Ide74d3606ff4bb2a8c6cdbf11bae3f96696f331a
raphics/BitmapFactory.cpp
raphics/CreateJavaOutputStreamAdaptor.cpp
raphics/CreateJavaOutputStreamAdaptor.h
raphics/Movie.cpp
5387aa50298eeded52b14631e130996e551d9bca 16-Sep-2013 Leon Scroggins III <scroggo@google.com> am 3b8a7a04: am b693ef60: Merge "Do not allocate so much memory on the stack." into klp-dev

* commit '3b8a7a0402fbc2cb34e59a5757b8134c8bdadedc':
Do not allocate so much memory on the stack.
37b82e32324d0911aba897880c28b2fdedc3ec9a 13-Sep-2013 Leon Scroggins III <scroggo@google.com> Do not allocate so much memory on the stack.

Instead, allocate a smaller amount and grow as necessary.

BUG:10697851
Change-Id: Iec57a8a374a4a76a3770e241cf561d58f3c8e1dc
raphics/CreateJavaOutputStreamAdaptor.cpp
33069f40e5ba5a8c036671a67668b6bdfe6eb3a9 12-Sep-2013 Igor Murashkin <iam@google.com> am 47869404: am 2cad64c0: Merge "Surface: Change OutOfResourcesException to be a runtime exception" into klp-dev

* commit '47869404cb8233c536a0a5d2c5ce4d0089e39882':
Surface: Change OutOfResourcesException to be a runtime exception
2cad64c0fbeba07bb546674e19cfb0166d7ec332 11-Sep-2013 Igor Murashkin <iam@google.com> Merge "Surface: Change OutOfResourcesException to be a runtime exception" into klp-dev
27569f24477785a28c087aeaa4671a2ac817a018 11-Sep-2013 Chris Craik <ccraik@google.com> am a180fd6d: am 68fbe16b: Merge "Avoid ref-ing AndroidPixelRefs that wrap others in globalRef/Unref" into klp-dev

* commit 'a180fd6d67819a45bafc052581d43c0ecc1faccf':
Avoid ref-ing AndroidPixelRefs that wrap others in globalRef/Unref
68fbe16ba0072326c1c6b09817f46ccdc5ee15b9 11-Sep-2013 Chris Craik <ccraik@google.com> Merge "Avoid ref-ing AndroidPixelRefs that wrap others in globalRef/Unref" into klp-dev
28a1222bafbc5b3124cc8a5c400024c037047699 11-Sep-2013 Chris Craik <ccraik@google.com> Avoid ref-ing AndroidPixelRefs that wrap others in globalRef/Unref

bug:10691404

Only ref the wrapped pixel refs, so that they are the single source of
correct refcount, since the wrapping pixel ref can change out from
underneath an SkBitmap.

Change-Id: I253b8737d2afdcc567a26725fa40b1d9ef0e6a92
raphics/Graphics.cpp
a86ab640f7bb0bf3cb4eaed80473ca8c5d131903 30-Aug-2013 Igor Murashkin <iam@google.com> Surface: Change OutOfResourcesException to be a runtime exception

- Deprecates SurfaceTexture.OutOfResourcesException, it wasn't used
- Make all JNI code throw only Surface.OutOfResourcesException
- Get rid of redundant SurfaceControl.OutOfResourcesException

Bug: 10566539
Change-Id: I58126260771b9ccff6a69c672ce7719b9f98138d
raphics/SurfaceTexture.cpp
ce526bde4cba82bd72a6bfa814858cf9e7abd6e9 10-Sep-2013 Chris Craik <ccraik@google.com> am 47e6c4be: am 932e59fc: Merge "Create a pixelref wrapper for reused bitmaps" into klp-dev

* commit '47e6c4be1e1ef0f377aed7be773a070f3bfa4a13':
Create a pixelref wrapper for reused bitmaps
932e59fc2aae145a8930e4a2da4885f607fd47aa 10-Sep-2013 Chris Craik <ccraik@google.com> Merge "Create a pixelref wrapper for reused bitmaps" into klp-dev
fe3b9727ba05f4c6655c403fdb2ac1f6bbed2db5 09-Sep-2013 Leon Scroggins III <scroggo@google.com> am a818f0fa: am 91c8111d: Merge "Register jni objs in CreateJavaOutputStreamAdaptor" into klp-dev

* commit 'a818f0face6eeee24795c80f8c3b66169e75ffba':
Register jni objs in CreateJavaOutputStreamAdaptor
cd0ba71aa942f35fcdb26808b86f20073b8aff92 06-Sep-2013 Chris Craik <ccraik@google.com> Create a pixelref wrapper for reused bitmaps

Reused bitmaps may gain a color table when reused, so we wrap a new
AndroidPixelRef that holds the color table around the old.

bug:10608305
Change-Id: I35288edf3158cfda21c500360ad1abdf5654af8d
raphics/BitmapFactory.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
d0d7eaf129b48ea04c06902a11c2a4f74056d76c 06-Sep-2013 Leon Scroggins III <scroggo@google.com> Register jni objs in CreateJavaOutputStreamAdaptor

Write a registration function and call it in AndroidRuntime,
which calls FindClass/GetFieldID only once per class/method.
Use NewGlobalRef for classes that will be checked against later.

BUG:10612755
Change-Id: I25541da1b7bb1cd53a1579ea84c4620e1901310f
raphics/CreateJavaOutputStreamAdaptor.cpp
ed59cbb2d8801d2d636c565df3421943254bb7c6 04-Sep-2013 Derek Sollenberger <djsollen@google.com> am 22f36b1a: am 4c92f7ce: Merge "Revert workaround for Skia bug now that Skia has been fixed." into klp-dev

* commit '22f36b1a8d9b6b4ecb27e3e35a79579fd9e9cff8':
Revert workaround for Skia bug now that Skia has been fixed.
2696797939fdf3b236635998b2739aba87e68ebb 04-Sep-2013 Derek Sollenberger <djsollen@google.com> Revert workaround for Skia bug now that Skia has been fixed.

bug: 7170836
Change-Id: If357767a5f66d539f775bce766e963b3d0df38bf
raphics/Paint.cpp
9f5da6ff42854537f16f7b02554c333b8acc2151 03-Sep-2013 Leon Scroggins III <scroggo@google.com> am 050129b4: am 3f8da091: Merge "Change name back to CreateJavaInputStreamAdaptor." into klp-dev

* commit '050129b44ada6c105c317092056803b2a60cef74':
Change name back to CreateJavaInputStreamAdaptor.
c7797525084ba0ea441e394aa0a2ba35d6ff3320 03-Sep-2013 Leon Scroggins III <scroggo@google.com> Change name back to CreateJavaInputStreamAdaptor.

In order to fix open source builds, change WrapJavaInputStream's
name back to CreateJavaInputStreamAdaptor.

Remove FIXME in CopyJavaInputStream, and return a more generic type,
since the more specific type was only needed by a change in external/webkit,
which is being reverted since it depends on unreleased code.

Change-Id: I89b0431e357b509a2a0c17a624b31bd49d29070f
raphics/BitmapRegionDecoder.cpp
raphics/CreateJavaOutputStreamAdaptor.cpp
raphics/CreateJavaOutputStreamAdaptor.h
raphics/Picture.cpp
f7142e3e8bfba982ad73a7c7a6a992491b7cfb43 29-Aug-2013 Leon Scroggins III <scroggo@google.com> am af172519: am 4b299312: Merge "Replace stream wrap-function w/ more specific ones" into klp-dev

* commit 'af1725190fbb8dd7c29726f8b7c072f3af734aed':
Replace stream wrap-function w/ more specific ones
4b2993123bf9a1c56d0a16b032612834dd418520 29-Aug-2013 Leon Scroggins III <scroggo@google.com> Merge "Replace stream wrap-function w/ more specific ones" into klp-dev
f5b43bdc6231df8b646d5bbb215e639230f37260 29-Aug-2013 Mike Klein <mtklein@google.com> SkTScopedPtr -> SkAutoTDelete in Android

Change-Id: I8f0312f34e112d302b05852c31308a43967e7a3f
raphics/BitmapRegionDecoder.cpp
ca32021b43f326af7d3f4ae041f8db297f98a518 20-Aug-2013 Leon Scroggins III <scroggo@google.com> Replace stream wrap-function w/ more specific ones

The current stream wrapper returns a potentially incorrect
value for a call to getLength(), is typically copied into
another stream (not always in the same way), and doesn't
always take advantage of its underlying data (like when it
is an Asset). The overall goal of this CL is to provide the
caller with something that is ready to use, depending on
what is asked for. If a copy is desired, the copy is made
before being returned to the caller.

core/jni/android/graphics/Bitmap.cpp:

Include SkStream.h, since it is no longer included by
CreateJavaOutputStreamAdaptor's header file.

core/jni/android/graphics/BitmapFactory.cpp:

Pass an SkStreamRewindable to decoding functions, as Skia
decoders will be updated to only take an SkStreamRewindable
(which makes more sense because they require rewinding).

Call the more specific GetRewindableStream to get a
rewindable stream.

Remove copyAssetToStream which has been moved to Utils.

In nativeDecodeAsset, pass forcePurgeable as allowPurgeable
in doDecode. Technically the old code worked, but it checked
the BitmapOptions again.

Remove getFDSize, which is no longer used.

core/jni/android/graphics/BitmapRegionDecoder.cpp:

Remove redundant buildSkMemoryStream. nativeNewInstanceFromStream
now calls CopyJavaInputStream, which handles the copy.

Copy the Asset directly, using common code, rather than creating
an AssetStreamAdaptor to copy.

core/jni/android/graphics/CreateJavaOutputStreamAdaptor.cpp:
core/jni/android/graphics/CreateJavaOutputStreamAdaptor.h:

Provide new interfaces to access data from a Java InputStream.
The new interfaces are more specific about what type of stream
is desired.

Use forward declarations where possible.

Remove doSize, which gives a misleading answer to the question
of how long the entire stream is.

TODO: Only call FindClass etc once.

core/jni/android/graphics/Movie.cpp:

Check for an asset stream, and use it if possible. Then call
GetRewindableStream if there is not an asset.
Remove the memory leak. Call DeleteLocalRef to delete the
allocated memory.

core/jni/android/graphics/Picture.cpp:

Call the new interface.

core/jni/android/graphics/Utils.cpp:
core/jni/android/graphics/Utils.h:

Make AssetStreamAdaptor inherit from SkStreamRewindable so it
can be passed to Skia decoding functions once they require it.

Add CopyAssetToStream (moved from BitmapFactory.cpp) so it can
be used by multiple files.

graphics/java/android/graphics/BitmapFactory.java:

Remove the call to mark, which is now done natively.

Remove the BufferedInputStream. Mark/reset is now handled
by native code.

Allow decodeStream to handle a FileInputStream by using the
FileDescriptor, if it is seekable. In decodeFileDescriptor,
call nativeDecodeStream instead of decodeStream so this new
functionality will not loop.

Call setDensityFromOptions in decodeFileDescriptor.

graphics/java/android/graphics/BitmapRegionDecoder.java:

Remove the BufferedInputStream. Mark/reset is now handled
by native code.

TODO: ADD TESTS!

Requires https://googleplex-android-review.googlesource.com/#/c/344317/

BUG=https://b.corp.google.com/issue?id=8432093

Change-Id: I4419b70b3482325c98ecc673dbfc4613f1b18581
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/BitmapRegionDecoder.cpp
raphics/CreateJavaOutputStreamAdaptor.cpp
raphics/CreateJavaOutputStreamAdaptor.h
raphics/Movie.cpp
raphics/Picture.cpp
raphics/Utils.cpp
raphics/Utils.h
28fe1ee579db0f50beca525f24b35de5e898fa34 27-Aug-2013 Chris Craik <ccraik@google.com> Forward compatibility fix

Change-Id: Ib031372d43881a9bb7af1e51fb2c7cf55e03a326
raphics/GraphicsJNI.h
c6ad1f438461e4dc7e33a3f02ae4263799f6e954 27-Aug-2013 Leon Scroggins III <scroggo@google.com> am 8f564fbe: am 3871fdb9: Merge "Fix unpremul setting in BitmapRegionDecoder." into klp-dev

* commit '8f564fbef3f8d1916662ededb33cb541802953d0':
Fix unpremul setting in BitmapRegionDecoder.
2cc409ae52a2a50f54195579a000e98f403de9be 26-Aug-2013 Leon Scroggins III <scroggo@google.com> Fix unpremul setting in BitmapRegionDecoder.

requireUnpremultiplied should be the opposite of BitmapOptions.
inPremultiplied, as in BitmapFactory.

Fixes CTS tests.

BUG=10490308

Change-Id: I21b8c057ccdc9b35c69730a7fe8c3b6802ee6dd8
raphics/BitmapRegionDecoder.cpp
ed2515e853a0440555d76b2b935086211107dcef 21-Aug-2013 Chris Craik <ccraik@google.com> am 908d9bfa: am dc70afae: Merge "Add inPremutiplied option to BitmapFactory.Options, functionality in Bitmap" into klp-dev

* commit '908d9bfafd576755d06f0566fc4cac3831476f63':
Add inPremutiplied option to BitmapFactory.Options, functionality in Bitmap
1abf5d62429e5a9329520b2f7c2b5a5e7a8e72ec 16-Aug-2013 Chris Craik <ccraik@google.com> Add inPremutiplied option to BitmapFactory.Options, functionality in Bitmap

bug:2248948

Change-Id: I8fdd649332667598504a1076d5a447572bd53086
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/BitmapFactory.h
raphics/BitmapRegionDecoder.cpp
raphics/Canvas.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
13656743cc21bac43676568314366497346713ee 20-Aug-2013 Romain Guy <romainguy@google.com> Make color filters mutable

Change-Id: I3d035d24a75e09db13d136a22bd7dbd326d0ce36
raphics/ColorFilter.cpp
3ed72781a0b155a88e52c8d295f50daab8cfb9ae 15-Aug-2013 Romain Guy <romainguy@google.com> Convert 4444 bitmaps to 8888
Bug #10206452

Change-Id: I928c9189b0d80741490b01a739959d8c2d5312a7
(cherry picked from commit a2cdb59b186d0ee51f110c1a7d358911573d48bf)
raphics/Bitmap.cpp
5893a97cbf398ca3e1bff5444454343d94e25a4c 09-Aug-2013 Mathias Agopian <mathias@google.com> Merge "fix-up dependencies to gl headers" into klp-dev
e3eae73abb5e429d9747f9c36ab025219e68bb26 09-Aug-2013 Mathias Agopian <mathias@google.com> fix-up dependencies to gl headers

Change-Id: I9f176847587db1f9ccee2bc425106d277ffceee6
raphics/SurfaceTexture.cpp
667fe1039feae068d3333de8fb7115313f4a517b 03-Aug-2013 Jonathan Dixon <joth@google.com> Refactor Canvas.drawPicture() to delegate to Picture

Bug: 9814370

To allow WebView.capturePicture() to return a subclass, we need to
ensure the subclass is always consulted when being drawn into a canvas.

Change-Id: Ia0357f95b6fafb3ac81e6bcfaef05739e619897a
raphics/Canvas.cpp
52a9a10b6b8c7b7a9f97777541841b94d4fd9754 02-Aug-2013 Mathias Agopian <mathias@google.com> Clearly separate consumer and producer interfaces

Bug: 9265647
Change-Id: Ic68e91788d0a05251e1d2fb9f9d4de403c7099bf
raphics/SurfaceTexture.cpp
5827cb5059ed0eec4c73adf1acbd7ee47b2c5c8f 26-Jul-2013 Derek Sollenberger <djsollen@google.com> Changes needed to support Skia at r10377.

Change-Id: Id1e1c8c5938ee1a33c6fa3caabd2c28e89243eb4
raphics/BitmapFactory.cpp
raphics/BitmapRegionDecoder.cpp
raphics/GraphicsJNI.h
raphics/Picture.cpp
8018c8db8221aa604b3c083e09d173cc27e53d83 30-Jul-2013 Romain Guy <romainguy@google.com> Add path ops API

Path ops can be used to combine two paths instances in a single path
object. The following operations can be used:

- Difference
- Reverse difference
- Union
- XOR
- Intersection

To use the API:

Path p1 = createCircle();
Path p2 = createRect();

Path result = new Path();
result.op(p1, p2, Path.Op.DIFFERENCE);

This code will subtract the rectangle from the circle and generate
the resulting path in "result."

Change-Id: Ic25244665b6691a7df0b0002a09da73d937b553b
raphics/Path.cpp
e591b49de038a9942cbcc77540c03e85c96e3dcb 25-Jul-2013 Mathias Agopian <mathias@google.com> single buffer mode for SurfaceTexture

Bug: 9891035
Change-Id: Ib9cc2b64f7ff3c084ef1d7db442db8e7a24a923d
raphics/SurfaceTexture.cpp
aff14e7008d65ae01c8552ea9d991c060f037534 25-Jul-2013 Alex Ray <aray@google.com> libandroid_runtime: android_print needs NELEM def

NELEM is defined many places in the framework, so this gives
android_print_PdfDocument.cpp one of them (JNIHelp.h). Without this
updating an upstream library (libskia) to remove an NELEM definition
causes this file to break.

Change-Id: Ifd033f9bd92b8902b6035ec5a8381cb9debd87ce
rint/android_print_pdf_PdfDocument.cpp
d84feebba428d2f5adc021353ae24d3d2737220a 20-Jul-2013 Mathias Agopian <mathias@google.com> Merge "update to new Consumer APIs"
ef5498edf62eb439b4c3f980422c3513e23b5ee9 19-Jul-2013 Chris Craik <ccraik@google.com> Merge "Add reconfigure method to Bitmap"
c84d203da21c3ae3ded94c79c035d41b27809b3b 13-Jul-2013 Chris Craik <ccraik@google.com> Add reconfigure method to Bitmap

bug:9797004

Grants a means to reuse a bitmap's allocation for different
width/height/Config without going through
BitmapFactoryOptions.inBitmap

Change-Id: Ib62319f3bd96c451fc1636288adf06a8275b4e3d
raphics/Bitmap.cpp
e32632682ca9207bd247ca27012cf670b5c23f54 17-Jul-2013 Mathias Agopian <mathias@google.com> update to new Consumer APIs

Change-Id: I8649f3add40e0aeeeb0396b98e2cb93312e8e990
raphics/SurfaceTexture.cpp
377d7bd543235148bf6dc956776007345b4d09c1 16-Jul-2013 Mathias Agopian <mathias@google.com> Merge "always pass the BufferQueue explicitely to consumers"
d63ee7565211d9a5dd4251079e3073886562b6d6 15-Jul-2013 Chris Craik <ccraik@google.com> Merge "Add webp to BitmapFactory.Options outMimetype"
b550929b7a4b0d5f9645a7a1ebf287d3f13cf1af 13-Jul-2013 Mathias Agopian <mathias@google.com> always pass the BufferQueue explicitely to consumers

Change-Id: I32e380979a3f4c6b1dfb440cc5b5c3d30d7607db
raphics/SurfaceTexture.cpp
95587f9045443f8201d01db1d2bee8ae79edab8c 13-Jul-2013 Chris Craik <ccraik@google.com> Add webp to BitmapFactory.Options outMimetype

Change-Id: Id0d5b4d6c2c5b21fa0b31f1a5ada6275fdc38f44
raphics/BitmapFactory.cpp
787e35793f47abdb6cc10f328cd58d362c7bd250 12-Jul-2013 Romain Guy <romainguy@google.com> Trace bitmaps decoding

Also remove dead code

Change-Id: Ie931b21858ccbe6ee4def54caf028fd2aed23317
raphics/BitmapFactory.cpp
e3b0a0117a2ab4118f868a731b238fe8f2430276 27-Jun-2013 Romain Guy <romainguy@google.com> Refcount 9-patches and properly handle GC events

This change adds refcounting of Res_png_9patch instances, the native
data structure used to represent 9-patches. The Dalvik NinePatch class
now holds a native pointer instead of a Dalvik byte[]. This pointer
is used whenever we need to draw the 9-patch (software or hardware.)

Since we are now tracking garbage collection of NinePatch objects
libhwui's PatchCache must keep a list of free blocks in the VBO
used to store the meshes.

This change also removes unnecessary instances tracking from
GLES20DisplayList. Bitmaps and 9-patches are refcounted at the
native level and do not need to be tracked by the Dalvik layer.

Change-Id: Ib8682d573a538aaf1945f8ec5a9bd5da5d16f74b
raphics/NinePatch.cpp
6b0437c2c7a552c8195956444facff3532e25c21 24-Jun-2013 Derek Sollenberger <djsollen@google.com> Fix SkASSERT errors resulting from the order objects are allocated
on the stack.

Change-Id: I24649fed5c069d8d3777d153e8fb31a55a9cf7a1
raphics/BitmapFactory.cpp
ff4adde5737be08d3e2d03fbe588c591d27d4a74 10-Jun-2013 Svetoslav Ganov <svetoslavganov@google.com> Generate PDF from Canvas.

This change adds simple APIs that enable an Android application
to generate a PDF document by drawing content on a canvas.

Change-Id: Ibac93d7c37b01a376ce7c48238657d8c7698d588
rint/android_print_pdf_PdfDocument.cpp
8870538f7c8d32187255707bc3217bd3625d397e 15-Jun-2013 Victoria Lease <violets@google.com> make setHinting(HINTING_ON) kNormal_Hinting

Previously, the default hinting mode for a freshly-constructed Paint
object is equivalent to Skia's kNormal_Hinting mode, in which font
hints are respected if available. Calling
Paint.setHinting(HINTING_ON), however, is equivalent to setting
Skia's kSlight_Hinting mode, in which font hints are ignored in
favour of freetype-generated autohints.

This discrepancy is bad for a variety of reasons:
- Once Paint.setHinting() has been called, it is impossible to return
to the default hinting level.
- Calling paint.setHinting(otherPaint.getHinting()) can result in
paint having a different hinting level than otherPaint.
- Paint.setHinting(HINTING_ON) actually results in font hints being
ignored, which is perhaps the opposite of the intended behaviour.

This commit resolves these discrepancies by making HINTING_ON
correspond to Skia's kNormal_Hinting setting.

Change-Id: Iefb8e051ef53bea783e6f3be37748985ec397bc5
Bug: 9466164
raphics/Paint.cpp
7a56be0915b4ff7cecfbc88fc0a7d567dc58ee58 13-Jun-2013 Svetoslav Ganov <svetoslavganov@google.com> Revert "Generate PDF from Canvas."

This reverts commit 923c633ccfda45312fec5a3484b6cc1308cc71ab

Change-Id: Ie49f593ec702c1ecf96a5cc1fafa680c1db08747
rint/PdfDocument.cpp
923c633ccfda45312fec5a3484b6cc1308cc71ab 10-Jun-2013 Svetoslav Ganov <svetoslavganov@google.com> Generate PDF from Canvas.

This change adds simple APIs that enable an Android application
to generate a PDF document by drawing content on a canvas.

Change-Id: Iddcd126b3af37c73d99262f6b276caa07b998c1d
rint/PdfDocument.cpp
34bff87b32a10f6267e76a7de0b287eb6a4633f9 06-Jun-2013 Chris Craik <ccraik@google.com> Merge "Add support for post-decode density scaling with reuse"
1e97ceb46991183a9286bb5ed8308e718e346c1f 06-Jun-2013 Chris Craik <ccraik@google.com> Merge "Support all formats for BitmapFactory.Options.inBitmap"
905e8246ef0bd20ee28d81ce3da0c5e5fc8e3913 05-Jun-2013 Chris Craik <ccraik@google.com> Add support for post-decode density scaling with reuse

Also, simplifies scaling path, removing java variant - we always do
the scaling in native, which has the benefit of avoiding non-native
temporary allocations

Change-Id: I39c2219f5d77a267719629704e65611cf4388a82
raphics/BitmapFactory.cpp
7e8c03c0fed64c73a4f0cfb96a2c6905b348a143 03-Jun-2013 Chris Craik <ccraik@google.com> Support all formats for BitmapFactory.Options.inBitmap

bug:9194265

Instead of using custom code in skia to avoid allocations, use a
custom allocator that reuses the allocations from the inBitmap.

In order to avoid inconsistent state, the decode is done in a
separate bitmap and swapped into the existing native bitmap.

Eventually, we'd like to support inScaled=true completely avoiding
java allocations.

Change-Id: Ic4a2f2373b100a80a32c1cdebb7bcb726711c8a7
raphics/BitmapFactory.cpp
c648ed7303c7a0cfc8ad9c2f7eb16370d57f804a 30-May-2013 Derek Sollenberger <djsollen@google.com> Merge "Modifications needed for updating Skia to r9286."
9f58361e98be7386a4eadd3aa254e9b7d09d0a3b 21-May-2013 Chris Craik <ccraik@google.com> Support larger bitmaps in BitmapFactory.Options.inBitmap

bug:8121994

Adds a new distiction between bitmap size and the allocation
(pixel ref/buffer) used to store its data.

BitmapFactory.inBitmap will allow a bitmap to be reinitialized with
new data if the bitmap being decoded is (after sampleSize) equal or
smaller.

Change-Id: I747750a735c858882df3af74fca6cdc46f2a9f81
raphics/BitmapFactory.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
d7a80774f0a2175f9ee81a7741f9a171c78e0b8b 28-May-2013 Derek Sollenberger <djsollen@google.com> Modifications needed for updating Skia to r9286.

bug: 8719528
Change-Id: I260fefb93c5a8c5dec86acdec66cbe55a2ee8a92
raphics/Paint.cpp
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
41541825bc90dac740e424cdd41a8c997e15cdb7 04-May-2013 Chris Craik <ccraik@google.com> Use individual glyph positions to determine text bounds.

bug:8766924

Previously text bounds were calculated to be from 0 to totalAdvance in
the X, and from the font's top to bottom. These are incorrect,
especially in light of the font fallback mechanism.

Now, we calculate the bounds of the text as we layout each glyph.
Since these are much tighter bounds in the common case, this
significantly reduces the amount of clipping required (which in turn
enables more aggressive text merging).

Change-Id: I172e5466bf5975bf837af894a9964c41db538746
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
4eb3c132612d854ac0f1c8a2073b9d9730f6a8cd 17-May-2013 Romain Guy <romainguy@google.com> am 25f6f4f5: am 3c1ad55f: Merge "Update Canvas.getClipBounds to not account for AA clips." into jb-mr2-dev

* commit '25f6f4f5d082828fe0eb4f24be2bfaa15b71242e':
Update Canvas.getClipBounds to not account for AA clips.
00a33a8ce8ed8863786fa3a0cd313da57aae2af1 16-May-2013 Derek Sollenberger <djsollen@google.com> Update Canvas.getClipBounds to not account for AA clips.

This preserves the existing behavior at the SDK level while skia
investigates a more comprehensive solution.

bug: 8986473
Change-Id: Ief82dcfd47f1ba08d28d43402b3c28694f94f2e4
raphics/Canvas.cpp
0c8c0add4e552fe910d787c2aa9253749b1c7b48 09-May-2013 Derek Sollenberger <djsollen@google.com> am c195ef73: am bee78812: Merge "Fix bug where we incorrectly clipped the bounds to the device size." into jb-mr2-dev

* commit 'c195ef73445c3ba605355798b9f1f9a78bc52f11':
Fix bug where we incorrectly clipped the bounds to the device size.
8987f06f9c04648fd7c0bfff97cb3ecb3b58fdaf 09-May-2013 Raph Levien <raph@google.com> resolved conflicts for merge of 7e433f10 to master

Change-Id: Ifa3a144c791c0143c62f4aa23a5db57a93c32a17
bee78812d0b3fc3d877ed0d954a0bb21ab7f2f3b 09-May-2013 Derek Sollenberger <djsollen@google.com> Merge "Fix bug where we incorrectly clipped the bounds to the device size." into jb-mr2-dev
dde8e539c3d76c98360e4cd1151cb15cba78a6b0 09-May-2013 Raph Levien <raph@google.com> Merge "Fix bug 8717690 Full-width Latin Letters Garbled on Tumblr App" into jb-mr2-dev
708144e828b1a549567ce50cd8ed3cda62930501 09-May-2013 Derek Sollenberger <djsollen@google.com> Fix bug where we incorrectly clipped the bounds to the device size.

This CL also updates the documenation to make it clear that the API
returns in local space, not clipped to the size of the bitmap/device.

bug: 8747526
Change-Id: I389844672ce955341863f9940c3b401ab00dc1dc
raphics/Canvas.cpp
dd0a91294bc6b57c701bdb85b9e920207eeae55a 07-May-2013 Raph Levien <raph@google.com> Fix bug 8717690 Full-width Latin Letters Garbled on Tumblr App

For fullwidth latin (or, more generally, a font considered as a complex
script, but not supported by the font specified), and for a font other
than a system default font, we were getting a mismatch in baseGlyphCount
between the shaping and painting fonts.

This patch preserves the original typeface in this case. In that sense,
it is a slightly more general fix for bug 8127795.

Change-Id: Ibdbfdb34eb7dc39cc8f0784a67c93c9af4ce6ab2
raphics/TextLayoutCache.cpp
41f7f9c5bc1dbdefc819fc36dcdb0bb3ccc21135 24-Apr-2013 Raph Levien <raph@google.com> am fdd40823: am 22a3344c: Merge "Fix for bug 8695466 GPOS combining mark positioning broken before space" into jb-mr2-dev

* commit 'fdd408233db5bd70cb43ddf2a49a85bd748da5b9':
Fix for bug 8695466 GPOS combining mark positioning broken before space
9d47db23ff0f943dd959a9a8501563b6975c4781 23-Apr-2013 Raph Levien <raph@google.com> Fix for bug 8695466 GPOS combining mark positioning broken before space

This patch makes segmentation into script runs behave the same in RTL
as in LTR modes - so that inherited script characters are always
associated with the preceding run. Otherwise, for a sequence such as
u+0631 u+064d u+0020, it would get split after the first character,
which would lose the ability to correctly position the u+064d mark.

Change-Id: I3c12ba1b77d18334f55e707f518be1046e6b339b
raphics/TextLayoutCache.cpp
af1653a851eefb2302d2cb1c7ef3c7325103f2dd 17-Apr-2013 Victoria Lease <violets@google.com> resolved conflicts for merge of 6c18e2c8 to master

Change-Id: Idb4679247b201a1f453c63fee5b45b12b03a67a1
cc0f9d8469ac0aa39ca2c2c6e6afe309ab6e69a7 16-Apr-2013 Victoria Lease <violets@google.com> use appropriate fallback chain for style

TextLayoutShaper was defaulting to the Regular-style fallback chain
for all unknown scripts. This became problematic in that the
codepoint->glyphID enumeration stage of shaping was always using the
Regular-style fallback chain for unknown scripts, and there's no
guarantee that glyph indices are compatible between fallback chains.

Defaulting to a style-appropriate fallback chain addresses this
issue, and probably unreported but related issues, as well.

Bug: 8189208
Change-Id: I6ecf531c74d71a8e4a5359d23439ccc950b0cf80
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
7a5583fe36f0686daecd961d4b2de090a000deac 10-Apr-2013 Derek Sollenberger <djsollen@google.com> am 8225c5b3: am c37b63d6: Merge "Ensure that a canvas is always backed by some form of SkDevice." into jb-mr2-dev

* commit '8225c5b3d925324dac7703fba0fd5a0f126afed6':
Ensure that a canvas is always backed by some form of SkDevice.
45fa0cbc54f46a2c55b7db9501ff74f539190bd1 09-Apr-2013 Derek Sollenberger <djsollen@google.com> Ensure that a canvas is always backed by some form of SkDevice.

bug: 8518884
Change-Id: Id6c597179878ce5b938c00422e88bef5f12e2e1f
raphics/Canvas.cpp
109109cdd5004789d5caf6da743986f26cb54e7b 03-Apr-2013 Derek Sollenberger <djsollen@google.com> Refactoring code to support r8352 of Skia.

Change-Id: Ica1463c84edaf7a46566d1ff792f7f73cef31997
raphics/Graphics.cpp
raphics/HarfBuzzNGFaceSkia.cpp
raphics/TextLayoutCache.cpp
626d3c228116103e95d4429b06dad70f9812561a 27-Mar-2013 Victoria Lease <violets@google.com> bidiFlags != SkPaint::Flags

We've a number of native functions in the text layout path that take
a bidiFlags argument. We've a number of callers of those functions
passing in SkPaint::Flags in that slot. This completely breaks text
directionality for the affected functions, as
SkPaint::kAntiAlias_Flag happens to share values with kBidi_RTL,
resulting in anti-aliased SkPaints measuring text as if it were RTL,
and non-anti-aliased SkPaints measuring text as if it were LTR,
regardless of the actual text directionality. Oops!

To address the issue, this commit replaces erroneous calls to
SkPaint.getFlags() with the value of Paint.mBidiFlags, and includes
the necessary plumbing to get that value where it needs to be.

Bug: 8471481
Change-Id: I2d04b70defed3130fc1ad13f4c9098f5fce4ffde
raphics/Paint.cpp
665f02c66702b77db25e950ff433230186bc3243 20-Mar-2013 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #8437358 Clean any ICU related code from TextLayout / Paint and their dependencies

- remove the ICU related methods and update the methods using the "reserved" argument
- update to CTS in another CL too

Change-Id: I5509736568c342d9d17bfeafc17951117ab5d3cc
raphics/Paint.cpp
raphics/TextLayout.cpp
raphics/TextLayout.h
da12f389eb4be0c08ca3fa9ca7663f4977858df5 15-Mar-2013 Fabrice Di Meglio <fdimeglio@google.com> Revert "Clean Paint.mBidiFlags as it is no longer used"

This reverts commit 6d9fe5bd22b531bfce69b146254a4791c76acddc.
raphics/Canvas.cpp
raphics/Paint.cpp
raphics/TextLayout.cpp
raphics/TextLayout.h
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
19f46b0d7a1cdba362bc3d6fc8e9251307e96bd4 15-Mar-2013 Fabrice Di Meglio <fdimeglio@google.com> Revert "Fix bug #8194572 Chrome SIGBUS'es on launch around TextLayoutCacheKey"

This reverts commit ebcacc785b0883c9435a3e850f790785fba93370.
raphics/Canvas.cpp
a4bf8114a73371b51a0eba9d5d61dfeb597a1abb 15-Mar-2013 Fabrice Di Meglio <fdimeglio@google.com> Revert "fix argument mismatches in Paint JNI"

This reverts commit b61fb10fe435b74a761e82f517abd0320f22193e.
raphics/Paint.cpp
b1d90c8f60f71422196c337f1d078b68867f5710 07-Mar-2013 Mathias Agopian <mathias@google.com> fix JNI use of incStrong/decStrong

Change-Id: Ia11b404dea483dc19bbc30f4d7bcff516655e180
raphics/SurfaceTexture.cpp
5b6591c1d058a2c8008ba6f77ee0e978a84b78e9 28-Feb-2013 Derek Sollenberger <djsollen@google.com> fix issue when replacement bitmap is larger than original.

getTotalClip() returns the canvas bounds even if no explicit clip
was set. This CL fixes that issue by only transfering clips that
were explicitly set to the new canvas.

bug: 8255582
Change-Id: I0144d430e7718151ad93d988fcf20b412f74b256
raphics/Canvas.cpp
1b63e60abd3082f539b4e1f4562eec2005383ba5 21-Feb-2013 Derek Sollenberger <djsollen@google.com> Fix use case where the Java Canvas is reused.

When provided with a new bitmap device the canvas will retain
certain information such as it's matrix and clip.

bug: 8167188
Change-Id: I20ac8a24eebc85fb7c147504a103ce9a95b530b3
raphics/Canvas.cpp
76f56dd598045dadae6dee5e8547bd077b980d5c 15-Feb-2013 Mathias Agopian <mathias@google.com> am ceec31b7: Merge changes I5a218ca1,I853a76d9

* commit 'ceec31b7dab6a23e443d5dcbcfac4a23b720cfde':
Refactoring: Rename SurfaceTextureClient to Surface
clean-up following Surface split
df93fdb6c0d00bcbf548c4f1fa16be8bc3b15334 15-Feb-2013 Romain Guy <romainguy@google.com> am aa8307b9: Merge "Remove obsolete header file"

* commit 'aa8307b991b9fca5403b5d7f43659b92527af4fd':
Remove obsolete header file
ceec31b7dab6a23e443d5dcbcfac4a23b720cfde 15-Feb-2013 Mathias Agopian <mathias@google.com> Merge changes I5a218ca1,I853a76d9

* changes:
Refactoring: Rename SurfaceTextureClient to Surface
clean-up following Surface split
52800617946c456e78ed010c82d0ec4358368164 15-Feb-2013 Mathias Agopian <mathias@google.com> Refactoring: Rename SurfaceTextureClient to Surface

Change-Id: I5a218ca11abeeec05e3a4c3cfc581bcc788814ea
raphics/SurfaceTexture.cpp
13ba0054846ce630ca31e8f26169fd9388faee02 15-Feb-2013 Romain Guy <romainguy@google.com> Remove obsolete header file

We now use the same mechanism to compare keys everywhere in libhwui.

Change-Id: I8b3cb25b13f4f38eb6f12aed0356f796a773617c
raphics/TextLayoutCache.h
c85637f0e60964af101a9c43a1ae92ee2d1be168 15-Feb-2013 Victoria Lease <violets@google.com> am c69bce2e: Merge "fix argument mismatches in Paint JNI"

# Via Android (Google) Code Review (1) and Victoria Lease (1)
* commit 'c69bce2e41c70da35e1b6a2ab5ec44469ab14c80':
fix argument mismatches in Paint JNI
b61fb10fe435b74a761e82f517abd0320f22193e 15-Feb-2013 Victoria Lease <violets@google.com> 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
raphics/Paint.cpp
c504c4e51d93108e60ffe5a5e6c89e2ab7bb0511 14-Feb-2013 Fabrice Di Meglio <fdimeglio@google.com> am 336fcac3: Merge "Fix bug #8194572 Chrome SIGBUS\'es on launch around TextLayoutCacheKey"

# Via Android (Google) Code Review (1) and Fabrice Di Meglio (1)
* commit '336fcac31ddccc7e7a6773d03e7cb17967ebb898':
Fix bug #8194572 Chrome SIGBUS'es on launch around TextLayoutCacheKey
ebcacc785b0883c9435a3e850f790785fba93370 14-Feb-2013 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #8194572 Chrome SIGBUS'es on launch around TextLayoutCacheKey

- remove remaining dirFlags
- clean method names

Change-Id: I404b643cd10321e977530528168d1d415b3f2eca
raphics/Canvas.cpp
c932760f667cf56ca7a1aeffde505745dc3632e1 14-Feb-2013 Chris Craik <ccraik@google.com> Merge "Revert "Merge remote-tracking branch 'goog/master-chromium' into 'goog/master'" DO NOT MERGE"
0c33ecd209d884a9a2b9ad807cb798583b890a08 13-Feb-2013 Fabrice Di Meglio <fdimeglio@google.com> Merge "Clean Paint.mBidiFlags as it is no longer used"
7c1a49f5f5ed6613d736464bf5001b777e89ced2 13-Feb-2013 Chris Craik <ccraik@google.com> 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
raphics/BitmapFactory.cpp
raphics/Canvas.cpp
raphics/NinePatchImpl.cpp
raphics/Region.cpp
raphics/TextLayoutCache.cpp
raphics/Typeface.cpp
ded5ed963c3939a2668ce1152ab60efb7bbbb2bd 12-Feb-2013 Victoria Lease <violets@google.com> 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
raphics/TextLayoutCache.cpp
6d9fe5bd22b531bfce69b146254a4791c76acddc 12-Feb-2013 Fabrice Di Meglio <fdimeglio@google.com> Clean Paint.mBidiFlags as it is no longer used

See bug #7623824

Change-Id: Ie2f9422821f6dcc73c99e8695f448e966b587b1d
raphics/Canvas.cpp
raphics/Paint.cpp
raphics/TextLayout.cpp
raphics/TextLayout.h
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
7f2e4efa96c6e3ab636c5e70b5fc09b0153d30e8 04-Feb-2013 Michael Jurka <mikejurka@google.com> 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
c24b14481527e2f87ddb3a156b8217d32c645b10 04-Feb-2013 Michael Jurka <mikejurka@google.com> Merge "Don't mark recycled bitmaps as immutable"
afce5a4008c494f6384e1b6b2fb4f13d33e917cb 04-Feb-2013 Michael Jurka <mikejurka@google.com> 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
raphics/BitmapFactory.cpp
d0351a67f17d93038c17955381c5eff3d0679268 04-Feb-2013 Derek Sollenberger <djsollen@google.com> 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.
250f8ef24830498c2e1753d3a562ae50e609815b 01-Feb-2013 Derek Sollenberger <djsollen@google.com> Fix return type mismatch in Region's JNI code.

bug: 7620006
Change-Id: Iddca9b3739b0c116a80a900e06cede338b868e17
raphics/Region.cpp
8c02c724758b3587ae5d5ffbb970070368940c7d 17-Jan-2013 Jeff Sharkey <jsharkey@android.com> am 54298652: Merge "Reduce TextLayoutCache logging."

* commit '5429865241f1e63f52fbbcf5d97fcca0ec68e793':
Reduce TextLayoutCache logging.
3f32a313db6f765e743bee0693febfff6eb95c75 17-Jan-2013 Jeff Sharkey <jsharkey@android.com> Reduce TextLayoutCache logging.

Change-Id: I09ae49b0a9708de219b18b00ce5b82ee4a0b2bcd
raphics/HarfBuzzNGFaceSkia.cpp
7d73eb049fef6abdba3e2dd30dc4a5c10b4a6588 17-Jan-2013 Junichi Monma <monma@google.com> am 6d191ed9: Added the necessary Harfbuzz scripts for rendering Japanese text correctly.

* commit '6d191ed99491f209168e88f3d570e89c6836285b':
Added the necessary Harfbuzz scripts for rendering Japanese text correctly.
6d191ed99491f209168e88f3d570e89c6836285b 17-Jan-2013 Junichi Monma <monma@google.com> Added the necessary Harfbuzz scripts for rendering Japanese text correctly.

bug id : b/8023135

Change-Id: Ie9a69f480026302ff949fdf2b4089e4d95a38fb0
raphics/TextLayoutCache.cpp
1893d443ebdacfc2782c6ebbebf4b6df2036dd3f 16-Jan-2013 Kristian Monsen <kristianm@google.com> am 2d76d4f3: Fix build break in master-chromium

* commit '2d76d4f35ca8d0bcb45159555aa7715b7070a751':
Fix build break in master-chromium
2d76d4f35ca8d0bcb45159555aa7715b7070a751 16-Jan-2013 Kristian Monsen <kristianm@google.com> Fix build break in master-chromium

Include needed headers and sort them correctly.

Change-Id: I8557c98234d86f4d0b105182f4f191a826c9aeb5
raphics/TextLayoutCache.h
0728441b932ab806f3616367554fb0618e49d93a 16-Jan-2013 Raph Levien <raph@google.com> am e45113a1: Merge "Attempt to resolve build breakage on x86"

* commit 'e45113a1564c6e701fcc076813bee276d501c576':
Attempt to resolve build breakage on x86
77b74d4f937a9ef959dbee494888ea7860a6a6d0 15-Jan-2013 Raph Levien <raph@google.com> 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
raphics/HarfBuzzNGFaceSkia.h
49a7e454d1c775ded9ebe1308fd6f51861a2ed0b 15-Jan-2013 Raph Levien <raph@google.com> am 7cd0859a: Merge "Update framework text layout to use Harfbuzz NG"

* commit '7cd0859a735c0c6a489d70d5d96e44e9d1a27be8':
Update framework text layout to use Harfbuzz NG
aaedde51b76901ff05f2a2348eb41f0f5323d954 30-Oct-2012 Raph Levien <raph@google.com> Update framework text layout to use Harfbuzz NG

These are the frameworks changes to use the new version of Harfbuzz.

Change-Id: Idbef325e8fc1c27a9f2296414ddb1f79b778a00e
raphics/HarfBuzzNGFaceSkia.cpp
raphics/HarfBuzzNGFaceSkia.h
raphics/HarfbuzzSkia.cpp
raphics/HarfbuzzSkia.h
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
fc615a0f643408956fc0dc1b997871e2b27cee7e 20-Dec-2012 Derek Sollenberger <djsollen@google.com> Remove calls to SkCanvas::setBitmapDevice()

Change-Id: Ib0aa2f65b77802b105c0e8a9d7cdde2e863d3673
raphics/Canvas.cpp
360b4d9418efc245e47c2241d867a7acdd5c0f61 02-Jan-2013 Siva Velusamy <vsiva@google.com> am af80cdd7: Merge "DdmServer: add controls for OpenGL tracing"

* commit 'af80cdd7dfa28158fa91ab374d8e6d2500de66b1':
DdmServer: add controls for OpenGL tracing
af80cdd7dfa28158fa91ab374d8e6d2500de66b1 02-Jan-2013 Siva Velusamy <vsiva@google.com> Merge "DdmServer: add controls for OpenGL tracing"
0c1761bd37815c3776608a19c8e11d862b3e910c 15-Dec-2012 Siva Velusamy <vsiva@google.com> DdmServer: add controls for OpenGL tracing

Add a new JDWP packet to allow control of OpenGL tracing.

Change-Id: Ic89e2f6299238a612df2f914581049f2cbba088c
pengl/util.cpp
2fa54cef47887808d006f473a7d4f8dd5fb76704 19-Dec-2012 Derek Sollenberger <djsollen@google.com> Merge "Update framework to support r5967 of Skia." into master-chromium
d47f7d8b5fe3a3861d7cbdc5f912235407823c8e 18-Dec-2012 Andy McFadden <fadden@android.com> 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
raphics/SurfaceTexture.cpp
ca79cf69d09efa0c327e9b1237d86a119aea5da7 14-Aug-2012 Derek Sollenberger <djsollen@google.com> Update framework to support r5967 of Skia.

bug: 6906025
Change-Id: Iefdb830ec3aa2ab3472c1c142484a7aa21788a15
raphics/BitmapFactory.cpp
raphics/Canvas.cpp
raphics/NinePatchImpl.cpp
raphics/Region.cpp
raphics/TextLayoutCache.cpp
raphics/Typeface.cpp
82bb813f112d9565faa990e32dbe833f96461892 12-Dec-2012 Jamie Gennis <jgennis@google.com> stop using a deprecated SurfaceTextureClient ctor

Change-Id: Ie6196ba4896c0ab37b9aed3d1a4ffd04c99c5f80
raphics/SurfaceTexture.cpp
059e12ccd20f5c249724a8362d6bac325334ea76 29-Nov-2012 Romain Guy <romainguy@google.com> Use LruCache instead of GenerationCache in libhwui

Change-Id: Ic26ddc7151eb5462bcd243b21daf7187ed6d3bec
raphics/Paint.cpp
c99db2bc460cc795947d99076da380e22a21e493 29-Oct-2012 Igor Murashkin <iam@google.com> Updated android.graphics.SurfaceTexture to use wp for FrameAvailableListener

Bug: 7425644
Change-Id: I7ccdc0ef421df7240d6cff9222c37411b1ecaf01
raphics/SurfaceTexture.cpp
d98efca7383f5f3cdae438a8a8a18f78451a95ba 26-Oct-2012 Raph Levien <raph@google.com> 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
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
aaee13176efb494d28531ae3e2e7ae71c4627dcf 23-Oct-2012 Chet Haase <chet@google.com> 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
547e66531d521eb1eadac87edb0f79f8c2f1bbe0 23-Oct-2012 Chet Haase <chet@google.com> 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
raphics/Bitmap.cpp
7dbf63665b2ea0db304b84439613f047c856e6ea 17-Oct-2012 Bart Sears <bsears@google.com> 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.
0ee71adde01298784a2cbb667c4c1570bdbf0af0 17-Oct-2012 Bart Sears <bsears@google.com> Merge "Fix native crash while saving a panorama." into jb-mr1-dev
4b63f14c96841d02b6bffce987f7705b6aa8e2a9 16-Oct-2012 Wu-cheng Li <wuchengli@google.com> 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
raphics/YuvToJpegEncoder.cpp
raphics/YuvToJpegEncoder.h
ef9f40f11e252d67cede28fea3a3df4880531dcd 17-Oct-2012 Romain Guy <romainguy@google.com> 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
713e1bb9df6bdfc21bd5c40d1a6ecf6c822a4be5 17-Oct-2012 Romain Guy <romainguy@google.com> 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
raphics/Bitmap.cpp
7a6dca427bc21b90f2dc8396c1074e0a1aa3ed24 12-Oct-2012 Keun young Park <keunyoung@google.com> 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
038953da05c641f6551134f710ac0e4f46b624b7 12-Oct-2012 Keun young Park <keunyoung@google.com> 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
raphics/Bitmap.cpp
85e25c478a84521f131a9d3781724dcc0b4dab5c 05-Oct-2012 Raph Levien <raph@google.com> 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
577b07197b1bf1b3903e0bc0f3d48fabfd927b2a 05-Oct-2012 Raph Levien <raph@google.com> 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
raphics/Paint.cpp
997d4283c038646c412d949226975cfc99411675 04-Oct-2012 Raph Levien <raph@google.com> am d8c6c6f5: am 1ca8d35f: am 5a829cbf: Merge "Fix for testPaintFlagsDrawFilter CTS test" into jb-mr1-dev

* commit 'd8c6c6f56630fa466b96dd5359d39a659a1e42f8':
Fix for testPaintFlagsDrawFilter CTS test
e174ae210e4756985c17da5bf4457e2009ec5b61 04-Oct-2012 Raph Levien <raph@google.com> 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
raphics/Canvas.cpp
5472070c4a0ec23c8cf870320c408e270be774c4 02-Oct-2012 Raph Levien <raph@google.com> 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...
832815cb53e951485ff5a0e6c705446d0bfb5883 02-Oct-2012 Raph Levien <raph@google.com> 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
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
d2e74f34003c38111c974dfa187cae6c331f2841 01-Oct-2012 Chet Haase <chet@google.com> am 1dd00221: am bcdaf8cb: am 62ea4363: Merge "Fix texture corruption" into jb-mr1-dev

* commit '1dd002214e9734aa862db9b7e7092aacd737e46d':
Fix texture corruption
6a2d17f71342f981c9df1dc5beff33e30eb3ae2b 30-Sep-2012 Chet Haase <chet@google.com> 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
raphics/Canvas.cpp
5827b5f7b07bbdd53b53ba1494b93dad3761851e 28-Sep-2012 Raph Levien <raph@google.com> am 34614e63: am 54801e12: Merge "Fix for bug 6936752 Tamil text gets truncated on right-hand side" into jb-mr1-dev

* commit '34614e63dced2b0479ab721494fd867604023619':
Fix for bug 6936752 Tamil text gets truncated on right-hand side
1b10241a8f0affab9f46719e46c6fedff9e69b8b 25-Sep-2012 Raph Levien <raph@google.com> Fix for bug 6936752 Tamil text gets truncated on right-hand side

The getTextRunAdvances() method wasn't accounting for the true width of
the text. On closer examination, in Tamil the clusters consist of a
number of glyphs each of which has a nonzero advance (in some other
scripts, the first glyph in the cluster has an advance, and others are
effectively zero). Previously, we were just using the advance of the
first glyph in the cluster. This patch changes the behavior to sum the
advances of all the glyphs within the cluster.

Change-Id: I77a51235f4bb0dfaa72cbb920a8c3b217ad25404
raphics/TextLayoutCache.cpp
8cba91d0d1d900fe9cba2bfc73c4458016b4ff04 21-Sep-2012 Raph Levien <raph@google.com> am 8b0851ca: am 3034d451: Merge "Fix for native crash on image decode OOM" into jb-mr1-dev

* commit '8b0851caf26dfd5e1cc7798e5ff6c6adc3a5e92c':
Fix for native crash on image decode OOM
005bfc694d167b7da4b565a1c4de03592fdbe86e 21-Sep-2012 Raph Levien <raph@google.com> Fix for native crash on image decode OOM

When decoding an image with scaling, if the allocation of the bitmap
data for the scaled bitmap failed, we were just ignoring it and going
on. This was yielding strange native crashes (bug 7196860 and bug
7175536). This patch checks whether the allocation succeeds, and returns
a null bitmap if not.

Of course, if the app really is OOM because it's allocated too many
bitmaps, it'll still get the OOME, but that's a lot nicer than a native
crash or memory corruption.

Change-Id: I8384059ab11c2ab9e93e283b9438d79e6709b7b1
raphics/BitmapFactory.cpp
2a6ecae93d4effa47827029d74f2136b5ae8558d 31-Aug-2012 Derek Sollenberger <djsollen@google.com> Fix Skia assertions where we were allowing immutable bitmaps to be written to.

bug: 7092330
Change-Id: I4a9d1d299244d46172562080c56c8360f5e4af02
raphics/BitmapFactory.cpp
94998c9c4e19d5b439228646f1b283201367b7a0 18-Sep-2012 Jamie Gennis <jgennis@google.com> Merge "SurfaceTexture: remove call to doGLFenceWait" into jb-mr1-dev
917a3b34a33f703503d05aaef4af955a09553703 18-Sep-2012 Jamie Gennis <jgennis@google.com> SurfaceTexture: remove call to doGLFenceWait

This call is no longer needed as the default behavior of the native
SurfaceTexture class is to do the wait whenever updateTexImage is called.

Change-Id: I995686a5989409e21b00fac913bd33c11f806998
raphics/SurfaceTexture.cpp
c1eff0857ebc6abce48ba8c267ab32109dd45ef0 14-Sep-2012 Raph Levien <raph@google.com> am e5905684: am eceb3171: am f4afc401: Merge "framework: fix bug for uninitialized variable"

* commit 'e590568417aa824e7b0e76ae727556d329cb57cf':
framework: fix bug for uninitialized variable
eceb317116d87dada85d06df8fe0e07dd4aec49d 14-Sep-2012 Raph Levien <raph@google.com> am f4afc401: Merge "framework: fix bug for uninitialized variable"

* commit 'f4afc40101c00800c4dc53f165b93f741327416d':
framework: fix bug for uninitialized variable
eb1f5349f8ac51e12e48497bbd2ae37badfe5009 13-Sep-2012 Raph Levien <raph@google.com> Merge "Fix for b7155617 race condition in TextLayoutCache.cpp" into jb-mr1-dev
13ba4e478d19001ddb6828bd1fd8fbc1e0cb208f 13-Sep-2012 Raph Levien <raph@google.com> Fix for b7155617 race condition in TextLayoutCache.cpp

There was the possibility for a race between clearing the caches and
using fonts. This patch simply protects both under the same mLock held
by the TextLayoutCache object.

Change-Id: Ib366e16a9a9ba702a46bc078d1bc0602713991e5
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
f09263e957a3f132899458fc5afe859ba9d62d2e 10-Sep-2012 Jamie Gennis <jgennis@google.com> SurfaceTexture: add updateTexImage synchronization

This change makes the SurfaceTexture JNI updateTexImage call the native
SurfaceTexture's doGLFenceWait method to perform the needed synchronization.

Change-Id: Ie70a1fe6b44d439d1ffe7b97689a421ff8c02fda
raphics/SurfaceTexture.cpp
46e942d500d5ce67a58269cbac3307deca6a5c9f 27-Jul-2012 Zhou Chang <chang.zhou@intel.com> framework: fix bug for uninitialized variable

Some application display error due to uninitialized varibale.
This patch fix the bug

Change-Id: I660169e325ffae60d95c7774aaaeaebf693adf3d
Author: Chang Zhou <chang.zhou@intel.com>
Signed-off-by: Chang Zhou <chang.zhou@intel.com>
Signed-off-by: Chong Xing <chong.xing@intel.com>
Signed-off-by: Hongyu Zhang <hongyu.zhang@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 45356
raphics/Paint.cpp
38f197863a07cd600b45d752fdfa949d8b2e6fa6 29-Aug-2012 Jean-Baptiste Queru <jbq@google.com> am 14c0c989: am 4ba4caed: Merge "Fix SkBitmap::fPixels not being locked correctly"

* commit '14c0c989d21531056a5d0a0739c3ffdd1b04b295':
Fix SkBitmap::fPixels not being locked correctly
14c0c989d21531056a5d0a0739c3ffdd1b04b295 29-Aug-2012 Jean-Baptiste Queru <jbq@google.com> am 4ba4caed: Merge "Fix SkBitmap::fPixels not being locked correctly"

* commit '4ba4caede125ff602b0d93f577f9054a07791ff7':
Fix SkBitmap::fPixels not being locked correctly
35ef567140e42f354be4a98cce6a7666ac085c13 08-Jul-2012 Michal Stawinski <michal.stawinski@sonymobile.com> Fix SkBitmap::fPixels not being locked correctly

In some cases bitmap's pixels where freed during encoding, which
caused a null pointer dereference.
This fix makes sure that underlaying buffer is locked for the whole
process of compression.

Change-Id: I0ac56821f5d333072271dc2670fa30f1562adfa3
raphics/Bitmap.cpp
ac1cbaf2e5575ac75a0160e13089d51a0bb232fa 18-Jul-2012 Billy Hewlett <billyh@google.com> DO NOT MERGE Han Preference

Cherry-pick Ib5dd86950156c5a438f25c289acb839206bb455a from master.

Data: label MTLmr3m with "ja" locale attribute, fallback_fonts-ja.xml removed,
as we only need a single fallback font file
Code: Add locale and variant to TextLayoutCache. Paint.java sets textLocale as
the language (for example, "ja") rather than the language/locale concatenated
(for example "ja_JP")

This checkin, along with Change-Id: Id8c91ae0be6cad8a7ef77a0cd5803676290986c1,
allows text view objects to set their locale dynamically and skia will use the
correct font for the locale.

Change-Id: Ieb60b0d7a39fcfef4f8ce90cd4f6065d33673710
raphics/Paint.cpp
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
42e1e0d482d774cf18a55773e434f02edb9e4462 30-Jul-2012 Romain Guy <romainguy@google.com> Improve gradients

Avoid using textures for common gradients (two stops from 0.0 to 1.0)

Change-Id: Iff55d21b126c8cfc4cfb701669f2339c8f6b131a
raphics/Shader.cpp
a0aa479c0eadd446dc9159195c175e3a5fe083c0 28-Jul-2012 Romain Guy <romainguy@android.com> am 97e27072: am dfac68ea: Merge "Corrected typo when checking InputStream methods"

* commit '97e270721bf29d25b513c1f2be71a8543d048f5d':
Corrected typo when checking InputStream methods
97e270721bf29d25b513c1f2be71a8543d048f5d 28-Jul-2012 Romain Guy <romainguy@android.com> am dfac68ea: Merge "Corrected typo when checking InputStream methods"

* commit 'dfac68eacc60c130e54345d98bd45c99573cb627':
Corrected typo when checking InputStream methods
8ac41bb79e96e240e0e774ff2dff2654cb10669c 03-May-2011 Edward Savage-Jones <edward.savage-jones@sonyericsson.com> Corrected typo when checking InputStream methods

Corrected a small typo where Java InputStream methods are
incorrectly checked when creating a JNI InputStream adaptor.

Change-Id: I5f14897e0d5ddceb4b2af6be46769713f0487624
raphics/CreateJavaOutputStreamAdaptor.cpp
161ebab85d976320f156cb4e55140533ae15f92d 19-Jul-2012 Raph Levien <raph@google.com> Increase text layout cache size in bytes

The mark positioning changes increase the number of bytes needed per
glyph from 6 to 14. This patch compensates by allocating more total
memory for the text layout cache.

Change-Id: I3cf59547394a41779cf6e92e67688b0fdc85f1a3
raphics/TextLayoutCache.h
4f3c8f7026d89a5d79e2621eb6428d5b9b1a25f3 19-Jul-2012 Raph Levien <raph@google.com> Fix overly verbose logging in TextLayoutCache

I meant to log certain debug values only when DEBUG_GLYPHS was set, but
I used #ifdef instead of #if (when it's not set, it's 0, rather than
undefined).

Change-Id: Ic27fee7dd355009c1873f0a2e12614849bbceebd
raphics/TextLayoutCache.cpp
2301d32f7e2ba584abc31ac177dde754385d3c04 18-Jul-2012 Raph Levien <raph@google.com> Software-only implementation of glyph positioning (bug 5443796)

This patch implements glyph positioning in the Skia-based renderer. Note
that it depends on a fix for bug 6833339 being in place (correct
calculation of advance widths under skew and scale transforms),
otherwise there will be regressions.

Careful attention was paid to correct results in a wide variety of
conditions: alignments, text decorations, scale, skew, etc. Many of
these are exercised in the test app attached to bug 6833339.

Note that this patch also changes slightly the way that the total
advance is calculated - the running is accumulated and passed through to
computeRunValues(), so that the x positions of each glyph can be set
according to the total advance of all glyphs (in all runs) appearing
before (plus, of course, the offset for mark positioning).

After committing this patch, text rendering will no longer match between
the software and hardware rendering cases. Implementing positioning in
the hardware renderer will resolve that, and fully implement bug 5443796.

Change-Id: Ie0f7835d48bc120475a19afbfe159aa5304fcaa8
raphics/Canvas.cpp
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
cae28fa0511bb526b4e94e8acfa1ba3b1745576b 11-Jul-2012 Victoria Lease <violets@google.com> Merge "Remove hardcoded typeface pointers"
d6deccb346e913d906f484d279b19e0f6ea18d94 22-Jun-2012 Billy Hewlett <billyh@google.com> Remove hardcoded typeface pointers

There were a number of extraneous typeface pointers, one per
language, in TextLayoutCache. Removing these makes adding additional
supported fonts easier. This checkin now properly
unrefs typefaces returned by SkCreateTypefaceForScript. Additionally,
all harfbuzz shaped fonts (with exceptions Greek, Cyrillic, Hangul)
should call SkCreateTypefaceForScript.

Change-Id: I7dcf603a89e5ff52c6dab8fb87ae1807a79c351c
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
907524851af0d656ba049311f7535a4ba5d2b1d2 10-Jul-2012 Romain Guy <romainguy@google.com> Properly resize paletted bitmaps when adjusting for density

If an app used a GIF file in the wrong density bucket, the auto-scaling
code would not properly resize the bitmap.

This issue affects third party applications, here is the external bug
report:

http://code.google.com/p/android/issues/detail?id=34619

DO NOT MERGE

Change-Id: I7f99b28ad6e6c28bdbcb29bbbadcb215268ff710
raphics/BitmapFactory.cpp
053a82cc18b8ad9b6cb321b57893225411ccf146 10-Jul-2012 Romain Guy <romainguy@google.com> Properly resize paletted bitmaps when adjusting for density

If an app used a GIF file in the wrong density bucket, the auto-scaling
code would not properly resize the bitmap.

Change-Id: I28f6506a94b20d11b3ba53ac442abec2b92e093e
raphics/BitmapFactory.cpp
f62034d89611fbd3e1d41413847241757acd0c10 26-Jun-2012 Raph Levien <raph@google.com> Initialize shaper offset array. Needed for bug 5443796.

Harfbuzz apparently requires the offset array to be initialized to zero,
otherwise it can report corrupt glyph positions. This change also
contains a small amount of refactoring to avoid code duplication.

Change-Id: I2553974f40bc8e0549876c7d31243960ca92a8a2
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
6212a4f2ed2a5921de08b527cd1b25e1d155e56b 25-Jun-2012 Raph Levien <raph@google.com> Fix broken build when DEBUG_GLYPHS is set

Some of the logging lines referred to the "path" variable which no
longer exists. We log the Harfbuzz script instead, which hopefully
provides enough context.

This change only affects debug builds, but we will want to be working
intensively in this space.

Change-Id: I86c3b58c9fa2a8c47812ef5f0b5ce64fd8dcdc20
raphics/TextLayoutCache.cpp
960511848ade732f7dab838a1625729698c7c952 21-Jun-2012 Billy Hewlett <billyh@google.com> Revert "Revert "Use Elegant fonts for Webkit, Compact fonts for Textview""

This reverts commit 6fadccd2484233ed570218b3f97c085ef1a1ec28
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
6fadccd2484233ed570218b3f97c085ef1a1ec28 21-Jun-2012 Billy Hewlett <billyh@google.com> Revert "Use Elegant fonts for Webkit, Compact fonts for Textview"

This reverts commit ecf80965d05e44b3701b3392aeb02028daacf1b0
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
ecf80965d05e44b3701b3392aeb02028daacf1b0 07-Jun-2012 Billy Hewlett <billyh@google.com> Use Elegant fonts for Webkit, Compact fonts for Textview

Fonts can be marked with elegant or compact in fallback_fonts.xml.
Webkit uses elegant fonts, Textview uses compact fonts (the default),
unmarked fonts are used by both.

Bug: 6649136

Change-Id: Ie0debcddc13350bf60fe3139cd7ae533e466f02b
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
29b9885c258b46b00a8caf72ea1a6835d4594981 07-Jun-2012 Victoria Lease <violets@google.com> Merge "Fix hardcoded font path. Allow adding new font path thru Skia changes. Bug: 6609231"
517f67fe4b70c5a1907cb503d62b906a1eed2e1e 05-Jun-2012 Billy Hewlett <billyh@google.com> Fix hardcoded font path. Allow adding new font path thru Skia changes.
Bug: 6609231

Change-Id: I7b28c6f7ac1c227c7059b486635cadb39a6eacc3
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
75394d6d1ba633f6bf0218f563b8876b824c6fcf 03-Jun-2012 Raph Levien <raph@google.com> Fix bug 6558006: SystemUI native heap is huge. Fix memory leak

TextLayoutCache was leaking HB_Face objects, not freeing them when
purging the mCachedHBFaces cache. More full analysis is in the bug.

Change-Id: Ie5cd8b00c36b9d31963183c601cde49cbb73fafb
raphics/TextLayoutCache.cpp
f970c2e6de52ef0da91c3c8f3b48a44303d0eb73 25-Apr-2012 Owen Lin <owenlin@google.com> Nvidia's patch for reusing bitmap in image region decoding.

bug: 5884845
Change-Id: I43d4d86ee94591b0b53393dfba13c7cc5c4e428d
raphics/BitmapFactory.h
raphics/BitmapRegionDecoder.cpp
15cc68ced062a0dbd174718abfb1c783ac1aa433 15-May-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #6495019 Character gets garbled when locale is changed

- add missing cached data clearing. The Shaper was caching the HB_Face so
clear them too
- do minor code refactoring

Change-Id: Ifa86cc63815bdb4b51ce688cf16e986415b1e8c1
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
8bd8d8969380e24fadca64b6977dc20b1cf4d569 10-May-2012 Jeff Brown <jeffbrown@google.com> Merge "Fix possible leak in bitmap decoding." into jb-dev
27d83834143c117cbc0d06147c4374553f26b683 10-May-2012 Jeff Brown <jeffbrown@google.com> Fix possible leak in bitmap decoding.

In one particular error case, we might exit the function without
destroying the bitmap.

Bug: 6467873 (tangentially related)
Change-Id: I3a213cc0a53023d9d0d2a080aed15774f4c4c10c
raphics/BitmapFactory.cpp
92d7f9ff1c0c8a179ee935d86d3c94022980ead2 08-May-2012 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix bug #6408393 Character corruption is caused when locale is changed" into jb-dev
30ca5cd11a23f06f2f8eeaa587685450826f800f 08-May-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #6408393 Character corruption is caused when locale is changed

- free the TextLayoutCache on Locale change

- also free TextLayoutCache when memory is low

Change-Id: I39a37ac8ec3c292cfb1c0eea4bb41ff71897d089
raphics/Canvas.cpp
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
6162876067cbaa93b870aee6e62c682104935fde 26-Apr-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #6318791 Replace the Lohit Devanagari and Tamil with Droid versions

- take care of ttf filename changes and regular/bold versions

Change-Id: Ib71d2537df16ff954cef9619c12d611948d19efe
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
b3482ffbeee30650359e6ab8f3950a83e06963b4 07-May-2012 Marco Nelissen <marcone@google.com> Merge "Fix crash when decoding bitmap" into jb-dev
b2fe3be4fffc9ff1bfbba0c450d64ccd6e6c4011 07-May-2012 Marco Nelissen <marcone@google.com> Fix crash when decoding bitmap

Externally reported crash when decoding corrupted .wmf file.
b/5048623

Change-Id: I1df0861cd36983cb4d1460caa221c54d3fc240af
raphics/BitmapFactory.cpp
cf4284bce11acadb1c36564b067bce3b0b26a9f9 05-May-2012 Fabrice Di Meglio <fdimeglio@google.com> Update Arabic font for SystemUI

- bug #5987379 Need an Arabic font with metrics "compatible" with Roboto
- use the Alt version with GSUB optimizations

Change-Id: I4d8c62cab37a7b010abab602c39899084d347fdc
raphics/TextLayoutCache.cpp
1637dcd16cd314574a58602337a2c7222130b1b9 02-May-2012 Raph Levien <raph@google.com> Use paint typeface for shaping when it supports the requested script.

This is a hackish but workable fix for bug 6415796.

Change-Id: Iaba91e1e53e688a3ee05a1fdb68fd05102e369f2
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
b294435b5c6e0fee8c431ed3f6d77427d3d79dde 01-May-2012 Raph Levien <raph@google.com> Make Arabic script runs longer (for performance) - bug 6426451.

This change avoids selecting the incorrect font for drawing characters
when the first character in a run is a space.

Change-Id: Ibc672560d364b8de8c3e21de1c738c6dc5639395
raphics/TextLayoutCache.cpp
76344241719384f160ee623554f66987d0fcae41 30-Apr-2012 Dianne Hackborn <hackbod@google.com> Fix scaling of layout bounds.

Change-Id: I9d8c8924900fed69030ee3e8d6decee89ca67820
raphics/BitmapFactory.cpp
8f8d9fb52c65e50a32babf67ef764e173d2a5473 26-Apr-2012 Romain Guy <romainguy@google.com> Keep opaque bitmaps opaque after scaling
Bug #6293845

Change-Id: If9e82993f4c9702244ddedb5667421a6fcc7a0c5
raphics/BitmapFactory.cpp
66556c730deba60288adf66ba1685a9d2c724aae 25-Apr-2012 Raph Levien <raph@google.com> Merge "Improve char mirroring in TextLayoutCache"
3632b7f3ef0c6158507724a2496b24b457f3f007 25-Apr-2012 Fabrice Di Meglio <fdimeglio@google.com> Improve char mirroring in TextLayoutCache

- now use ICU u_isMirrored() instead of a small hardcoded list of unicode points

see bug #5961254 Harfbuzz should be able to support Bidi_mirrored unicode attribute

Change-Id: I3243a58558a97930f0e7fdf5e9c1d5695d9393de
raphics/TextLayoutCache.cpp
57e9723134e295c75a5aa0b20ca4764fc3959d25 25-Apr-2012 Raph Levien <raph@google.com> Partial fix for bug 6132077 (incorrect line breaking of Arabic text).

Fixed getTextRunAdvances so that advances are correctly aligned with
UTF-16 code point offices, rather than runs being reversed in RTL.

Change-Id: Ife59c0c26f745654c16656c86072e9102d8f6bc7
raphics/TextLayoutCache.cpp
721bfaa63d14f0ac858d32431ab2eff582143b0f 14-Apr-2012 Jamie Gennis <jgennis@google.com> SurfaceTexture: fix updateTexImage JNI

Sigh...

Change-Id: I0271bed44c58e0c9a03eda4886eb2c1ee76e041f
raphics/SurfaceTexture.cpp
2b4bfa5efec7df408b4db127961cfc9aca9e57cf 13-Apr-2012 Jamie Gennis <jgennis@google.com> SurfaceTexture: update API docs

This change updates the SurfaceTexture API docs and modifies the behavior of
the updateTexImage to produce an IllegalStateException when not attached to a
GLES context.

Change-Id: I5a0875927785108960985c567d571d5f7033256a
raphics/SurfaceTexture.cpp
62901af52a118c61579a81c84608c9f1118931a3 13-Apr-2012 Fabrice Di Meglio <fdimeglio@google.com> Merge "Add Paint.setTextLocale()"
517825f1a9f14f92908bd7859b91b927c2eec6d9 07-Apr-2012 Fabrice Di Meglio <fdimeglio@google.com> Add Paint.setTextLocale()

- will be used for better shaping CJK and other goodies

Change-Id: If64945a337edd915f5ebb88f04b6fd18e92ca587
raphics/Paint.cpp
276de3e1eb11d1eb93076dca5a69c791d3ef63d8 13-Apr-2012 Fabrice Di Meglio <fdimeglio@google.com> Add new Arabic font for SystemUI

- still work in progress
- bug #5987379

Change-Id: I0a7f7437c9061eab0abc9d5979c947eb5511992a
raphics/TextLayoutCache.cpp
c6d993077761fc737bbb0f4db44b961a4e7b6bbb 05-Apr-2012 Jamie Gennis <jgennis@google.com> SurfaceTexture: add GL context attach & detach

This change adds Java API support for detaching a SurfaceTexture from one GLES
context and then attaching it to a different one.

Change-Id: I8eed4b0d0e339c11598cb0408d9f4f2d99b3aa06
raphics/SurfaceTexture.cpp
ec4a50428d5f26a22df3edaf7e5b08f41d5cb54b 04-Apr-2012 Amith Yamasani <yamasani@google.com> Embed layout padding in nine patch images

- Added a new custom PNG chunk that carries the layout padding ints.
- Extract the padding ticks from .9.png images and store in the chunk.
- Load the padding information at runtime into Bitmap and NinePatchDrawable.

- The new chunk is ordered first so that it doesn't cause a problem in older
versions of the platform.

Bug: 6087201

Change-Id: I5de46167a1d44b3ec21065b0c165e594b1dc8399
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/BitmapRegionDecoder.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/NinePatchPeeker.cpp
raphics/NinePatchPeeker.h
43e4985abfcb69db8fb39a95794eb34a2f142214 29-Mar-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #6248364 Tamil and Denavagari text crash in Google+

- fix initialization of variables

Change-Id: Ibda4e1e6f55f867385eaf9a4c7a754c16815bbf0
raphics/TextLayoutCache.cpp
7b2f8b8fb7064a1d3b6d942b978c30c24c9d7299 20-Mar-2012 Romain Guy <romainguy@google.com> Pre-scale bitmaps on the native heap

Change-Id: I9819b532b89a997ab775b31ffee46445f1d16e20
raphics/BitmapFactory.cpp
caf813fe1ec10dda75cd752cb3ff80872ae7ac0b 16-Mar-2012 Romain Guy <romainguy@google.com> Remove unused private API

Change-Id: Iec9c2bc275fc7376f4e0b0b9c44059c56a9dd173
raphics/BitmapFactory.cpp
b48e0291078e3a7052513572cfb2b19318f6c08c 13-Mar-2012 Siva Velusamy <vsiva@google.com> Merge "Expose a function to set OpenGL Trace level."
a1cff5043d0fbd78fcf9c48e7658e56a5b0c2de3 21-Feb-2012 Chet Haase <chet@google.com> Handle view properties at the native level

Basic functionality of handling View properties (transforms,
left/right/top/bottom, and alpha) at the native DisplayList level.
This logic is disabled for now (via compile-time flags in View.java and
DisplayListRenderer.h) as we continue work on it (there is no advantage
to the new approach until we optimize invalidation and rendering paths
to use the new code path).

Change-Id: I370c8d21fbd291be415f55515ab8dced6f6d51a3
raphics/Camera.cpp
64d10a1da0a702ffeb086ad9c4a632f2712f1dad 09-Mar-2012 Siva Velusamy <vsiva@google.com> Expose a function to set OpenGL Trace level.

This patch adds a function setGlDebugLevel() to libEGL, and
exposes it to the Java layer at android.opengl.GLUtils.enableTracing().

Change-Id: Ia5abb130bc32fcfe3ab25b0a0a5283a54c54f357
pengl/util.cpp
d84e1ce0b535128f03416145554fb405f9fade3e 07-Mar-2012 Jeff Sharkey <jsharkey@android.com> Split Parcel JNI details away from Binder.

This is purely a refactoring, with no change to the underlying
functionality.

Change-Id: I41b59f14e57d1cc144274a01f77658d99a1bfe02
raphics/Bitmap.cpp
raphics/Region.cpp
ff40ab7a418dd06cfe4758ceda17a775f2d4c776 28-Feb-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5180841 TextLayoutCache needs to support Indic

- add Tamil and Devanagari shaping support

Change-Id: I331ec52cd1987e157100deb699db27f855881c32
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
325740fb444af8fc7fb0119b2e30ce322c2ae134 25-Feb-2012 Romain Guy <romainguy@google.com> Add hooks to implement Canvas.drawTextOnPath() in GL

Change-Id: I165c9e05facf5365aa6850605688e538640c7fcc
raphics/TextLayout.cpp
b13b9bdad2baf6ad1ec2e56b6b7598fa20f55fc4 18-Feb-2012 Mathias Agopian <mathias@google.com> frameworks/base refactoring.

step 2: move libutils headers to their new home: androidfw

Change-Id: I14624ba23db92a81f2cb929f104386e1fab293ef
raphics/BitmapFactory.cpp
raphics/BitmapRegionDecoder.cpp
raphics/Movie.cpp
raphics/NinePatch.cpp
raphics/NinePatchImpl.cpp
raphics/NinePatchPeeker.h
raphics/Typeface.cpp
raphics/Utils.h
fb2cfa223b47db3ee46df22dcdb92f4fb013dcdd 03-Feb-2012 Chih-Chung Chang <chihchung@google.com> Comment out a warning message to avoid log spamming.

The warning message happens a lot when the region decoder is used (like
viewing a picture in the Gallery app).

Change-Id: I435f92eac8f322b091f3ed14ee48d0b5f0d84a8a
raphics/Graphics.cpp
0a3f6d69b6e5242d5eaca6ede801eaabbff56cfd 06-Feb-2012 Jean-Baptiste Queru <jbq@google.com> am 33476f7a: am f79bcd2d: am 52da99fa: am a081c7b8: Merge "Skia API changes as a result of an update to the Skia library."

* commit '33476f7ad1c3b4dcaefddb306f315e201c4efb33':
Skia API changes as a result of an update to the Skia library.
52da99fac85d1e16a3c95bdd9c039801e920e6d1 06-Feb-2012 Jean-Baptiste Queru <jbq@google.com> am a081c7b8: Merge "Skia API changes as a result of an update to the Skia library."

* commit 'a081c7b8bc5a3ea19fc7562b333fac525b17bc5f':
Skia API changes as a result of an update to the Skia library.
ffd121233a38adfa49f7bb29bdceba7a4700e0c7 04-Feb-2012 Fabrice Di Meglio <fdimeglio@google.com> Merge "Revert back to DroidSansArabic font for SystemUI"
ab8c73882e0c572f42a5c73ebabf18706b8cc7b6 31-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5929529 Parentheses aren't correctly rendered in RTL context

- do BiDi mirrored char mirroring in TextLayoutCache
- see BiDi mirrored chars list at:

http://www.unicode.org/Public/6.0.0/ucd/extracted/DerivedBinaryProperties.txt

Change-Id: Ia0af0e252dbb0c55cc689bc9db34e05591bb6ee8
raphics/TextLayoutCache.cpp
9b255cac775064038a5548c983205b2dfb029841 02-Feb-2012 Fabrice Di Meglio <fdimeglio@google.com> Revert back to DroidSansArabic font for SystemUI

- see bug #5957987 Revert to use DroidSansArabic instead of DroidNaskh font for Arabic Shaping in SystemUI
- DroidNaskh was having FontMetrics not compatible with Roboto

Change-Id: I9f3031c250f907c80f3992f71d929dc91686e1e5
raphics/TextLayoutCache.cpp
889a3fa6ab9710104af60db5f73d69f253ddf254 31-Jan-2012 Derek Sollenberger <derek@android.com> Skia API changes as a result of an update to the Skia library.

These changes are required to work with r3022 of Skia

Change-Id: Ib7cebeb2eba6790bb38edfc2397b311cf419e17c
raphics/Canvas.cpp
a731b082b2c43204e6e9f927ab82fb732934a83b 24-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Code cleaning: centralize use of #if USE_TEXT_LAYOUT_CACHE

- also clean some destructors (was not quite compulsory because
they are related to some Singletons)

Change-Id: I3091cac7b38628cda593d72570ba7a5d7ea2a15c
raphics/Canvas.cpp
raphics/Paint.cpp
raphics/TextLayout.cpp
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
e414613bb8d9b1ee0234a2b0858d6f447d0d956a 25-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix bug #5901103 all_source_project_146981_Android - Android ICS LQA Regression:FA, AR, HE and TH - Font Corruption"
3941a22bfd36fe2866c2e0da93dbea2c60ec7c22 25-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5901103 all_source_project_146981_Android - Android ICS LQA Regression:FA, AR, HE and TH - Font Corruption

- use the first char of the "run" instead of the "string" for the BaseGlyphCount

Change-Id: I647528ec912bb69655cf301bbc73b66dc1a6fc82
raphics/TextLayoutCache.cpp
bd901dee317d10c6a921922c3d7d788b90306c82 21-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5846413 "phone" keyboard layout is broken on master

- was a subtle regression introduced when fixing bug #5753006
- as we are now using SkPaint::kGlyphID_TextEncoding (glyph encoding)
instead of SkPaint::kUTF16_TextEncoding (UTF16 encoding), we need to
force the UTF16 encoding in some cases that are NOT going thru
the TextLayoutCache / Harfbuzz shaping

- fix also breakText() the same way

- also clean some old comment

- Warning: depends also on a CL from Skia for having getBaseGlyphCount() "const"

Change-Id: I3d1fc87f070884876c679b33541f810fbfb5df3f
raphics/Canvas.cpp
raphics/Paint.cpp
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
12b7da69957ef894ce5134989e38479c64308ea1 20-Jan-2012 Jean-Baptiste Queru <jbq@google.com> am 6df477be: Merge "Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF)"

* commit '6df477be186233e36fc370c4d2db6c1ed928a740':
Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF)
f3f650db96d40014a0203393c585c368b0dd7a9a 20-Jan-2012 Jean-Baptiste Queru <jbq@google.com> am a826f9e2: Merge "Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF)"

* commit 'a826f9e2c4f6329d8d48c927f6e942e78ffaf92f':
Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF)
08d3c6e5ba5c3e5fcc386b07efa709325d45b9ff 20-Jan-2012 Jean-Baptiste Queru <jbq@google.com> am 4f367f33: Merge "Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF)"

* commit '4f367f3387887c538c81c34cc8becaea6fa5e430':
Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF)
7ae84204c14b4abff70fcc19c3c33de2591df34b 20-Jan-2012 Jean-Baptiste Queru <jbq@google.com> am ba7f0d2a: Merge "Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF)"

* commit 'ba7f0d2a03643ce429421b81febf18fd50473070':
Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF)
97aa8ee81198234aedffceaf71ad216b96323393 20-Jan-2012 Jean-Baptiste Queru <jbq@google.com> Merge ee4618bc

Change-Id: Ie1dc6ad38e7c30636d80f6caef11cf6673144940
36b48c30adf7236b00eccf87f3b5691359526540 20-Jan-2012 Jean-Baptiste Queru <jbq@google.com> am c318bbb0: Merge "Rename (IF_)LOG() to (IF_)ALOG()"

* commit 'c318bbb05e02a0080e129623ec8029d31be0d60e':
Rename (IF_)LOG() to (IF_)ALOG()
c6aacce37191e1cc79cfeba13b39899f59c68c3b 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF)

Change-Id: I1de629b4632a4b3187ca1a28d6416daccd35f924
raphics/Canvas.cpp
raphics/Graphics.cpp
raphics/SurfaceTexture.cpp
pengl/util.cpp
a51f0e707f1f3142358aa919ea60ad2842803139 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF)

Change-Id: I8fbdfa7a7581f481968dbb65aa40f7042936d7cb
raphics/SurfaceTexture.cpp
raphics/TextLayout.cpp
raphics/TextLayoutCache.cpp
933e85615059b85a87747da57288384541cc56da 04-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF)

Change-Id: I26f76452ac49e2890b14d133c065493d8df0fb4a
raphics/NinePatchImpl.cpp
pengl/util.cpp
1afd5bab4e0eaba8b5bc2ab5c7b556cd602cf2e7 20-Dec-2011 Steve Block <steveblock@google.com> Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF)

Change-Id: I44f267700356967dc51e8f85ebf457dc85cfb229
raphics/Canvas.cpp
raphics/HarfbuzzSkia.cpp
raphics/TextLayout.cpp
raphics/TextLayoutCache.cpp
06ade6ae1bd015e8b8ad0685847911213c93cc5b 20-Oct-2011 Steve Block <steveblock@google.com> Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF)

Change-Id: I5321ebd12e9c6248a108529e82c4e1af2a4405e3
raphics/NinePatch.cpp
raphics/NinePatchImpl.cpp
ad3f5145fe513c4abb36388ab41508edf2be2a7c 12-Oct-2011 Steve Block <steveblock@google.com> Rename (IF_)LOG() to (IF_)ALOG()

Change-Id: If49c81a2793182771c6160fbca93905daa6f44c1
raphics/TextLayout.cpp
11d06a73df371be0b11d5cf586e24601d796c048 17-Jan-2012 Romain Guy <romainguy@google.com> Merge "Fix text encoding when drawing with drawPosText in software"
62b6eaa7f3a8111311a7ee097f278eb55865a499 17-Jan-2012 Romain Guy <romainguy@google.com> Fix text encoding when drawing with drawPosText in software

Change-Id: I0cd8ee526189c38c50953a1a08b50e0b31c55d8c
raphics/Canvas.cpp
c7c09960ff9cc71d4f27f57b456986f4b634310d 17-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix bug #5870701 Thai text can be clipped when there are more glyphs generated than the initial number of code points"
03e250aefa29387f30a01243682eab2371103f8e 14-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5870701 Thai text can be clipped when there are more glyphs generated than the initial number of code points

- compute total advances correctly by iterating on the advances array for up to mShaperItem.num_glyphs
- update unit tests

Change-Id: I00af68bef88702215e9222ed80dbffcc81df51a7
raphics/TextLayoutCache.cpp
3762c311729fe9f3af085c14c5c1fb471d994c03 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
raphics/Canvas.cpp
raphics/Graphics.cpp
raphics/SurfaceTexture.cpp
raphics/TextLayout.cpp
pengl/util.cpp
8564c8da817a845353d213acd8636b76f567b234 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/157065

Bug: 5449033
Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
raphics/SurfaceTexture.cpp
raphics/TextLayoutCache.cpp
d4a69b4a1cb5b52035345abd8cb9595ae4cf9fa5 06-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix bug #5753006 Garbled Labels in Maps"
a0a117b4c1a9e45ca4b895df9a355b6922ae2242 05-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5822825 Paint.measureText (char[] text, int index, int count) cannot handle text more than 32K long - DO NOT MERGE

- do not clear the smart pointer when the cache entry does not fit the cache size

See http://code.google.com/p/android/issues/detail?id=23337

Change-Id: Id4533d9f8a396c310c9215157ec5a4c07f30c7f2
raphics/TextLayoutCache.cpp
bd47cac4dfc8440a848b33107cba1d6773f3e124 05-Jan-2012 Steve Block <steveblock@google.com> Merge "Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE"
c726ff02c7749f134885decadd2ea86877119c3d 05-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix bug #5822825 Paint.measureText (char[] text, int index, int count) cannot handle text more than 32K long"
c511bee87cda99a252d1a62487f47c8f05aee78c 05-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5753006 Garbled Labels in Maps

- it was a regression introduced into this CL: https://android-git.corp.google.com/g/#/c/154240/5
- basically needed to set the GlyphID encoding to the Skia Paint as we are now using glyphID resulting
from the Harfbuzz shaping
- also define GlyphID encoding as the default on the Paint class

Change-Id: Idb7c2c57ac67595425ce3be9421258962690fcdd
raphics/Canvas.cpp
raphics/Paint.cpp
raphics/TextLayout.cpp
raphics/TextLayout.h
bd7cdc32eb30e779edeec3e0d1715376aae6c546 04-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5822825 Paint.measureText (char[] text, int index, int count) cannot handle text more than 32K long

- do not clear the smart pointer when the cache entry does not fit the cache size

Change-Id: I49f1aa1e70018bb7d6a8fb076d9269d0ec6a5d98
See: http://code.google.com/p/android/issues/detail?id=23337
raphics/TextLayoutCache.cpp
6215d3ff4b5dfa52a5d8b9a42e343051f31066a5 04-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/156801

Bug: 5449033
Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
raphics/NinePatchImpl.cpp
pengl/util.cpp
5baa3a62a97544669fba6d65a11c07f252e654dd 20-Dec-2011 Steve Block <steveblock@google.com> Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
raphics/Canvas.cpp
raphics/HarfbuzzSkia.cpp
raphics/TextLayout.cpp
raphics/TextLayoutCache.cpp
a4d077006306b49d85e7609e8f5a061e345f6f6d 14-Dec-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5674155 Segmentation issue for Thai

- force Harfbuzz to shape with the Thai font

Change-Id: I3830acae17385b050e2745fca277cf66af103099
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
65194adc9a5174fc88fb579472799e8b4771796b 14-Dec-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5727213 Rendering issues with Bengali in Textview in IML63B

- force Harfbuzz to shape with the Bengali font
- also fix potential returned NULL value from SkTypeface::CreateFromFile(path)

Change-Id: I25be09d06e449b89bb4a62444e27f77e436b77ba
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
902a5b31c50022a1b7707be4d333e4ce6ec4a8fa 09-Dec-2011 Fabrice Di Meglio <fdimeglio@google.com> TextLayoutCache - fix diacritics composition

- normalize (with ICU) each BiDi run before shaping them

We are normalizing by "chuncks" and starting from the end of the string. Each "chunck"
is composed of the main code point and its associated diacritics.

Fix bug #5738435 TextLayoutCache should be able to take care about diacritics during shaping

Change-Id: I7288027a7fa8eafb8b9f38d449625be60214548a
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
b02d0ca5553300063e4332192632312600caf4b9 08-Dec-2011 Fabrice Di Meglio <fdimeglio@google.com> Clean TextLayout code and remove RTL_USE_HARFBUZZ

- remove dependencies on ICU
- use TextLayouCache
- remove RTL_USE_HARFBUZZ define (we *are* using Harfbuzz now)
- also fix compilation warning

Change-Id: I022e11703438d07032e49e42724184f6bf16653e
raphics/Canvas.cpp
raphics/Paint.cpp
raphics/RtlProperties.h
raphics/TextLayout.cpp
raphics/TextLayout.h
raphics/TextLayoutCache.cpp
99cdc6a3b509d61b0072467f6ed47989aca528c1 06-Dec-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix TextLayoutCache issue when loading Font tables (DO NOT MERGE)

- disable GSUB / GPOS table loading

Change-Id: I2ae058c9d926242586f90dc2a98302ff886f1fe1
raphics/HarfbuzzSkia.cpp
raphics/TextLayoutCache.cpp
f98c2a67fe051cc92f3205bfc0267ddac90d3a71 06-Dec-2011 Jeff Brown <jeffbrown@google.com> Fix memory corruption issues in TextLayoutCache. (DO NOT MERGE)

Ensure log_clusters array is big enough.
Bug: 5714171

Explicitly handle the cases where the entire string or a single
run might have a length of 0.
Harfbuzz assumes the length of the item is at least 1.
If the length is zero, then it will clobber memory at index -1
into the log_clusters array.
Bug: 5705479

Change-Id: If28a9866221081f69973c1d12d7fe0cf8db2edd0
raphics/TextLayoutCache.cpp
a03bdedbdf1022d1391f5f0a6ea507e2ebbb0e9a 06-Dec-2011 Jeff Brown <jeffbrown@google.com> Harfbuzz assumes the length of the item is at least 1.

If the length is zero, then it will clobber memory at index -1
into the log_clusters array.

Explicitly handle the cases where the entire string or a single
run might have a length of 0.

Bug: 5705479
Change-Id: Ibbd3a4edcb7e1cad09c34091b42bb315776ea558
raphics/TextLayoutCache.cpp
738ef87eacd3e54132d1bf661dd9329050fddd2f 06-Dec-2011 Jeff Brown <jeffbrown@google.com> Ensure log_clusters array is big enough.

Bug: 5714171
Change-Id: I886f1af8af177827f052e6406a192f2fad5c2cec
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
868d1bdf3c01dbdcf15b780db72d1c9a3022829f 03-Dec-2011 Fabrice Di Meglio <fdimeglio@google.com> Merge "TextLayoutCache Fix compilation issue"
5448f0378ede9c5d33e7300fa318ef4a6925562f 03-Dec-2011 Fabrice Di Meglio <fdimeglio@google.com> TextLayoutCache Fix compilation issue

- fix compilation after refactoring and when setting DEBUG_ADVANCES to 1

Change-Id: I8eef7e3c4550c505325459948d3c8eebbdd5215a
raphics/TextLayoutCache.cpp
2e5e96e9f06b3853dcade61c0aceb0dbaaff3032 01-Dec-2011 Fabrice Di Meglio <fdimeglio@google.com> TextLayoutCache Code cleaning

- remove commented code
- fix log

Change-Id: I8495b923c9426e33e645fe85ea04005520716f4e
raphics/TextLayoutCache.cpp
56e6e5492780feb3824ff076551b563aade6a2ef 01-Dec-2011 Fabrice Di Meglio <fdimeglio@google.com> Improve TextLayoutCache logging

- make logs more consistent and readable
- add more logs information

Change-Id: Idfe5bb53e9163c4c07a9b4267b66b0d0e164a498
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
0af10b54bf110653b74cb92793484b412a90b657 19-Nov-2011 Fabrice Di Meglio <fdimeglio@google.com> Improve TextLayoutCache performances

- introduce TextLayoutEngine
- reduce calls to HB_NewFace as they are opening the font files under the cover
- refactor code for removing FontData structure
- fix logging

Change-Id: Id9658fcd454b74c34ecf4e9dfd1bd2201e04b988
raphics/HarfbuzzSkia.cpp
raphics/HarfbuzzSkia.h
raphics/Paint.cpp
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
a4f5aa87c73de7a2581dc4dd72e0f90ccea79a18 18-Nov-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix TextLayoutCache Skia Typeface caching

- fix reference passing for globals

Change-Id: I806dd4406d455b98c6be733847419b06b6774ccc
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
bf677de46a039e07038511909576bfbf4406f7fd 15-Nov-2011 Jeff Brown <jeffbrown@google.com> Merge "Clean up GenerationCache."
d8fa1ad4523b6c04cab663ff4b65181fc00594d9 14-Nov-2011 Mathias Agopian <mathias@google.com> am 738d8cae: am c93a151f: Merge "Define, document, and test the behavior of very large SurfaceTextures" into ics-mr1

* commit '738d8cae2239d194429676f2889cfae3c8f7ba08':
Define, document, and test the behavior of very large SurfaceTextures
c93a151fde7d616c22b86ae458b3d015e3820d5e 14-Nov-2011 Mathias Agopian <mathias@google.com> Merge "Define, document, and test the behavior of very large SurfaceTextures" into ics-mr1
d9e688cab3015d858110fb8240cf7378c6befd82 12-Nov-2011 Jeff Brown <jeffbrown@google.com> Clean up GenerationCache.

Use const references to keys and values where appropriate to avoid
copying them unnecessarily.

Deleted some dead code.

Simplified a few pieces that were doing unnecessary redundant work.

Change-Id: Ib2145b7094a40db2d679e05dafe050fe1e87b846
raphics/TextLayoutCache.cpp
ad169f49af9fac1b80faa124496103dff2ac29f4 12-Nov-2011 Jeff Brown <jeffbrown@google.com> am 0e4669c8: am f1f0c873: Fix bug in TextLayoutCacheKey handling embedded nulls.

* commit '0e4669c81009cea51d9d7b42b7ff665f44e78aa6':
Fix bug in TextLayoutCacheKey handling embedded nulls.
0e4669c81009cea51d9d7b42b7ff665f44e78aa6 12-Nov-2011 Jeff Brown <jeffbrown@google.com> am f1f0c873: Fix bug in TextLayoutCacheKey handling embedded nulls.

* commit 'f1f0c873b1d119a19342cb67ca77b59607951659':
Fix bug in TextLayoutCacheKey handling embedded nulls.
6f0464e79d6d41d8255a6b0b6695fa7f67a0f65f 12-Nov-2011 Jeff Brown <jeffbrown@google.com> am f1f0c873: Fix bug in TextLayoutCacheKey handling embedded nulls.

* commit 'f1f0c873b1d119a19342cb67ca77b59607951659':
Fix bug in TextLayoutCacheKey handling embedded nulls.
b89d88f531ee39927f8f554baaae5ecc9101ba9d 10-Nov-2011 Mathias Agopian <mathias@google.com> Define, document, and test the behavior of very large SurfaceTextures

updateTexImage() now throws a runtime exception when its native
counterpart fails

Bug: 5506633

Change-Id: I151a6f685d465966e7df4df624412ab2da62e95f
raphics/SurfaceTexture.cpp
06daa7b6b2186cf1e83e14d2adbb0d2050b79c39 12-Nov-2011 Jeff Brown <jeffbrown@google.com> Improve the logging in TextLayoutCache.

Also deleted some dead code.

Change-Id: I1feb5744177ae751ff1417f49f3c45139a35246b
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
f1f0c873b1d119a19342cb67ca77b59607951659 12-Nov-2011 Jeff Brown <jeffbrown@google.com> Fix bug in TextLayoutCacheKey handling embedded nulls.

We were not passing the length of the UTF-16 string to
String16::setTo. As a result, it was copying the contents of
the text up to the first null it found.

First problem, these strings are not typically null terminated!

Second problem, if the string contained a null character, then
we might truncate it. However, we only truncated the string
when the copy constructor was invoked (say, when we called
get() on the cache) but not in internalTextCopy() (before
adding the key to the cache).

As a result of the second problem, we would first search
the cache for a key that matched a partially copied truncated
string (potentially reading uninitialized memory that followed it).
Finding none, we would add the entry to the cache using
the correct key.

If the cache already had a value associated with the correct key,
then the put would fail, returning false. Charging ever onwards,
we would add the size of the entry to the cache size.

Proceeding in this manner, it was possible for the cache to
believe it had less remaining space than it really did. At that
point, it was possible for the cache to evict all entries and
yet still not think it had room to add a new one, so it would
continue trying to make space indefinitely.

Bug: 5576812
Change-Id: I05251594f6b2da0a5dc09f7200f04fe9100ec766
raphics/TextLayoutCache.cpp
208d4592f6e8db90eab30cfca3dc294731258d1c 09-Nov-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix potential crash when shaping Hebrew with bold

- make code more resilient
- make correct initialization of gHebrewRegularTypeface

Change-Id: I97e98d36b830ad35979184c1459e8c8503eb3d28
raphics/HarfbuzzSkia.cpp
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
e187a2f55fe8684c853a0701cbc4a71392f437e0 08-Nov-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5559439 Bogus tab title in browser

- no need to shigt glyph IDs if we are a "common" script
- also code cleaning (suppress dead code)

Change-Id: I17bcf960f925a897a30894a3c581053f7fe5905f
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
4f4b83c50c67d4520af3d5b4733b1627208275ce 02-Nov-2011 Fabrice Di Meglio <fdimeglio@google.com> am 07b4b314: am bcf05a69: Fix bug #5553401 TextLayoutCache is too verbose: "computeValuesWithHarfbuzz -- need to force to single run"

* commit '07b4b3145333bc8ece9fdbb68ade726b3d6485cd':
Fix bug #5553401 TextLayoutCache is too verbose: "computeValuesWithHarfbuzz -- need to force to single run"
07b4b3145333bc8ece9fdbb68ade726b3d6485cd 02-Nov-2011 Fabrice Di Meglio <fdimeglio@google.com> am bcf05a69: Fix bug #5553401 TextLayoutCache is too verbose: "computeValuesWithHarfbuzz -- need to force to single run"

* commit 'bcf05a69090f342d328f1537d1d83406b883290b':
Fix bug #5553401 TextLayoutCache is too verbose: "computeValuesWithHarfbuzz -- need to force to single run"
bcf05a69090f342d328f1537d1d83406b883290b 02-Nov-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5553401 TextLayoutCache is too verbose: "computeValuesWithHarfbuzz -- need to force to single run"

- make single run case non verbose

Change-Id: I5c3b87aeb613697233290ddecac3ca00f58f8313
raphics/TextLayoutCache.cpp
ef9bb3c3ea3aa08071ea0c32a505b379c322e5b5 17-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5438102 Double Arabic harakat overlap instead of stack In TextView

IMPORTANT: this change needs two patches for Harfbuzz:
- one concerning hb_utf16_script_run_prev() which was not returning the correct "previous" script
- one for the "script_properties" table that was missing Arabic code point ranges and declaring
HB_Script_Inherited instead of HB_Script_Arabic

The current change is doing the following:
- pass the correct typeface for Harbuzz shaping (depending on the script of the run)
- offset correctly the glyphIDs returned by Harfbuzz

We need to offset the glyphsID as Harfbuzz will return local glyphIDs (meaning in the
local range of the font used for shapping).

We then cannot use those glyphIDs when we are using a fallback Font (Arabic, Hebrews...)
because the FontRenderer needs glyphIDs in the range of all the Fonts (including the fallbacks)

Change-Id: I494897435bbc59293b02392ee2059cebcdf0e571
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
904221a342fe977fe05270b7dde6ac94d13383f6 25-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5504346 Hung in native_getTextRunAdvances - DO NOT MERGE

- better check of ICU returned values
- default to single run if ICU is returning errors

Change-Id: I836818bda4fc72a27b2201f01023cd23c5d99ecb
raphics/TextLayoutCache.cpp
26e9ee28decfe934f57f6e8dcaf5620b5502e926 25-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5504346 Hung in native_getTextRunAdvances - DO NOT MERGE

- better check of ICU returned values
- default to single run if ICU is returning errors

Change-Id: I836818bda4fc72a27b2201f01023cd23c5d99ecb
raphics/TextLayoutCache.cpp
ad41b7c0d42b34a039bd9055f2134f8708d0ee67 31-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix bug #5504346 Hung in native_getTextRunAdvances"
5beeda08a7bd300ec22daaa9ae4e2d02a8c121ad 25-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5504346 Hung in native_getTextRunAdvances

- better check of ICU returned values
- default to single run if ICU is returning errors

Change-Id: I836818bda4fc72a27b2201f01023cd23c5d99ecb
raphics/TextLayoutCache.cpp
71f2cf116aab893e224056c38ab146bd1538dd3e 20-Oct-2011 Steve Block <steveblock@google.com> Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/143865

Bug: 5449033
Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
raphics/NinePatch.cpp
raphics/NinePatchImpl.cpp
28d9f024e043817212b15f04128d0464330502ea 12-Oct-2011 Steve Block <steveblock@google.com> Rename (IF_)LOG() to (IF_)ALOG() DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/141576

Bug: 5449033
Change-Id: I42575e7c29cf1c0f465c357a5c97ab118df6f473
raphics/TextLayout.cpp
44cd3f8f3daf45f85f6e977dcf28f75287fbb25b 21-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix compilation issue when DEBUG_GLYPHS define is activated"
a99ed6284eac0b00686ca60c595a0b98beddcb79 14-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix compilation issue when DEBUG_GLYPHS define is activated

Change-Id: I61693952ffdc02f77058311fc982fbbf8df24c6c
raphics/TextLayoutCache.cpp
2c183fa5bf666c5f6b2221fd04db8ee3c738d1fd 19-Oct-2011 Romain Guy <romainguy@google.com> Notify a Bitmap is has changed when calling copyPixelFromBuffer

Change-Id: Ibff1a162edfe11473c5c167e764405bf83ec5822
raphics/Bitmap.cpp
5c863f741e8e484bb39decd516c9fa4c6322e671 06-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5371117 Regression : The Hebrew / Arabic text behavior in ICS latest build is wrong

- welcome back start / count
- goodbye log clusters
- clean Paint code
- make private some functions as they should be
- improve memory allocation (create only one Shaper and reuse it for for shaping the runs in
the same input text)

Change-Id: I89a320c7f041319851308c8c9a919fbeafa82cdd
raphics/Canvas.cpp
raphics/Paint.cpp
raphics/TextLayout.cpp
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
6579a9d6fe2302fa149452f66c4062ebc60c2523 24-Sep-2011 Jeff Brown <jeffbrown@google.com> Transfer large bitmaps using ashmem.
Bug: 5224703

Change-Id: If385a66adf4c6179a0bb49c0e6d09a9567e23808
raphics/Bitmap.cpp
8ebf1efd66516340bedbf0d0a19d5e96cc28fa20 03-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix potential issue with the TextLayoutCache with glyphs"
155fa38a71ff11e1617b1e3dfda770543df8eb1d 01-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix potential issue with the TextLayoutCache with glyphs

- there may be a mapping of one char to many glyphs

Change-Id: I48846d176d61dc8d8e513ca144fdf8ad805e63b7
raphics/TextLayoutCache.cpp
717060b076350ea811153290281075396a554fed 28-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Improve TextLayoutCache performances a bit

- the gain is about 5% and the timing is more stable
- use compare_type() and strictly_order_type()

Change-Id: Iab81869a8ba461ce786a468b6c59b8f34e8db838
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
5293cea4e05556b4144d9487b47282a21c9f6941 27-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug # 5376028 Arabic text is kinda broken - disappearing glyphs

- make the log clusters happy

Change-Id: I73ca9512f0ca02549dad5270d6ec198ae9b00a4e
raphics/TextLayoutCache.cpp
79df5323e7ed541b854cea5684a89e8be8c2dfc9 20-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5332081 TextLayoutCache needs to be able to have more cache hits

- makes TextLayoutCache not carring about start/count. Basically he will cache the result for
the full string and gives back the "chunk" corresponding to start/count
- changed the TextLayoutCacheValue API to take start/count parameters
- add Harfbuzz LogClusters in TextLayoutCacheValue as it is needed for extracting the start/count "chunk"

Change-Id: I4b38a4442428606de9a093303bbbe98181e1f89c
raphics/Canvas.cpp
raphics/Paint.cpp
raphics/TextLayout.cpp
raphics/TextLayout.h
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
7aac2979605f4811cf096f7c62d363381c68f6b2 20-Sep-2011 Jeff Brown <jeffbrown@google.com> TextLayoutCacheKey needs to store start and count.

Bad merge.

Change-Id: Id6507b3a7e35808a6d34501a45d79fcb7470657d
raphics/TextLayoutCache.cpp
4dd99e5912c73d5a9db165cefd4852b51ea438e8 19-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> TextLayoutCache code refactoring

- use vector (instead of array) for advances and glyphs
- reverse glyphs directly in computeRunValuesWithHarfbuzz() (instead of reversing them after)

Change-Id: I716a8f914fd043818d7cb80cca76ee5fb0effb96
raphics/TextLayout.cpp
raphics/TextLayout.h
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
e0d558ac92cd9e550b3d08bf09d9bb12c2a506c6 19-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix potential leak in TextLayouCache"
54dc642cc1e188b9eeecadb648b9e8c610f4b857 19-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Make TextLayoutCache no more dependent on ICU

- move ICU call to TextLayout

Change-Id: Id5a21e7b69e484536cfb5b86fbb0c112fb661dfa
raphics/TextLayout.cpp
raphics/TextLayout.h
raphics/TextLayoutCache.cpp
e74fef3b55dc1b5daf40b3a6aea857582071560f 18-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix potential leak in TextLayouCache

- need a copy constructor for the key as the GenerationCache we are using
is actually a KeyedVector<K, sp<Entry<K, V> > >
- use the getText() API to access the text in the cache key

Change-Id: I5b60ebc062b62308ed7ac1284cfe2a9f28e2b8b1
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
9c418dbc56efd334c68872d281f75138e16eae46 18-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Revert "Fix bug #5332081 TextLayoutCache needs to be able to have more cache hits"

This reverts commit d686d76814f18061e06995df0d5de9feb9f70a7e
raphics/Canvas.cpp
raphics/Paint.cpp
raphics/TextLayout.cpp
raphics/TextLayout.h
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
d686d76814f18061e06995df0d5de9feb9f70a7e 14-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5332081 TextLayoutCache needs to be able to have more cache hits

- makes TextLayoutCache not carring about start/count. Basically he will cache the result for
the full string and gives back the "chunk" corresponding to start/count
- changed the TextLayoutCacheValue API to take start/count parameters
- added the Harfbuzz LogClusters in TextLayoutCacheValue as it is needed for extracting the start/count "chunk"
- fix potential issue of cache key leaking

Change-Id: I9276f9bec744e8de36349acfba8429f7c6f83394
raphics/Canvas.cpp
raphics/Paint.cpp
raphics/TextLayout.cpp
raphics/TextLayout.h
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
51f383d65f9ee3c7d73d0508b576550e7998c5b5 14-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix some TextLayoutCache issues

- wrong ContextCount was passed
- better logs

Change-Id: Ie78ba70f98f3cf017c168ab8848cc080fc175f31
raphics/Paint.cpp
raphics/TextLayoutCache.cpp
163268b3a8d4dd7e650e6c540f832bf60f6bf4c9 08-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5274332 TextLayoutCache is having multiple instances

- also fix the missing LOG_TAG define

Change-Id: I25e96d1ba372e84768604f18702e0724fdecefb0
raphics/Canvas.cpp
raphics/TextLayout.cpp
raphics/TextLayout.h
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
abb0f299fdc72755a18cf8848d57919890f0cd42 19-Aug-2011 Fabrice Di Meglio <fdimeglio@google.com> Update TextLayout logging

- centralize logging into TextLayoutCache
- add offset logging

Change-Id: I52f229b2a8aed121715b37a5a42936875b23f3c9
raphics/Canvas.cpp
raphics/TextLayout.h
raphics/TextLayoutCache.cpp
596072306191932c3a7f845b549795380eeb4c53 17-Aug-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5174495 Harfbuzz shaping is broken after taking care of Indic

- revert back to old working code where the script was setup for Harfbuzz\
depending of the direction of the run

Change-Id: I7ec740732b51ccf05b6744b7f9d2fcb35555478d
raphics/TextLayoutCache.cpp
f43fa5746ee5b81a6e386d36594094d079ac8160 13-Aug-2011 Dianne Hackborn <hackbod@google.com> Turn off hinting by default for higher density displays.

Also adds an API for apps to control whether hinting is used.

Change-Id: I1a06b06255fbb8d0f02a8ce48c2cd60019088ed3
raphics/Paint.cpp
1ee60119c4fa51ebfa781cf5fdc33f192e8551b8 26-Jul-2011 Ted Bonkenburg <tedbo@google.com> Remove ParcelSurfaceTexture and update MediaPlayer

This removes the ParcelSurfaceTexture class since that functionality has been
folded into Surface.java. The change also updates the MediaPlayer to get rid
of setParcelSurfaceTexture() and modifies setTexture() to use the new Surface
functionality in order to simplify the code.

Change-Id: Iafa75ea3188263928128325d8a726786971b4de4
raphics/ParcelSurfaceTexture.cpp
5de5b1a91e25ef4931661fdd089d7e0e2b7da035 09-Aug-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix Harbuzz shaper for being able to do select other scripts than Common or Arabic

- need to take care of diacritics marks that return HB_Script_Inherited for a script

Change-Id: Icbfea46b305e15849b25410fed07d9cd5dfeb818
raphics/TextLayoutCache.cpp
6ab90ed017fb52aac4493a2fac897299d345874f 09-Aug-2011 Fabrice Di Meglio <fdimeglio@google.com> Solidify and optimize Paint text related APIs

- better check parameters consistency
- return calls as soon as possible (when null or empty text)

Change-Id: I46744e517b04e3fba0ec37132d7de400177f214b
raphics/Paint.cpp
f95761826590a953c927fd93b1e8ef627dbc3e5b 08-Aug-2011 Fabrice Di Meglio <fdimeglio@google.com> Merge "Revert "Adapt TextLayoutCache for new Harfbuzz scripts""
f09e46e938cd041315f25de3d23560c12c08bf4e 08-Aug-2011 Fabrice Di Meglio <fdimeglio@google.com> Revert "Adapt TextLayoutCache for new Harfbuzz scripts"

This reverts commit 7f4ae758ba4724f7c3031d33ad8e749c11d1e059

This CL created a regression:

#5134317 Arabic Keyboard does not appear
raphics/TextLayoutCache.cpp
adc25267f8ba29ccf1408d8840dc9e840e7c65c7 04-Aug-2011 Russell Brenner <russellbrenner@google.com> Merge "Adapt TextLayoutCache for new Harfbuzz scripts"
ec46b4e1ca89d7c3a9ad70ded58da08b5e19f08f 04-Aug-2011 Mathias Agopian <mathias@google.com> Add a 'release' method to the SurfaceTexture public Java API

Bug: 5063618
Change-Id: I689cb0c01c14e597ccfb4eb0972e64fa570bd4e8
raphics/SurfaceTexture.cpp
7f4ae758ba4724f7c3031d33ad8e749c11d1e059 03-Aug-2011 Russell Brenner <russellbrenner@google.com> Adapt TextLayoutCache for new Harfbuzz scripts

The Harfbuzz script setting was wired to HB_Script_Common for left-
to-right text and HB_Script_Arabic for right-to-left. This change
selects from additional scripts using some utility APIs from
Harfbuzz.

Change-Id: I34a6f1e0407c8d122bc968443948e7863d1f91ed
raphics/TextLayoutCache.cpp
4f7c380d5160a66274c96e1529928149ed9e9624 02-Aug-2011 Derek Sollenberger <djsollen@google.com> Merge "Reverting until we can find a better way to address this issue without affecting nine-patches with large stretchable areas."
09a22e33e7a912ef14982b91f9387f907cc015f5 02-Aug-2011 Derek Sollenberger <djsollen@google.com> Reverting until we can find a better way to address this issue without affecting nine-patches with large stretchable areas.

Revert "Fix NinePatch decoder when the target is smaller than the source."

This reverts commit c4c458c678567b899aae04631570460c5e729512
raphics/NinePatchImpl.cpp
0965a3244b4c3009d08db2e084cdcb681ef66d26 02-Aug-2011 Romain Guy <romainguy@google.com> Allow Canvas.setBitmap() to receive a null Bitmap.

Change-Id: I6096f0b44866e532ccd96a29c816bf34d48c1dc2
raphics/Canvas.cpp
c4c458c678567b899aae04631570460c5e729512 29-Jul-2011 Derek Sollenberger <djsollen@google.com> Fix NinePatch decoder when the target is smaller than the source.

If the target is smaller on a given axis than the source then we
just draw a downscaled version of the NinePatch. If we use the
current path and the source has transparency then areas of the
NinePatch overlap and are blended together resulting in visual
inconsistancy.

bug: 5041053
Change-Id: I0fcc6fb5c214b188a164acf0651aa4ab2f35946d
raphics/NinePatchImpl.cpp
c2063a5b18bc2e54f000b411c82f43992a53854e 18-Jul-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5037425 Canvas.drawText can't handle Right-to-Left text and text composing

- optimization for single run case was broken
- pass isRTL boolean along the call stack instead of the dirFlags integer
(which was only used as a "isRTL" in the shaper)
- update unit tests

Change-Id: I33110b76a433633a0b92fbd1db03785204e0c3e6
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
796cc96243a57cd1b652bd90c4e7ba7823c6c2fe 16-Jul-2011 Fabrice Di Meglio <fdimeglio@google.com> Clean test APIs for Harfbuzz support

- also update unit tests

Change-Id: I557f61e84c4c4b6165163b783d9c679a6b3b4106
raphics/Canvas.cpp
99b7b7a7f896f8b98e84c4d87e1239541f518f76 14-Jul-2011 Romain Guy <romainguy@google.com> Force bitmaps to load in ARGB8888 by default.
Bug #5024993

Change-Id: Id0c63f675ae188e5a786b7fdd63916e114b9ed4a
raphics/BitmapFactory.cpp
3cf7cf575138bcbe5b49c32eb4ae401f92e4c8f7 28-Jun-2011 Jamie Gennis <jgennis@google.com> Merge changes I9fb59763,I8b2c6e00

* changes:
SurfaceTexture: consume buffers after err checks
SurfaceTexture: change onFrameAvailable behavior
bd5404d0312752e7c8946e8540129f0d2d97bcd7 27-Jun-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: change onFrameAvailable behavior

This change alters the conditions under which the onFrameAvailable
callback gets called by the C++ SurfaceTexture class. The new behavior
is to call the callback whenever a frame gets queued that will be
visible to the buffer consumer. This means that buffers queued in
synchronous mode always trigger the callback, as those buffers will
remain pending until they are consumed. Buffers queued in asynchronous
mode will only trigger the callback if there was not previously an
unconsumed buffer pending.

The new behavior means that a consumer should perform a draw operation
exactly once for every onFrameAvailable call that it recieves. This
change also modifies SurfaceFlinger and the SurfaceTexture JNI to
support of the new behavior.

Change-Id: I8b2c6e00961d3d58b11c6af50b555b6e4c5f5b40
raphics/SurfaceTexture.cpp
a2c8a7b5739c1febf8ffbf9461334343bdadab16 27-Jun-2011 Jean-Baptiste Queru <jbq@google.com> am ec5039b3: am 99c070d8: am 4fea5373: Merge "Add WEBP to the list of Image formats that support Compression."

* commit 'ec5039b3720ee9b92fb2a2c6dd9f468d2dcd7172':
Add WEBP to the list of Image formats that support Compression.
436b50f0dcfd0c3ec397d860e8f98abbce231e23 26-Jun-2011 Jamie Gennis <jgennis@google.com> Merge "SurfaceTexture: detach from Dalvik when necessary."
ec5039b3720ee9b92fb2a2c6dd9f468d2dcd7172 24-Jun-2011 Jean-Baptiste Queru <jbq@google.com> am 99c070d8: am 4fea5373: Merge "Add WEBP to the list of Image formats that support Compression."

* commit '99c070d8eb9f1ff9ea5c38991f15f091040226c2':
Add WEBP to the list of Image formats that support Compression.
d3d4b4b86ae5bc8301b64ee6d78a7a9343347398 24-Jun-2011 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix potential advances overrun in TextLayoutCache."
b092f55c37f19aa4ee714242337136b9061f8ca8 24-Jun-2011 Doug Felt <dougfelt@google.com> Fix potential advances overrun in TextLayoutCache.

Change-Id: Ibec544f249833a28fe8ef9a15fc8ab48fddfc51c
raphics/TextLayoutCache.cpp
0904d0af81e8a0a5404d6c03f4dcea02bea8170d 24-Jun-2011 Grace Kloba <klobag@google.com> Add allowSynchronousMode to SurfaceTexture constructor.

Change-Id: I54f30a3c16bbe6b813f3bcd1d389da5627531304
raphics/SurfaceTexture.cpp
0a8fd9b610b2de92930c92d71ac184dc9e2bcb4d 21-Jun-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: detach from Dalvik when necessary.

This change adds a call to detach from the Davlik VM in SurfaceTexture
JNI calls that caused an attach.

Change-Id: I8e0d7d596680bd25ac42f8db4ca8343a62827255
raphics/SurfaceTexture.cpp
0694cfe49a889788e185a265deed0c231fe31f4b 23-Jun-2011 tedbo <tedbo@google.com> Merge "Add method to create a ParcelSurfaceTexture from android.view.Surface."
2305ac9e4a262ed09fd034ae417e9b1dda4c0ccb 23-Jun-2011 Vikas Arora <vikasa@google.com> Add WEBP to the list of Image formats that support Compression.

Note: The integrator of this change to Android internal code-repo will
have to run one extra step 'make update-api' to update 'api/current.txt'
file corresponding to approved API. The AOSP branch didn't have this
file, hence I could not add the same to this change. The updated file
'api/current.txt' has to be submitted along with this change.

Change-Id: I29909e907a2e82d801e16654322190a808c5bda9
raphics/Bitmap.cpp
4e8a5c922c287ec97fec847194e930f8598a1941 23-Jun-2011 tedbo <tedbo@google.com> Add method to create a ParcelSurfaceTexture from android.view.Surface.

Change-Id: I05e343ab7e327478f60322af9373574b70c148f5
raphics/ParcelSurfaceTexture.cpp
925bcaabde5a21687b51caa7ab329310a819f068 22-Jun-2011 Grace Kloba <klobag@google.com> Fix the issue where onFrameAvailable is not triggered if SurfaceTexture is in sync mode.

If there is more frame after updateTexImage, trigger the listener again.

Change-Id: I1415ae9a914cc8bb139cb369464b1f6a2aa24058
raphics/SurfaceTexture.cpp
84293fb9625a3ab7d7d302436bea05441b8d7316 18-Jun-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: attach to Dalvik when needed.

This change fixes a bug in the SurfaceTexture JNI where a thread that
the Dalvik VM was not aware of calls the onFrameAvailable callback.
When this happens the callback needs to first attach the thread to the
VM before attempting to post the onFrameAvailable event for Java code to
handle.

Change-Id: I6a5470c32611ea6f38e9167779450f50635cabd3
raphics/SurfaceTexture.cpp
f11c52d246d9e43c8533dff82979e7eeb72c1d50 16-May-2011 Derek Sollenberger <djsollen@google.com> Updates resulting from the Skia merge (revision 1327)

Change-Id: I1d2cecbad6c30e6ebc9579093404742f17e14e84
raphics/Canvas.cpp
raphics/NinePatchImpl.cpp
cc5278a3e258b30903102b718fb1cd832e79bb2b 10-Jun-2011 tedbo <tedbo@google.com> Support for setting a ParcelSurfaceTexture as the MediaPlayer sink.

This adds support for setting a SurfaceTexture as the MediaPlayer video
sink by using a ParcelSurfaceTexture object. The goal is to enable a
SurfaceTexture to pass through Binder (via ParcelSurfaceTexture) and then
be set on the MediaPlayer.

Change-Id: Ife5689ce673eb4bee1c377019db761685217b71d
raphics/ParcelSurfaceTexture.cpp
raphics/SurfaceTexture.h
050316184b01c0d1a01c46afae7429b89a27c31b 07-Jun-2011 tedbo <tedbo@google.com> Add ParcelSurfaceTexture Java class to enable ISurfaceTexture sharing via Binder.

This adds a new ParcelSurfaceTexture.java class that can be instantiated with
a SurfaceTexture and used to send the corresponding ISurfaceTexture interface
to another process via Binder. The ParcelSurfaceTexture java object can then
be used to create an ANativeWindow based on the SurfaceTextureClient interface.

Change-Id: Ie38ea948b866e52f36a6d0f6cde19b54a8546817
raphics/ParcelSurfaceTexture.cpp
raphics/SurfaceTexture.cpp
raphics/SurfaceTexture.h
de267191531fef134f0171c9ddb91498fe9400cd 08-Jun-2011 Jean-Baptiste Queru <jbq@google.com> Tweak setViewport stuff for fwd-compat

Change-Id: I532336eced54544115dfd47d5557cc77bafdfc87
raphics/Canvas.cpp
raphics/NinePatchImpl.cpp
af033caf26ef4eca99c4024e59def7e42c3fa4cd 06-Jun-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix USE_TEXT_LAYOUT_CACHE define

- fix compilation issues

Change-Id: I3358457d94d2278804e81e4ca96c9633ed76a147
raphics/Canvas.cpp
raphics/TextLayout.cpp
9743547cde4e823a397cfdfd79a3229af1f7ec7e 26-May-2011 Marco Nelissen <marcone@google.com> Fix crash when nesting Picture recording.

b/4490619, http://code.google.com/p/android/issues/detail?id=16644

Change-Id: Ia227c87cba61e0d0b6f86b01a064a3eefe447fe1
raphics/Picture.cpp
41701ac5f694074a41e3f1d2e0a889e8af792a37 18-May-2011 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix bug #4441002 Crash in SkPathEffectGlue::OneD_constructor"
78b868ff42cc368c45f851443678a822560dc266 18-May-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #4441002 Crash in SkPathEffectGlue::OneD_constructor

- take care of empty strings in TextLayoutCache when computing advances/glyphs with Harfbuzz

Change-Id: I8eb5f632feb7a86e5c4a6db03d073c4b7d859dbc
raphics/TextLayoutCache.cpp
43124d22142f708b39e79fb0d91258e6234b5f26 17-May-2011 Derek Sollenberger <djsollen@google.com> Merge "Updates resulting from the Skia merge (revision 1327)"
d39d1affe82cb8c21d32baaa5fbb2d6afb806f8e 16-May-2011 Derek Sollenberger <djsollen@google.com> Updates resulting from the Skia merge (revision 1327)

Change-Id: I2a8f5869dbe95bb594f2ba5d7278f9b330e6f17a
raphics/Canvas.cpp
raphics/NinePatchImpl.cpp
35844a3a4e6f7383d4e77f4426fbd71d5990bf6e 16-May-2011 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix bug #4415576 Gmail text looks broken"
8fb507171f68d4170cfeb1187ee7d1f70f98917d 14-May-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #4415576 Gmail text looks broken

- pass correct "contextCount" when needed

Change-Id: I56ebd9486e99e6ca5a3973ec403cf1ced874b4c3
raphics/Canvas.cpp
raphics/Paint.cpp
2ea75880142152b3a9993cb245754d73c05749a7 13-May-2011 Fabrice Di Meglio <fdimeglio@google.com> Prepare OpenGLRenderer to use glyphs from TextLayoutCache

- add OpenGLRenderer.drawGlyph()
- refactor glypth logging code

Change-Id: I797e6f1304d3f3f8f6ed31e7f9965d336233d2a4
raphics/Canvas.cpp
raphics/TextLayout.h
b0ca8b9dfd1a9dbd1fef2b44968c08c85771061f 13-May-2011 Jean-Baptiste Queru <jbq@google.com> am a84d29cb: am 6714e677: Merge "Ninepatch tweaks for better interop"

* commit 'a84d29cb0494310e9472884c7a459603eb305e38':
Ninepatch tweaks for better interop
0ceb9501b29cba97273ab983ba5d6efba037e75c 11-May-2011 Derek Sollenberger <djsollen@google.com> Adapt to latest skia

Change-Id: I39247db04ca8b7993b0f5a16fb0324828d04cc3a
raphics/BitmapRegionDecoder.cpp
raphics/Canvas.cpp
9faa34e6032e2d8759ae1ece72e78acda1730668 12-May-2011 Jean-Baptiste Queru <jbq@google.com> Ninepatch tweaks for better interop

Change-Id: I96781e2b27fcd6dd05d9726829e8e79ff365cbdc
raphics/NinePatchPeeker.cpp
raphics/NinePatchPeeker.h
c9e22e9affec97a8c68f838de29dc7f685d9247b 12-May-2011 Jean-Baptiste Queru <jbq@google.com> Switch to SkSafeUnref for better portability

Change-Id: Ia146a4728b5eb92626462effe42521ca73454a7d
raphics/Bitmap.cpp
raphics/Canvas.cpp
raphics/ColorFilter.cpp
raphics/DrawFilter.cpp
raphics/MaskFilter.cpp
raphics/PathEffect.cpp
raphics/Rasterizer.cpp
raphics/Shader.cpp
raphics/Xfermode.cpp
e7cb25916c70625e9086386293247ec604753d5c 02-May-2011 Conley Owens <cco3@android.com> am 1eb31b43: am 718516f3: am 9fd8e057: Merge "Fix memory leak of SkMovie class"

* commit '1eb31b434fdc325c55b65ecf1783c63b2fdfa669':
Fix memory leak of SkMovie class
1eb31b434fdc325c55b65ecf1783c63b2fdfa669 30-Apr-2011 Conley Owens <cco3@android.com> am 718516f3: am 9fd8e057: Merge "Fix memory leak of SkMovie class"

* commit '718516f3b73468c480ef8d2283a1c80a6223658d':
Fix memory leak of SkMovie class
8f67eae87ae84fb0c17e7fd4c9b6a62e73b0de29 26-Apr-2011 Romain Guy <romainguy@google.com> Take the index parameter into account in drawTextOnPath.

Change-Id: I92ff9b2c0fe16a467996ae1973bbfd4fad5ef750
raphics/Canvas.cpp
589e4e27ee071f028a4bc72b91a1fb053ab13404 26-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> 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
raphics/TextLayoutCache.cpp
0a1413e4bf9dcda2a8abb2287e43f612a7fb2453 22-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> 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
raphics/Paint.cpp
010d5c4e5ba7a229f621f08f5d1c5cbff7643402 22-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> TextLayout cache - update size and improve logging

- set size to 256K
- add pid logging
- fix percent gain computation

Change-Id: Id6da4d606147294e05597022414531c346860f45
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
4f810c8535055bd9a8d89a7d1ba0a7c712a8843d 19-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> Use Harfbuzz for Paint drawText / measureText / breakText APIs

Change-Id: I35aa02bfd45629bf5c560f98a28399ff3d0fc900
raphics/Paint.cpp
raphics/TextLayout.cpp
b39d89735b8d88669c779b6a8549a179fd0f6f44 19-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> Use Harfbuzz for Canvas drawText APIs

Change-Id: I661d5e9e0bbe9a859e7a000cb161994d29add099
raphics/Canvas.cpp
06732fde78b1caf8b5e6c0ef93357cfacedd1823 19-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> Return chars advances instead of glyphs advances

- take care of log_clusters for char/glyph mapping
- remove verbose logs

Change-Id: Id19af2b4a46cc4ada0b99263a3208de14a979ba5
raphics/RtlProperties.h
raphics/TextLayoutCache.cpp
f7b9e7848623efcb4f596aa06f055bb4d2ebe7f5 18-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> Merge "Add Unicode BiDi Algo before drawing text in Canvas"
689e515ed2b8064c15e54d8ab69d87de54c5e0d6 14-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> Add Unicode BiDi Algo before drawing text in Canvas

- only for temporary API
- update BiDiTest

Change-Id: Ifd445799dc0fda4da896246e41978cd8d71aa035
raphics/Canvas.cpp
raphics/RtlProperties.h
raphics/TextLayout.h
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
e9cf71dfd01f3e2006462de99d5c423038e20b65 13-Apr-2011 Elliott Hughes <enh@google.com> Merge "Don't allocate a raw object then call its constructor manually..."
cf6f7a0f006c0fcf59bb634cbe79f2a8500fd92a 13-Apr-2011 Elliott Hughes <enh@google.com> Don't allocate a raw object then call its constructor manually...

We can do this in one step.

Change-Id: Id6b70c83002038caf62fe89cc769eca54ae0c055
raphics/Graphics.cpp
raphics/Movie.cpp
4cb1753ec6e90d7e747880c599dc1c164a568cf3 13-Apr-2011 Elliott Hughes <enh@google.com> Remove useless forward declarations.

Change-Id: I8f191367acb18ea9a3f807e791099e0485b1b249
raphics/Bitmap.cpp
raphics/Camera.cpp
raphics/Interpolator.cpp
raphics/LayerRasterizer.cpp
raphics/MaskFilter.cpp
raphics/NinePatch.cpp
raphics/PathEffect.cpp
raphics/Region.cpp
raphics/Shader.cpp
raphics/Typeface.cpp
raphics/YuvToJpegEncoder.cpp
dd66bcbf9d6ef0c50a18d9c4b1b39ce7ef7afcc4 12-Apr-2011 Elliott Hughes <enh@google.com> 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
raphics/CreateJavaOutputStreamAdaptor.cpp
a3804cf77f0edd93f6247a055cdafb856b117eec 12-Apr-2011 Elliott Hughes <enh@google.com> 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
raphics/BitmapFactory.cpp
raphics/BitmapRegionDecoder.cpp
dcd2ef9acc34c70e7a3c698d7e01e8af0af00f20 09-Apr-2011 Elliott Hughes <enh@google.com> Merge "More JNI exception-throwing cleanup."
69a017bc1d1649350f830dfada5c6ed5eac0b770 08-Apr-2011 Elliott Hughes <enh@google.com> 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
raphics/Graphics.cpp
raphics/NinePatch.cpp
0343a7eb6d7cd2bd44dabe5119e2366e84427c93 08-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> Merge "TextLayoutCache - add glyphs caching"
fcf2be1846935e7983ea2fe87fdd4d7af27764b6 06-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> 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
raphics/Canvas.cpp
raphics/RtlProperties.h
raphics/TextLayout.cpp
raphics/TextLayout.h
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
8451b25a4422656bbd6657a5855e69c0f4d53c74 08-Apr-2011 Elliott Hughes <enh@google.com> 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
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/Movie.cpp
raphics/Paint.cpp
pengl/util.cpp
46e18c11d46a2bc1a46174f963d0ed1224d94cd2 06-Apr-2011 Brian Carlstrom <bdc@google.com> Don't use local ref for cached jclass reference in JNI code

Change-Id: Id45b2acb358a819f2fd332e99f3a095f6fc7299b
related-to-bug: 4241138
raphics/Movie.cpp
48796a81be31e42ee267347156c94445cb9fb67a 06-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> TextLayoutCache - more code refactoring

- move code from .h file to .cpp file

Change-Id: Ib8201a20e2767ef5d92707a6f4d8d79a3673e04d
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
1de9e7a9dffb4391a446000f748e4c017d948f6b 05-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> Code refactoring for TextLayoutCache

- rename TextLayoutCache entry name
- update references to old name
- better variable names in TextLayoutCache::getRunAdvances()

Change-Id: I5173fbc8af79437ce4786084580426f130120ce8
raphics/Paint.cpp
raphics/TextLayout.cpp
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
0fb1ac0038c9e67b5f321aa2ec7f7bfec5db6db2 31-Mar-2011 Fabrice Di Meglio <fdimeglio@google.com> Merge "Code cleaning - suppress non useful code"
99e95b0e1228dfeb2813590eedbef877ed2bd421 31-Mar-2011 Fabrice Di Meglio <fdimeglio@google.com> Code cleaning - suppress non useful code

Change-Id: I3f3bffdd1f5d64a6b601d56bee3b5fc8147086bd
raphics/TextLayoutCache.h
aabe537f1ed3b64f755af9fc62022d6074eec169 31-Mar-2011 Fabrice Di Meglio <fdimeglio@google.com> Update TextLayoutCache key for supporting more SkPaint properties

Change-Id: I35bb991e536e662c1a0724ab7e311fba3d52487a
raphics/TextLayoutCache.h
eee49c699c035ffba188417489f40d34f587d65c 25-Mar-2011 Fabrice Di Meglio <fdimeglio@google.com> 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
raphics/HarfbuzzSkia.cpp
raphics/HarfbuzzSkia.h
raphics/Paint.cpp
raphics/RtlProperties.h
raphics/TextLayout.cpp
raphics/TextLayout.h
raphics/TextLayoutCache.h
08d7778f081aae745e6ad9e5350221b21dbf352e 28-Mar-2011 Kimiyoshi Kusaka <kusaka.kimiyoshi@sharp.co.jp> 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
raphics/Movie.cpp
251ae9a7b466fe3938db359e3a61a198b315c40c 25-Mar-2011 Fabrice Di Meglio <fdimeglio@google.com> 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
raphics/TextLayoutCache.h
aa5eb64a0c0709a05731a934c033f213d6dbcc2f 23-Mar-2011 Fabrice Di Meglio <fdimeglio@google.com> Merge "Use Harfbuzz instead of ICU4C for computing advances"
9f82b580d744ce4baf057b061994394dcf239eed 08-Mar-2011 Fabrice Di Meglio <fdimeglio@google.com> 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
raphics/Canvas.cpp
raphics/HarfbuzzSkia.cpp
raphics/HarfbuzzSkia.h
raphics/Paint.cpp
raphics/RtlProperties.h
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
1a81aea8144b92ebaf807af9de69a0ab3415a5aa 21-Mar-2011 Romain Guy <romainguy@google.com> Update GL textures when changing a Bitmap's pixels
Bug #4146495

Change-Id: I4fe3f8501373b86b164af11ae51642b140035bb8
raphics/Bitmap.cpp
c5f94d8a4779050125145396ca83fbc862c7ed6b 18-Feb-2011 Eino-Ville Talvala <etalvala@google.com> 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
raphics/SurfaceTexture.cpp
8329db39f2f55484352d58b1820eb31a22698f11 15-Mar-2011 Romain Guy <romainguy@google.com> 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
ee7ace065f77b53a57cb6273b9f2f5d85caba90c 15-Mar-2011 Romain Guy <romainguy@google.com> Merge "Fix rendering artifact in edge fades. Bug #4092053" into honeycomb-mr1
7b5b6abf852c039983eded25ebe43a70fef5a4ab 15-Mar-2011 Romain Guy <romainguy@google.com> 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
raphics/Shader.cpp
977d1fbf47be1a95c1f39ec559ba60b32d0bf749 12-Mar-2011 Glenn Kasten <gkasten@google.com> am dd264f21: am 76470914: Merge "Bug 3515073 Add ANativeWindow_fromSurfaceTexture" into honeycomb-mr1

* commit 'dd264f21e6e9952b3d2ef53ea8a8a9e918e5ce96':
Bug 3515073 Add ANativeWindow_fromSurfaceTexture
7647091436c45af2d82f12c9ea9ec77fa309b49b 12-Mar-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 3515073 Add ANativeWindow_fromSurfaceTexture" into honeycomb-mr1
1f507be1c1ff2ec022d2ced1ad38fc328c28d3bb 10-Mar-2011 Wei-Ta Chen <weita@google.com> am a2048056: am 2498b4b8: Merge "Fix 3510563: memory leak in BitmapRegionDecoder." into honeycomb-mr1

* commit 'a204805627eddeac0a1777c69ce62d31d339d4cd':
Fix 3510563: memory leak in BitmapRegionDecoder.
b1a04d545673a1eedbc679a65dd6942da8d33790 08-Mar-2011 Chih-Chung Chang <chihchung@google.com> Fix 3510563: memory leak in BitmapRegionDecoder.

Change-Id: If639d5974204f18fdfd119b9fc7a762977c66f26
raphics/BitmapRegionDecoder.cpp
846db33313aa0899fa7928256c6734964bd92520 04-Mar-2011 Glenn Kasten <gkasten@google.com> Bug 3515073 Add ANativeWindow_fromSurfaceTexture

This is similar to ANativeWindow_fromSurface.

Change-Id: Iaadc06a5d0d50685c34876aa89488c16e7cfaa65
raphics/SurfaceTexture.cpp
13492c848f0fcf1ee3868228622641ca8bce6fb1 03-Mar-2011 Leon Scroggins <scroggo@google.com> Add ifdef to prevent header being added multiple times.

Change-Id: I92bb0667bea98e43fca20dceb4fff20e446c03cf
raphics/NinePatchPeeker.h
1eb12937329d0fcdc29d9c5ab6c549c42d2dcd52 03-Mar-2011 Fabrice Di Meglio <fdimeglio@google.com> Merge "Add TextLayout Cache"
a06d86ab8177ee9e631e0ee4e39688bf42179bde 02-Mar-2011 Leon Scroggins <scroggo@google.com> 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
raphics/BitmapFactory.cpp
raphics/NinePatchPeeker.cpp
raphics/NinePatchPeeker.h
d313c665e618af3194f504064bcd284fe5368682 25-Feb-2011 Fabrice Di Meglio <fdimeglio@google.com> 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
raphics/RtlProperties.h
raphics/TextLayout.cpp
raphics/TextLayout.h
raphics/TextLayoutCache.cpp
raphics/TextLayoutCache.h
447ee77431ddd68634bd49508de8573ab6c7065a 24-Feb-2011 Eric Hassold <hassold@google.com> Merge "Detect out of memory in extractAlpha"
ef7be262e5859efdf805d1b9612bc2b250d5971e 24-Feb-2011 Eric Hassold <hassold@google.com> 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
raphics/Bitmap.cpp
62c7574c02f2d83bafe7fc91bba6dbdf01b92a62 24-Feb-2011 Derek Sollenberger <djsollen@google.com> Merge "Skia Merge (revision 808)"
47b8adec3904535c8d8ce2b6e42ecd736f2d90ce 24-Feb-2011 Romain Guy <romainguy@google.com> Add a new Camera API to control the camera's location

Change-Id: Id9a082d2def803eb527e1987875e0d8a22c6e8aa
raphics/Camera.cpp
dd347df9f85e04d8b08a5249b8db731300699cc4 17-Feb-2011 Fabrice Di Meglio <fdimeglio@google.com> Code cleaning

- use constants whenever possible
- better memory allocation of buffers
- add logging thru conditional compilation

Change-Id: I486195b1cb35046ea00971630832978c1b2e64a0
raphics/TextLayout.cpp
raphics/TextLayout.h
6062c5912dc79704b489fc8c289b78a400ed05ee 22-Feb-2011 Derek Sollenberger <djsollen@google.com> Skia Merge (revision 808)

This is a companion CL to the one found in /external/skia

Change-Id: If81748545435cab20a5d8479329ab333cb973e16
raphics/Bitmap.cpp
raphics/Canvas.cpp
raphics/ColorFilter.cpp
raphics/DrawFilter.cpp
raphics/MaskFilter.cpp
raphics/PathEffect.cpp
raphics/Rasterizer.cpp
raphics/Shader.cpp
raphics/Xfermode.cpp
90f4c18a868aa921feae953e380a2f9f6a4ade38 08-Feb-2011 Andy McFadden <fadden@android.com> Use JNI helper function to get buffer address

This replaces the Get/Release sequence with a call to
jniGetNonMovableArrayElements.

Bug 3409356

Change-Id: I847fd67ac71d904fef0c807ac25a29f802e6cd45
raphics/Graphics.cpp
5a7e828842c26f64bb6e0ef3e0019e1949b245ee 04-Feb-2011 Chet Haase <chet@google.com> Fix crash when Paths are GCd in hw accelerated apps

A recent change to optimize path rendering didn't account for
the destruction of native objects by the VM finalizer. We may be
done with the Java level version before we're done with the native
structure that's used by the display list. For example, a drawing
method on a View that creates a temporary path to render into the
canvas will implicitly create a native structure that is put onto
the GL display list. That temporary path may go away, but the native
version should stick around as long as the display list does.

The fix is to refcount the original native version of the path
and only delete it when the refcoutn reaches zero (which means that
it is no longer needed by any display list). This is a similar mechanism
used for bitmaps and shaders.

Change-Id: I4de1047415066d425d1c689aa60827f97729b470
raphics/Path.cpp
120856c50a56595c0954ae1bf6f05888386937b9 19-Jan-2011 Joe Onorato <joeo@google.com> Pass SkRegion::toString() through to java.

Change-Id: I3814b491c689313c1f8da811a104d913175f6268
raphics/Region.cpp
4b26247e8b45850afc78e414a7007266dbdc5d18 18-Jan-2011 Owen Lin <owenlin@google.com> Merge "Change to stream decoding mode if the file descriptor cannot support seek." into honeycomb
a9d0d47076ecf2d1739bb3534abc9deead8ebebd 18-Jan-2011 Owen Lin <owenlin@google.com> Change to stream decoding mode if the file descriptor cannot support seek.

bug: 3298498
Change-Id: Id7ae46bf8e885a417753edbd6648332052fee469
raphics/BitmapFactory.cpp
1689c3459b27657b6900429ae64ac5323c584ce3 17-Jan-2011 Romain Guy <romainguy@google.com> Merge "Add BitmapFactory.Options.inMutable to load mutable bitmaps." into honeycomb
2361098da3b9d9c3eeed410dc72ba62c0e9177cf 17-Jan-2011 Romain Guy <romainguy@google.com> Add BitmapFactory.Options.inMutable to load mutable bitmaps.

Change-Id: Iaa222127520f3aa55072d44af12ee3477908b876
raphics/BitmapFactory.cpp
5cdf07524132722e0db69db1ca8dcaf3f0073265 17-Jan-2011 Jeff Brown <jeffbrown@google.com> Merge "Support non-rectangular input regions." into honeycomb
fbf097732137a32930d151f7ba6816a5b870c32a 16-Jan-2011 Jeff Brown <jeffbrown@google.com> Support non-rectangular input regions.

This enables the system bar to carve out a region through which
events will be sent to the IME behind it.

Bug: 3238092
Change-Id: I69b855a8d9b5b3ee525266c0861826e53e5b5028
raphics/Region.cpp
raphics/Region.h
376590d668e22a918439877b55faf075427b13f3 13-Jan-2011 Jamie Gennis <jgennis@google.com> Implement SurfaceTexture frame-available callback.

This change implements the onFrameAvailable callback for the
SurfaceTexture java class. It includes the C++ SurfaceTexture code as
well as the JNI and Java code to enable the callback.

Change-Id: Ifd8b8e7ad46ee70cba6da1c2e96dab8045d1ea30
raphics/SurfaceTexture.cpp
b0ba48c95ea8768a051100c5adb4c906caa1e080 10-Jan-2011 Jamie Gennis <jgennis@google.com> Add getTransformMatrix to the SurfaceTexture API.

Change-Id: Icd11ed4982220be9d08b00498aef02531610ce1f
raphics/SurfaceTexture.cpp
25bce3a673afef6a7858270afae4395b4ab53de3 24-Dec-2010 Wei-Ta Chen <weita@google.com> Do not merge.

Backport changes related to BitmapRegionDecoder from HoneyComb to
Gingerbread.

Bug: 3309014

////////////////////////////////////////////////////
This is a combination of 7 commits.
Revert "Do not merge."

This reverts commit f7681f84918c27f6a626681ce37ed2a236c44e82.

Change-Id: I46fd710600b1649773eaea2d9abc2b21a592f9a6

Fix a initialization bug in BitmapRegionDecoder.

Change-Id: I6c1151fd34970a84d4de52d664d9a5dc464892c5

Fix segfault when tring to throw IOException.

Change-Id: I530cc4409ba4ca17cec933afad077c5f60ba554f

Fix 3122139, where previewing an attachment for the second time will
fail.

Use AutoFDSeek to mark and restore the position before we read data from
the descriptor.

Change-Id: I3d4f012dce486e19b113bc90a98b94031cfa8195

Add inPreferQualityOverSpeed into BitmapFactory.Options.

The new field allows a developer to use a more accurate by
slightly slower IDCT method in JPEG decode. This in turns improves the
quality of the reconstructed image.

The field by default is not set and thus does not affect existing
applications.

Bug: 3238925
Change-Id: I93d55b7226e47a43e639325cd1a677694d6f2ee4

Unhide inPreferQualityOverSpeed in BitmapFactory.Options.

The new field allows a developer to use a more accurate by
slightly slower IDCT method in JPEG decode. This in turns improves the
quality of the reconstructed image.

The field by default is not set and thus does not affect existing
applications.

Bug: 3238925

Related changes: https://android-git.corp.google.com/g/#change,83291 and
https://android-git.corp.google.com/g/#change,83294

Change-Id: I969f5c413f9b2179454aeb90e18ae8222ee583b4

Correct the API comments.

BitmapRegionDecoder supports PNG as well.
raphics/BitmapFactory.cpp
raphics/BitmapFactory.h
raphics/BitmapRegionDecoder.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
6714efc5e0c52953b65e774de0003e22377e7d39 20-Dec-2010 Jamie Gennis <jgennis@google.com> Add the SurfaceTexture java class.

This class exposes to Java the application-side interface to the
SurfaceTexture C++ class.

Change-Id: I0dba42aad90257c7adbde6fa362658c0717b70d0
raphics/SurfaceTexture.cpp
a9ebfa6bcce62d7fee69693fe3dee6027afd3f0e 05-Jan-2011 Romain Guy <romainguy@google.com> Keep a reference to the local matrix.
Bug #3299324

This is needed for ADT, which does not rely on Skia's reference counting
to correctly keep track of the native objects.

Change-Id: Ia2fc5c1ec2b80bad226bc549fefc6bb064784609
raphics/Shader.cpp
12d81c49a015ed8d5ef7af2d854eee1e80472219 18-Dec-2010 Carl Shapiro <cshapiro@google.com> Fix a constructor declaration to match its definition.

The second argument of the JavaPixelAllocator constructor was
eliminated by an earlier change but the class definition was not
updated to match that edit.

Change-Id: I27af0cc52c748cfdec02eb4edcf512dd13f72567
raphics/GraphicsJNI.h
2118b25ad422e946d4d87e191c5710bfacd7503e 18-Dec-2010 Carl Shapiro <cshapiro@google.com> Eliminate tracked allocations and the inNativeAlloc option.

Change-Id: Ic10b2b41a26925d799e5d1e50be77fc480ec0f17
raphics/BitmapFactory.cpp
raphics/BitmapRegionDecoder.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
a2f0e2d6b7f9dff3a52dd78d6db307070a71e9b2 16-Dec-2010 Patrick Dubroy <dubroy@google.com> Allow a JNI local ref to be passed directly into globalRef().

Change-Id: If3063e88ec1eba7a13c983f5f71be6a2d84c4d60
raphics/Graphics.cpp
raphics/GraphicsJNI.h
afde46ed008f150e45e1b0d7e1dc588fc047b74f 15-Dec-2010 Patrick Dubroy <dubroy@google.com> Turn fatal assertion in decodeRegion into a warning.
raphics/BitmapRegionDecoder.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
e4ac2d6b5723c95e648c489b187ddde449452c13 01-Dec-2010 Patrick Dubroy <dubroy@google.com> Allocate bitmap backing buffers in the Java heap.

Change-Id: I60f6ccff13357c1c518e9d56b02fe0171637edd1
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/BitmapRegionDecoder.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
dee4cb07a3652457e18a0bf4be57d2cedeca7359 13-Dec-2010 Jack Palevich <jackpal@google.com> Avoid SIGSEGV in Bitmap_writeToParcel.

SkBitmap::getPixels() can return NULL. The rest of the JNI Bitmap
code treats this NULL as if the SkBitmap has transparent black
pixels. Bitmap_writeToParcel now does the same.

Change-Id: I5e70b42b3d22a8aea898ce342e590000325bd0f9
raphics/Bitmap.cpp
decc8cd41eca3770c8f5ee13d81b9cd5f0c25ccd 11-Dec-2010 Chet Haase <chet@google.com> Add ability to reuse bitmaps when decoding PNG content

Change-Id: Ic74b62c6280954ff80bcf64f3989a36c7c0b5615
raphics/BitmapFactory.cpp
37f74cad46c6f1799aec3c52e8f47598237f43d4 09-Dec-2010 Chet Haase <chet@google.com> Add ability to reuse bitmaps when loading new content

Change-Id: Ic5f5f40ee39787403977fb372b335dc21cf07243
raphics/BitmapFactory.cpp
ddb76c4644756b31be948d70aaa8ee541dd94999 24-Nov-2010 Kenny Root <kroot@google.com> Change assets to use 64-bit API

The asset system and supporting libraries were using off_t instead of
off64_t to access files larger than 2GB (32-bit signed). This change
replaces all off_t with off64_t and lseek64.

There is a new utils/Compat.h added for Mac OS compatibility.

Also fixed some size-related compiler warnings.

Bug: 3205336
Change-Id: I9097b3cb7a602e811fe52f245939d8975da55e9e
raphics/BitmapFactory.cpp
raphics/Typeface.cpp
raphics/Utils.cpp
raphics/Utils.h
953f9094a2ec14594fa8501d5f3e2d9e300b1b62 03-Dec-2010 Wei-Ta Chen <weita@google.com> Add inPreferQualityOverSpeed into BitmapFactory.Options.

The new field allows a developer to use a more accurate by
slightly slower IDCT method in JPEG decode. This in turns improves the
quality of the reconstructed image.

The field by default is not set and thus does not affect existing
applications.

Bug: 3238925
Change-Id: I93d55b7226e47a43e639325cd1a677694d6f2ee4
raphics/BitmapFactory.cpp
raphics/BitmapFactory.h
raphics/BitmapRegionDecoder.cpp
fe48f65922d4a3cc4aefe058cee5acec51504a20 12-Nov-2010 Romain Guy <romainguy@google.com> Free resources only from the GL context thread.
Bug #3179882

Resources were freed following garbage collections on a worker thread.
This worker thread had no EGL context, which would cause the renderer
to incorrectly assume that the memory was liberated.

Change-Id: Ifdb51f94ddf42641e8654522787bfac532976c7c
raphics/Path.cpp
2a3d754549abc4b55e6cfc2d0c986d29782b2492 03-Nov-2010 Bryan Mawhinney <bryanmawhinney@google.com> Avoid copying byte arrays when just decoding bounds.

Currently, if a caller specifies both "purgeable" and "just decode
bounds" options when passing a byte array to decode, we create an
unnecessary copy of the byte array. This is probably not common,
but we may as well avoid the copy.

Change-Id: I27e573b0e1fb8f8516729882a84efa02b6da08a5
raphics/BitmapFactory.cpp
ad93c2bb63dfc813b2eefa1043aa63afbddce655 23-Oct-2010 Chet Haase <chet@google.com> Optimizing ColorFilter in display lists

Change-Id: Ie4d5e5b0bc45e0ce47bba144049303c270762e54
raphics/ColorFilter.cpp
raphics/Shader.cpp
d98aa2de9ab18e09c2be1997f41212740f51f6e6 26-Oct-2010 Chet Haase <chet@google.com> DisplayList optimizations and fixes.

We now use a copy of SkPaint objects to avoid having it changed from under us.
We reuse copies that have not changed. We also copy the SkMatrix every time to
avoid the same problem.

Change-Id: If3fd80698f2d43ea16d23302063e0fd8d0549027
raphics/Matrix.cpp
raphics/Paint.cpp
50db92c452ece8d52d898d1ed289bbb3c43859ed 22-Oct-2010 Wei-Ta Chen <weita@google.com> Merge "Fix 3122139, where previewing an attachment for the second time will fail."
27f0b17d853d8bef918c3d869044e50cf3904ee3 22-Oct-2010 Chet Haase <chet@google.com> Fix native resource leak when OpenGL renderer is not being used.

Native resources (bitmaps, matrices, paints, shaders) are shared when display lists
are used, and a refcounting system is in place to take care of disposing when all
clients are finished with them. But the cache where these refcounts are tracked is
not enabled when the Open GL renderer is not being used. This results in the native
destructors not being called, and the resources are leaked.

Change-Id: Ic7aeb55e4636dcad229846601407e596160346e6
raphics/Bitmap.cpp
raphics/Matrix.cpp
raphics/Paint.cpp
58c1579ce2634de31d24429c1b870d4256ee4f21 22-Oct-2010 Wei-Ta Chen <weita@google.com> Fix 3122139, where previewing an attachment for the second time will
fail.

Use AutoFDSeek to mark and restore the position before we read data from
the descriptor.

Change-Id: I3d4f012dce486e19b113bc90a98b94031cfa8195
raphics/BitmapRegionDecoder.cpp
5c13d89c1332fcc499379b9064b891187b75ca32 08-Oct-2010 Chet Haase <chet@google.com> Optimizing display lists by referencing pointers to resources instead of copying them

Change-Id: I81ad3551d74aa1e5bb64d69e33d2eb29a6c1eb6a
raphics/Bitmap.cpp
raphics/Matrix.cpp
raphics/Paint.cpp
raphics/Shader.cpp
c9332fa3e9e9e0897482a9c26cf9d997e57376b7 13-Oct-2010 Bjorn Bringert <bringert@android.com> Delete unused WebView drag tracking code

This also removes android.graphics.utils.BoundaryPatch
which was only used by the Browser for the unused drag
tracking (and by a demo app that I'm also removing).

Change-Id: I48253ae005ab11cb4c70d132bc1ea4f2692e2bd2
raphics/Canvas.cpp
f7681f84918c27f6a626681ce37ed2a236c44e82 01-Oct-2010 Wei-Ta Chen <weita@google.com> Do not merge.

Fix 3052285 by not publishing the BitmapRegionDecoder API until the honeycomb release.

Bug: 3052285
Change-Id: Ie339e414c1a5581e1d38684621e0e97162616977
raphics/BitmapRegionDecoder.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
20e987bfc35d0ae6cb6344ead65ed44ee7cf8750 23-Aug-2010 Jeff Brown <jeffbrown@google.com> Add MotionEvent Matrix transformations.

Fixed issued in ViewGroup's transformation of MotionEvents to ensure
that the entire historical trace is transformed, not just the current
pointer.

Simplified the code in ViewGroup for splitting events across Views.
The new code also handles the case where some pointers are dispatched
to the ViewGroup in addition to its children whereas the previous
code would drop some pointers on the floor.

Change-Id: I56ac31903e1de8a9c376d9c935b7217b0c42d93e
raphics/Matrix.cpp
raphics/Matrix.h
e224fabb2c59e9f1274c3569c04b91787824add0 30-Sep-2010 Owen Lin <owenlin@google.com> Fix segfault when tring to throw IOException.

Change-Id: I530cc4409ba4ca17cec933afad077c5f60ba554f
raphics/Graphics.cpp
0ab9851308c02928c34e7261c4d4521c07e64f0e 29-Sep-2010 Owen Lin <owenlin@google.com> Fix a initialization bug in BitmapRegionDecoder.

Change-Id: I6c1151fd34970a84d4de52d664d9a5dc464892c5
raphics/BitmapRegionDecoder.cpp
a23cdda0a5fad7798454ecb05a7855cb9211ea22 23-Sep-2010 Wei-Ta Chen <weita@google.com> am ac487f70: am 6b849e21: Unhide BitmapRegionDecoder.

Merge commit 'ac487f708f7b58dbd4f3021b520c6ed5975daebe'

* commit 'ac487f708f7b58dbd4f3021b520c6ed5975daebe':
Unhide BitmapRegionDecoder.
6b849e2123be98eb2a1a25b8abf0b13a279ce952 07-Sep-2010 Wei-Ta Chen <weita@google.com> Unhide BitmapRegionDecoder.

1. Rename LargeBitmap to BitmapRegionDecoder
2. Move the instantiations of BitmapRegionDecoder out of BitmapFactory.
3. Remove the use of MemoryFile in BitmapRegionDecoder, since MemoryFile's API had been modified in master. Otherwise, the change will break the master build.
4. Move AssetStreamAdaptor, AutoFDSeek and nullObjectReturn to Utils.h because BitmapFactory.cpp and BitmapRegionDecoder.cpp both need to use these utility functions.

Most of the modifications, except for (2) and (3), were reviewed in https://android-git.corp.google.com/g/#change,64716 .
However, that change broke the master build due to (3) and was reverted eventually.
So, instead of withdrawing this change and waiting for that change to be checked in again, I merge the two changes into one.

Change-Id: I2202c0fbbbd6d6676bbd9637e690023ea4099c40
raphics/BitmapFactory.cpp
raphics/BitmapRegionDecoder.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/LargeBitmap.cpp
raphics/Utils.cpp
raphics/Utils.h
ddb80bebb0776e6d852aab6e8bba5d5591847a55 21-Sep-2010 Romain Guy <romainguy@google.com> Add support for circular gradients to the GL renderer.

This change also adds full support for local transformation matrices on
sweep and radial gradients.

Change-Id: Id8773bc0766575190e3f3d51984fc5e57b266c3f
raphics/Shader.cpp
ee916f14cbd1fe1422c063ce2ef7b185e2bc5c6f 21-Sep-2010 Romain Guy <romainguy@google.com> Add support for SweepGradient in the GL renderer.

Change-Id: I7aa397ed4e34655ead9ba1f5b4ce087665e0f022
raphics/Shader.cpp
94b19d37066a7739991bc73381f9296abad69265 10-Sep-2010 Joseph Wen <josephwen@google.com> am 94db0238: am 219eb7ec: Merge "Fix bug in JNI BitmapFactory" into gingerbread

Merge commit '94db0238a3b6cba3cbf0e037af74e898a4741204'

* commit '94db0238a3b6cba3cbf0e037af74e898a4741204':
Fix bug in JNI BitmapFactory
219eb7ec8403ef9b98125f2b58cc27669ae69712 10-Sep-2010 Joseph Wen <josephwen@google.com> Merge "Fix bug in JNI BitmapFactory" into gingerbread
2dcfbefbbeac406d16ec379c6430dd9ee9fd23a1 10-Sep-2010 Joseph Wen <josephwen@google.com> Fix bug in JNI BitmapFactory

In nativeCreateLargeBitmapFromFileDescriptor() if the file descriptor
can not be rewinded isShareable should be set to false.

Change-Id: I7dd545c9d52d21c226e11b8921e35a1d9bba9515
raphics/BitmapFactory.cpp
9584a542e345fa18fc62eb0b5947f250226f211d 09-Sep-2010 Romain Guy <romainguy@google.com> Merge "Purge Skia objects from GL caches as needed."
a2341a9f6addcd79723965ec5b1a1c5ae0f8bd65 09-Sep-2010 Romain Guy <romainguy@google.com> Purge Skia objects from GL caches as needed.

Change-Id: I754c671cf790ad5ae8bf047ad328034217da4ecc
raphics/Bitmap.cpp
raphics/Path.cpp
raphics/Shader.cpp
53e7ae9065e506da2f0337c7c77cf2749d9ee970 09-Sep-2010 Romain Guy <romainguy@google.com> Merge "Fix possible infinite loop when purging textures."
9aaa8269a3e7291aab84d01c3fc9c744d8f2d2f4 09-Sep-2010 Romain Guy <romainguy@google.com> Fix possible infinite loop when purging textures.

Change-Id: Ib05b398ae03e734da2dab0496df416fed4570b1c
raphics/Bitmap.cpp
cfa590392660fc4a50dc90c456d1fab69e6e0662 08-Sep-2010 Elliott Hughes <enh@google.com> am 664c48e9: am 4c7d3f28: Merge "Remove dead code: NIOBuffer." into gingerbread

Merge commit '664c48e991a70d07646d54125e97f579f3a33be4'

* commit '664c48e991a70d07646d54125e97f579f3a33be4':
Remove dead code: NIOBuffer.
7b29804ba2b0db1a627b680b3fe2c5036139513b 08-Sep-2010 Wei-Ta Chen <weita@google.com> am 8fc6f8b2: am 1b214be9: Merge "Revert "Rename LargeBitmap to BitmapRegionDecoder for having a better API."" into gingerbread

Merge commit '8fc6f8b2152564cab6ede025644f9bc3ee61ce16'

* commit '8fc6f8b2152564cab6ede025644f9bc3ee61ce16':
Revert "Rename LargeBitmap to BitmapRegionDecoder for having a better API."
340ce75b446f6a6afc12b0582be3fc34ac3a5364 08-Sep-2010 Wei-Ta Chen <weita@google.com> Revert "Rename LargeBitmap to BitmapRegionDecoder for having a better API."

This reverts commit 50ba3d2c09a9131f3578d271adf2bc8258ca1742.
raphics/BitmapFactory.cpp
raphics/BitmapRegionDecoder.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/LargeBitmap.cpp
raphics/Utils.cpp
raphics/Utils.h
50cb7dc458e65b75fb69a3a3fed972e7ed913703 08-Sep-2010 Wei-Ta Chen <weita@google.com> am a295a390: am b356f8ac: Merge "Rename LargeBitmap to BitmapRegionDecoder for having a better API." into gingerbread

Merge commit 'a295a3908befeb9dd30203c612d95411d68492ed'

* commit 'a295a3908befeb9dd30203c612d95411d68492ed':
Rename LargeBitmap to BitmapRegionDecoder for having a better API.
edf7223bc2972b99306e31c5b424c365d9248817 08-Sep-2010 Elliott Hughes <enh@google.com> Remove dead code: NIOBuffer.

Working on speeding up our NIO implementation, I came across this suboptimal
code. Happily, it turns out to be unused.

Bug: 2935622
Change-Id: I07ae6e573d63e439f496d55af215b34598d8258a
raphics/Graphics.cpp
raphics/NIOBuffer.cpp
raphics/NIOBuffer.h
50ba3d2c09a9131f3578d271adf2bc8258ca1742 07-Sep-2010 Wei-Ta Chen <weita@google.com> Rename LargeBitmap to BitmapRegionDecoder for having a better API.

Move AssetStreamAdaptor, AutoFDSeek and nullObjectReturn to Utils.h because
BitmapFactory.cpp and BitmapRegionDecoder.cpp both need to use these utility functions.

Change-Id: I3e60c7fe4abd0289e1384e69a08fd20fe6fb0e10
raphics/BitmapFactory.cpp
raphics/BitmapRegionDecoder.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/LargeBitmap.cpp
raphics/Utils.cpp
raphics/Utils.h
ce53603a4fdf07df8b6d993e1332a28321b5593b 21-Aug-2010 Wei-Ta Chen <weita@google.com> am 9f7257f0: am 8d124f70: Merge "Fix a bug, where one thread is using JNIEnv associated with another thread." into gingerbread

Merge commit '9f7257f0a14cd17d8b55bc3bd1584dac2f9dd1b2'

* commit '9f7257f0a14cd17d8b55bc3bd1584dac2f9dd1b2':
Fix a bug, where one thread is using JNIEnv associated with another thread.
18ef37258d897928c68b89535a93b99d8a817d3c 20-Aug-2010 Romain Guy <romainguy@google.com> DO NOT MERGE. Fix the build.

Change-Id: I3322faa948af015f7d8df31b9a4c281f5311f067
raphics/BitmapFactory.cpp
4f0a8df9fe70b44e82eca40263b11e9331f38939 20-Aug-2010 Romain Guy <romainguy@google.com> Fix the build.

Change-Id: I71e77cb3c124b31b81d952dc3897ebc414a1f701
raphics/BitmapFactory.cpp
288471d8a57e1c318742cbfc28697877436fdb87 19-Aug-2010 Romain Guy <romainguy@google.com> DO NOT MERGE. Load assets in place instead of deferring until draw.

Before this change, all framework assets would be decoded at drawing time
outside of zygote. This was forcing all apps to re-decode the assets and
zygote to keep an in-memory copy of each asset. This behavior is now
opt-in by setting the inPurgeable flag on BitmapFactory.Options.

Change-Id: Ief823139163d8071b8ee1267746622faf52eb8ec
raphics/BitmapFactory.cpp
207b3ab604bcbe47fa55f26f358cde60cf8a784d 19-Aug-2010 Romain Guy <romainguy@google.com> Load assets in place instead of deferring until draw.

Before this change, all framework assets would be decoded at drawing time
outside of zygote. This was forcing all apps to re-decode the assets and
zygote to keep an in-memory copy of each asset. This behavior is now
opt-in by setting the inPurgeable flag on BitmapFactory.Options.

Change-Id: Ic703f57adb26b2a701ecff0a653d35a93e26d47c
raphics/BitmapFactory.cpp
291303ba3dbb3a0173bcc82ded595ca75df7b50e 18-Aug-2010 Wei-Ta Chen <weita@google.com> Fix a bug, where one thread is using JNIEnv associated with another thread.

We see abort messages like this when using JavaPixelAllocator and JavaMemoryUsageReporter.
W/dalvikvm( 680): JNI WARNING: threadid=2 using env from threadid=10
W/dalvikvm( 680): in Landroid/graphics/LargeBitmap;.nativeClean (I)V (CallVoidMethodV)

To fix it, we keep JavaVM, rather than JNIEnv, in JavaPixelAllocator and JavaMemoryUsageReporter,
because JavaVM allows us to get the JNIEnv corresponds to the current thread.

Change-Id: Ibd4b394a53dd3fdccc5a442eeb0dedf836479575
raphics/Graphics.cpp
raphics/GraphicsJNI.h
1b10d3d23512f9f9a091e1f4c27bb3dc47806f6c 17-Aug-2010 Joseph Wen <josephwen@google.com> am 81dcea60: am f1f48bc7: Do JPEG tile-based decoding.

Merge commit '81dcea6093dfcdadd52982505249a5eacf47a81b'

* commit '81dcea6093dfcdadd52982505249a5eacf47a81b':
Do JPEG tile-based decoding.
f1f48bc7f200f54c76b22d845d8ba8419879b375 19-Jul-2010 Joseph Wen <josephwen@google.com> Do JPEG tile-based decoding.

Change-Id: I5c1b4ac3c02eb4350ef0ba9a7877b22cfd730cfb
raphics/AutoDecodeCancel.cpp
raphics/AutoDecodeCancel.h
raphics/BitmapFactory.cpp
raphics/BitmapFactory.h
raphics/CreateJavaOutputStreamAdaptor.cpp
raphics/CreateJavaOutputStreamAdaptor.h
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/LargeBitmap.cpp
1e45aae5de003657e5d18f74d34998f5de5db5b7 14-Aug-2010 Romain Guy <romainguy@google.com> Add drop shadows.

Change-Id: Ic6a72409d4785968d1fbdff229f17ee5c00b240b
raphics/Paint.cpp
48daa54d31fc59ec969dcff65eb3cbb0ce879a8d 11-Aug-2010 Romain Guy <romainguy@google.com> Add extra blending modes.

This change adds the following blending modes for shaders and color filters:
Add
Multiply
Screen
Overlay
Darken
Lighten

Change-Id: Iff22f5ce6041b43c71b1857d73013f5010ab3413
raphics/Shader.cpp
61c8c9c5b2006d18e9310b6521c65b36ffe75ce4 10-Aug-2010 Romain Guy <romainguy@google.com> Fix tons of bugs and add new text rendering support.

Change-Id: I326c66b10784006f6df2f12d38e120cef94cd0d7
raphics/Shader.cpp
raphics/TextLayout.cpp
raphics/TextLayout.h
163935113919a184122b8b3bd672ef08c8df65dc 08-Aug-2010 Romain Guy <romainguy@android.com> 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
raphics/Canvas.cpp
raphics/ColorFilter.cpp
raphics/Shader.cpp
db1938e0e6ef816e228c815adccebd5cb05f2aa8 03-Aug-2010 Romain Guy <romainguy@google.com> Add support for ColorFilters.

Color filters are fully supported and can be used with shaders.

Change-Id: Id90ccf1c81cb462f2431f366f3f8f710d7971e04
raphics/ColorFilter.cpp
06f96e2652e4855b6520ad9dd70583677605b79a 31-Jul-2010 Romain Guy <romainguy@google.com> 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
raphics/Shader.cpp
9226298891119acff6b5e8b65fb7074fb99dc0c0 26-Jul-2010 Romain Guy <romainguy@google.com> Fix text corruption when rendering RTL enabled text.

Change-Id: I5450fd9cad1c5a66875affdbcd34308aea4c36ac
raphics/TextLayout.cpp
raphics/TextLayout.h
e8e62a4a032a80409114a37908b5f18ab0080848 24-Jul-2010 Romain Guy <romainguy@google.com> Add text alignment support to drawText().

This change also integrates better support for RTL text.

Change-Id: I6da8f5cf5dc28ca7cf1b22e27b0d853c919e8481
raphics/TextLayout.cpp
raphics/TextLayout.h
8cd48574a755bea86243e9f9eabaee341ecf9c60 16-Jul-2010 Gilles Debunne <debunne@google.com> Fixed bug in BitmapFactory.decodeStream

Downloading images over a slow connection could result in errors and
null images.

The JavaInputStreamAdaptor::do_skip method was correctly called in a
loop (to handle the EOF case using read()), but the amount that was
skipped at each time was not decreased by the amount already skipped.

Bug http://code.google.com/p/android/issues/detail?id=6066

Cherry picked from master CL57808

Change-Id: Ie6856898b21ba31de1209e1f995b4ae784c919b9
raphics/CreateJavaOutputStreamAdaptor.cpp
a1db574036c9bc2d397b69f8200594027e1fff16 20-Jul-2010 Romain Guy <romainguy@google.com> Add preliminary support for text rendering.

Change-Id: I547eb631dbda24d13960d54b4144fb8908fd8a49
raphics/Typeface.cpp
ea2604d966dfc62f50922a516caaa9cc411d9c64 17-Jul-2010 Romain Guy <romainguy@android.com> Merge "Add plumbing to support gradients in OpenGL renderer."
7fac2e18339f765320d759e8d4c090f92431959e 17-Jul-2010 Romain Guy <romainguy@android.com> 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
raphics/Shader.cpp
fc224b3e5397f8a9246d373c866be55a7cbb6188 16-Jul-2010 Gilles Debunne <debunne@google.com> Fixed bug in BitmapFactory.decodeStream

Downloading images over a slow connection could result in errors and
null images.

The JavaInputStreamAdaptor::do_skip method was correctly called in a
loop (to handle the EOF case using read()), but the amount that was
skipped at each time was not decreased by the amount already skipped.

Bug http://code.google.com/p/android/issues/detail?id=6066

Change-Id: Id897cdbe027e2d8c56df9fc399b3c92affb89c59
raphics/CreateJavaOutputStreamAdaptor.cpp
f7cb1f75fdaedf996cab7c4690b080adc7bc5b97 02-Jul-2010 Doug Felt <dougfelt@google.com> Support bidi/shaping for getTextPath

Move layout-related code into separate class since it's needed by both
canvas and paint.

Change-Id: Iba89a1d94d7cca650255ffa3cbc952b988a51b54
raphics/Canvas.cpp
raphics/Paint.cpp
raphics/TextLayout.cpp
raphics/TextLayout.h
4beb8ff7175ebd14b96942724a658f407d0b9951 09-Jun-2010 Doug Felt <dougfelt@google.com> Support bidi layout for drawTextOnPath.

Change-Id: Ie5867fdb66fe15336774e20d65fa63e0d05bf6fe
raphics/Canvas.cpp
0bbae0836426ba2704e38e7f90a9d0ca502ab71d 16-Jun-2010 Romain Guy <romainguy@google.com> Add new API to check whether a Bitmap was modified.

Bitmap.getGenerationId() can be used by caches to find out if a Bitmap has been
modified. This simply exposes an existing Skia API.

This change also adds a small test app for Canvas hardware acceleration. The new
Bitmap API is required to implement a texture cache.

Change-Id: I8547b146cd14c8afe1a2327fcd6d71b1b1cb68fc
raphics/Bitmap.cpp
0c702b88c5d0d4380930b920f5be6e66dd95a0d8 14-May-2010 Doug Felt <dougfelt@google.com> Move shaping to native.

Add internal API (getTextRunAdvances) to Paint, use when measuring.
Add internal API (getTextRunCursor) to Paint, use when determining
valid cursor positions.

Remove java-level shaping code. Remove 'prep' code in TextLine
(except for replacement text) since shaping now is done on the fly as
needed in native.

Provide explicit shaping context bounds to internal text measuring,
cursor movement, and rendering APIs.

Update for to changes in external API in ushape.h.

Change-Id: I146958b624802ce8553125e5c3c6c03031bc9608
raphics/Canvas.cpp
raphics/Paint.cpp
f47d7405bbcb25d7cdf89ebb059f41520fe9ab87 22-Apr-2010 Doug Felt <dougfelt@google.com> Modify Canvas drawText to run bidi and shape.

Adds drawTextRun as internal API on Canvas and GraphicsOperations.
Adds implementation to implementors of GraphicsOperations.

Adds state and API on Paint to control the bidi algorithm when used
by Canvas. This API is currently hidden.

The drawText changes are incomplete since shaping is not yet available
in the native code.

Change-Id: I4368048aef9545df0953a349381771603e04b619
raphics/Canvas.cpp
54900e8c05e92a0783e8468ad7c4513eb66adc80 25-Mar-2010 Mike Reed <reed@google.com> update dox that we ignore the exact parameter on computeBounds

Change-Id: I6051210ea2a73b4d1c6cd631a285209ab130b4e5
raphics/Path.cpp
39f10ec7dac59b5a8bc6f7e5b86846da77c30337 24-Mar-2010 Mike Reed <reed@google.com> If we detect a 9patch chunk, force the config chooser to avoid 565, with its pre-dithering madness

Change-Id: I0a2d1b094ccb16d479524779acec0216dc7a80ee
raphics/BitmapFactory.cpp
36ad54acef82f80dbf0ecdd8c44f5764df1be119 10-Mar-2010 Mike Reed <reed@google.com> force purgeability for assets

Change-Id: I1067cfb91846a05290ed26ce9a62eb82d3170719
http://b/issue?id=1860187
raphics/BitmapFactory.cpp
aa86859b1035f865147b4f76ad2a9eed7ee098a5 10-Mar-2010 Chia-chi Yeh <chiachi@android.com> YuvImage: jpeg_set_quality() should be called after jpeg_set_defaults().

Change-Id: I6579ad9241dd5ee6aabf54e1a1128d17b4f6b3e6
raphics/YuvToJpegEncoder.cpp
1a9c27c312ba20b2ceafcde18ce451724782d2a5 06-Mar-2010 Ficus Kirkpatrick <ficus@android.com> Add a LOG_TAG for android.graphics.Graphics JNI.

It occasionally logs when it fails an allocation but wasn't
defining one before.

Change-Id: Ifc41addc870eb126616ad44465638423d51568d9
raphics/Graphics.cpp
76d1e01d5e65c4631c827831e98ad4e300d99eab 05-Mar-2010 Mike Reed <reed@google.com> hidden api sameAs() to compare the pixels of 2 bitmaps for equality
raphics/Bitmap.cpp
a696f5d667227365da732481770767dcb330dd23 18-Feb-2010 Mathias Agopian <mathias@google.com> Add ImageFormat.java and move the Camera/YUV constants from PixelFormat to it.

PixelFormat's corresponding constansts are now deprecated.
raphics/YuvToJpegEncoder.cpp
8f2423e8f394ae0666f1b61f83df4c0c7a4782d9 17-Feb-2010 Mathias Agopian <mathias@google.com> get rid off the YUV formats at the libui layer
raphics/YuvToJpegEncoder.cpp
bca2d613e0d6d2630fedd302c0d779b7610adbcf 30-Nov-2009 Wei-Ta Chen <weita@google.com> Add a Java API that converts yuv data to a jpeg.

The compression is done in the native layer via calling libjpeg.

Bug: 2285598
raphics/YuvToJpegEncoder.cpp
raphics/YuvToJpegEncoder.h
ab4a0c164b5a44d5bfd37069cfe499db31e7620c 26-Jan-2010 Mike Reed <reed@google.com> add API to change default config on image decoders.

May be called by the browser to get high-quality images when running in a 32bit window
raphics/BitmapFactory.cpp
a6276fdd4253c3a7150ab675678c750473ab6c45 28-Dec-2009 Jack Palevich <jackpal@google.com> A library for encoding and decoding ETC1 textures.

The ETC1 compressed texture format is commonly
supported by OpenGL ES 2.0-capable devices.
pengl/util.cpp
31a69fdbe1edd8d686043e8ca7d278289f65808e 14-Dec-2009 Mike Reed <reed@google.com> throw if we have a null typeface native instance (so we don't crash in native code)
we may still have to native-destroy a Typeface with a null ref, so check for that
raphics/Typeface.cpp
58d30b69071363aba38307bc5ee3b2d81f22f09d 30-Oct-2009 Mike Reed <reed@google.com> am 1864d01f: Merge change Iae849da2 into eclair

Merge commit '1864d01f2be0e82da7d8844fa91bee8880282041' into eclair-mr2

* commit '1864d01f2be0e82da7d8844fa91bee8880282041':
add table maskfilter
0e1e62301112a51d9b91ac4ac31c406d726f93ab 29-Oct-2009 Mike Reed <reed@google.com> add table maskfilter

hidden for now, since it need only be seen by Launcher2

http://b/issue?id=2210685
raphics/MaskFilter.cpp
c04851fd0af87f44a7d7351e0c17442fa1d3fc28 28-Oct-2009 Mike Reed <reed@google.com> add boundary patch
raphics/Canvas.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
a78b0a2d9ebb38b86ed802b3d86de07d0b301262 07-Oct-2009 Mike Reed <reed@google.com> add (hidden) setHasAlpha() to allow clients like the view's cache to hint that a bitmap is opaque.

Knowing that a 32bit bitmap is opaque is a performance boost for some blits.
raphics/Bitmap.cpp
afa78967b8553443aa32579d78970a076d7581f6 29-Sep-2009 Dianne Hackborn <hackbod@google.com> Hack to fix issue #2125365: Sports Trivia compatability with Eclair

Adds a mechanism to tell Paint the scaling factor its target
canvas will have, for it to compute font metrics based on the
correct font size. Only TextView uses this, but that is enough
for the large majority of apps.

Change-Id: I6cacaa0dd26d40ee3ad959bed0028678d6e9016e
raphics/Paint.cpp
9251c344596847c4cd4cf5782fde078459fa4cea 24-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 26851 into eclair

* changes:
use new setDither on ImageRef to retain that setting for purgeable images
17154417e8ad488d18d9133bf802f598e7506483 24-Sep-2009 Mike Reed <reed@google.com> use new setDither on ImageRef to retain that setting for purgeable images
raphics/BitmapFactory.cpp
de0dfb7b65a02d4dd74c271b558adee0973fc267 23-Sep-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2125720 Weather Forecast Widget - graphics do not scale

I forgot to add the new density field to the Bitmaps' parcelable data.

Change-Id: I77cf3e93e356297e0caed6fc71b62b5cd8f79124
raphics/Bitmap.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
8cae124af2142687a6833dbaab8a43df6dd67b43 10-Sep-2009 Dianne Hackborn <hackbod@google.com> Various cleanup around resources and nine-patches.

Remove the stuff that doesn't use preloaded drawables when in
compatibility mode, since this works fine ever since we were able
to deal with drawables in a different density than the canvas.

Change the snapshot function on View to return a snapshot at
the same size that will actually be drawn on screen (when in
compatibility mode), to be able to show scaling artifacts and
all.

This change was original an attempt to fix issue #2101917: Text
field edges appears to be improperly rounded. That turns out to
probably be something deeper in the graphics system, but also
included here is the debugging code I did to try to track down the
problem to make it easy to turn on again later.

Change-Id: I34bfca629639c7ff103f3989d88874112ef778d9
raphics/NinePatch.cpp
raphics/NinePatchImpl.cpp
211db4a2874f1a2d0e7a8cb8d33e81fa08801763 11-Sep-2009 Mike Reed <reed@google.com> change default for dither to true
raphics/NinePatchImpl.cpp
106006cbdedc79ce8746ca5449610c69a2f69655 01-Sep-2009 Jack Palevich <jackpal@google.com> Change util_texSubImage2D to call glCompressedTexImage2D correctly.

Previously we had been setting the imageSize parameter to 0, which was
incorrect. According to the OpenGL ES spec for glCompressedTexImage2D
this parameter should be the size in bytes of the compressed data.
pengl/util.cpp
dbade9d6a075b1d5b8ebe10ee8961a5de296c93b 25-Aug-2009 Mike Reed <reed@google.com> expose runtime changes to gamma
raphics/Typeface.cpp
a31ce104f557212198cd7c95e05c7b67abcdbe8a 31-Jul-2009 Mike Reed <reed@google.com> am 6af2552d: use safeUnref() since the other macro is not defined in donut

Merge commit '6af2552d244ff933dfd54570121db455cc7c3cda'

* commit '6af2552d244ff933dfd54570121db455cc7c3cda':
use safeUnref() since the other macro is not defined in donut
93efb724ac60538bef3a4e9bae123b515a9deeeb 31-Jul-2009 Android (Google) Code Review <android-gerrit@google.com> am 7299d6ad: Merge change 9159 into donut

Merge commit '7299d6ad9820bbb601034542c94d6dc73cc4829d'

* commit '7299d6ad9820bbb601034542c94d6dc73cc4829d':
check for null native objects, which never happens on a real subclass (we throw in that case)
afcf686cb070313ae5ce6c54ac381a3a86a60ed2 31-Jul-2009 Android (Google) Code Review <android-gerrit@google.com> am 25dff70f: Merge change 9039 into donut

Merge commit '25dff70f153529b87f5ad4a92f4de21e8950b1de'

* commit '25dff70f153529b87f5ad4a92f4de21e8950b1de':
Fix #2018814: System cannot correctly render assets with "wrap_content" attribute in QVGA
6af2552d244ff933dfd54570121db455cc7c3cda 30-Jul-2009 Mike Reed <reed@google.com> use safeUnref() since the other macro is not defined in donut
raphics/MaskFilter.cpp
raphics/Shader.cpp
7299d6ad9820bbb601034542c94d6dc73cc4829d 30-Jul-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 9159 into donut

* changes:
check for null native objects, which never happens on a real subclass (we throw in that case) but can happen because we allow the callers to create the base class from java.
a04e555dc91b11ad833cb5db4a24e38082d1dc45 30-Jul-2009 Mike Reed <reed@google.com> check for null native objects, which never happens on a real subclass (we throw in that case)
but can happen because we allow the callers to create the base class from java.
raphics/MaskFilter.cpp
raphics/Shader.cpp
0d221012ff5fd314711c00ed30e9b807b9c454c1 30-Jul-2009 Dianne Hackborn <hackbod@google.com> Fix #2018814: System cannot correctly render assets with "wrap_content" attribute in QVGA

It turns out we were not returning the density for anything retrieved from a
TypedArray... which basically means any bitmap references from a layout or style...!!!

This is now fixed.

Also fiddle with the density compatibility mode to turn on smoothing in certain situations,
helping the look of things when they need to scale and we couldn't do the scaling at
load time.
raphics/Canvas.cpp
ead14576162b287ab10e473e3c2fb10604dcc052 27-Jul-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 8639

* changes:
explicitly set the hinting level for android apps (to match the old default)
3d63e0119dc763ed0a06fd7498375746fd391d80 27-Jul-2009 Mike Reed <reed@google.com> explicitly set the hinting level for android apps (to match the old default)
raphics/Paint.cpp
e2dba02441b42afbae725109ac779877a4b72aa0 25-Jul-2009 Dianne Hackborn <hackbod@google.com> am 11ea3347: Allow for screen density drawables in compatibility mode.

Merge commit '11ea33471e1a14a8594f0b2cd012d86340dd3bd8'

* commit '11ea33471e1a14a8594f0b2cd012d86340dd3bd8':
Allow for screen density drawables in compatibility mode.
11ea33471e1a14a8594f0b2cd012d86340dd3bd8 23-Jul-2009 Dianne Hackborn <hackbod@google.com> Allow for screen density drawables in compatibility mode.

This change allows us to use drawables that match the current screen
density even when being loaded in compatibility mode. In this case,
the bitmap is loaded in the screen density, and the bitmap and
nine-patch drawables take care of accounting for the density difference.

This should be safe for existing applications, for the most part, since
they shouldn't really be pulling the bitmap out of the drawable. For
the small rare chance of them breaking, it worth getting the correct
graphics. Also this will only happen when there is actually a resource
of the matching density, and no existing apps should have resources for
anything besides the default density (though of course all of the
framework resources will be available in the native density).

As part of this, the bitmap density API has been changed to a single
integer provider the DPI unit density.
raphics/Canvas.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/NinePatch.cpp
c634fdd8035cc06c34663b77ab199d29697273b4 18-Jul-2009 Android (Google) Code Review <android-gerrit@google.com> am 09a903ab: Merge change 7696 into donut

Merge commit '09a903ab5b8d940605783ae4ee591c0f090a31d1'

* commit '09a903ab5b8d940605783ae4ee591c0f090a31d1':
add hidden Options field for native allocations
1b22b979256cf163ab9bbfd4fcfa16a8ce862ed1 17-Jul-2009 Mike Reed <reed@google.com> add hidden Options field for native allocations
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
47c0d4eaa926d979c5ea366934750526c20af8ff 23-Jun-2009 Mike Reed <reed@google.com> remove deprecated use of porterduff
raphics/Canvas.cpp
raphics/ColorFilter.cpp
ce1311a3a0806d39dc675a3c702eebbfe741dec8 22-Jun-2009 Android (Google) Code Review <android-gerrit@google.com> am 766d7236: Merge change 4737 into donut

Merge commit '766d7236c84f636b816d71189e309e67db1f593a'

* commit '766d7236c84f636b816d71189e309e67db1f593a':
Add prepareToDraw() to Bitmap for fixing http://b/issue?id=1907995.
8cdcb12752b716d0407733fecefcf1d9e926310a 18-Jun-2009 Wei-Ta Chen <weita@google.com> Add prepareToDraw() to Bitmap for fixing http://b/issue?id=1907995.

The function is used to rebuild any caches associated with the bitmap.
In the case of purgeable bitmaps, this call ensures that the pixels
are decoded for drawing, and therefore prefetching techniques
implemented by callers can be leveraged.
raphics/Bitmap.cpp
885f75187c95b0ca7f189b5f600e2c731e95fca1 19-Jun-2009 Android (Google) Code Review <android-gerrit@google.com> am 066e6bfd: Merge change 4792 into donut

Merge commit '066e6bfd01a5ddd4748eacdc82fee5374e2af929'

* commit '066e6bfd01a5ddd4748eacdc82fee5374e2af929':
when we reset a paint, it should return to the state it was in when it was first created.
290f5baf9192752287723a29ede4399ae3e4c826 19-Jun-2009 Mike Reed <reed@google.com> when we reset a paint, it should return to the state it was in when it was first created.
for java, this means setting its text-encoding to UTF16...
raphics/Paint.cpp
7d53a6bf4d7992a31426b028fb6ba6dbfaee88d0 05-Jun-2009 Android (Google) Code Review <android-gerrit@google.com> am a4196206: Merge change 3074 into donut

Merge commit 'a41962065a93b63e7161cffd662b564e01a9e189'

* commit 'a41962065a93b63e7161cffd662b564e01a9e189':
Modify the decoding logic in the FD case when a purgeable flag is set,
2a2c5cd74128a7750f05683614c9824c9262addc 03-Jun-2009 Wei-Ta Chen <weita@google.com> Modify the decoding logic in the FD case when a purgeable flag is set,
and lower the threshold of bitmap size for using ashmem().

For the decoding logic, we now go through the "non-purgeable" path if isShareable is false,
irrespective of the value of the purgeable flag.
raphics/BitmapFactory.cpp
0795272aa226f4e965968a03daddc53ce30b7cda 20-May-2009 Mathias Agopian <mathias@google.com> move libbinder's header files under includes/binder
raphics/Bitmap.cpp
raphics/Region.cpp
7118a2cf547ed53900a7591ca93b99ee0508cea9 13-May-2009 Android (Google) Code Review <android-gerrit@google.com> am 807f23b: Merge change 1057 into donut

Merge commit '807f23b2d8c7148cf6fc95bb88cfc2f78e4be66a'

* commit '807f23b2d8c7148cf6fc95bb88cfc2f78e4be66a':
* Add regoin scaling for transparent support
15203958fda7d3bf551023b6bcdf9c706e2dba1e 13-May-2009 Romain Guy <romainguy@android.com> am 2bb3ea1: Fix native core runtime. A messy declaration was causing a p

Merge commit '2bb3ea162a58c0f1dddccdbe68b64e02456f11f9'

* commit '2bb3ea162a58c0f1dddccdbe68b64e02456f11f9':
Fix native core runtime. A messy declaration was causing a problem at boot time.
807f23b2d8c7148cf6fc95bb88cfc2f78e4be66a 13-May-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 1057 into donut

* changes:
* Add regoin scaling for transparent support
2bb3ea162a58c0f1dddccdbe68b64e02456f11f9 13-May-2009 Romain Guy <romainguy@android.com> Fix native core runtime. A messy declaration was causing a problem at boot time.
raphics/Typeface.cpp
b10f138e125b5656e810901d14c5f956ff5d9b64 12-May-2009 Mitsuru Oshima <oshima@google.com> * Add regoin scaling for transparent support
raphics/Region.cpp
bae1ca315b27973fee8daacec482bb633a464294 12-May-2009 Android (Google) Code Review <android-gerrit@google.com> am 3e3439d: Merge change 1478 into donut

Merge commit '3e3439d5ba0cf5eda060c4991219c32af917fc5b'

* commit '3e3439d5ba0cf5eda060c4991219c32af917fc5b':
Fixes #1847219. Add a new API to load fonts from arbitrary files: Typeface.createFromFile(String/File).
a87a132ebf1c2dd733cf52feff6e44525257c961 12-May-2009 Romain Guy <romainguy@android.com> Fixes #1847219. Add a new API to load fonts from arbitrary files: Typeface.createFromFile(String/File).
raphics/Typeface.cpp
3bc15fcfdc9239218f21e58b3688e4b1bceda0a2 01-May-2009 Android (Google) Code Review <android-gerrit@google.com> am e5c4725: Merge change 873 into donut

Merge commit 'e5c4725666da25138193bed83831b66b9c0b2c45'

* commit 'e5c4725666da25138193bed83831b66b9c0b2c45':
pass original ptrs to JNI release functions (instead of += index to them)
ad8b8f57a457ff615112b7fa4987f39e75fc5ff6 01-May-2009 Mike Reed <reed@google.com> pass original ptrs to JNI release functions (instead of += index to them)
raphics/Canvas.cpp
a5a51e172495a3aa793903ce6c62b06f8c5d0b42 29-Apr-2009 Android (Google) Code Review <android-gerrit@google.com> am 77c9990: Merge change 599 into donut

Merge commit '77c9990ae0806575ae7a2750459f3e74f0bec092'

* commit '77c9990ae0806575ae7a2750459f3e74f0bec092':
Add call to (new) Canvas.freeCaches() in response to low-memory
cb49634c7373e3b48bb73e516331901525af36c0 29-Apr-2009 Android (Google) Code Review <android-gerrit@google.com> am 1fb758e: Merge change 546 into donut

Merge commit '1fb758e94b5b9e342b6dc6452cb5bd7cf0cc4ed6'

* commit '1fb758e94b5b9e342b6dc6452cb5bd7cf0cc4ed6':
Add (hidden for now) purgeable bitmaps
caf0df1b7f99736aed1a0b923ef278fc4fd0fcca 27-Apr-2009 Mike Reed <reed@google.com> Add call to (new) Canvas.freeCaches() in response to low-memory

This is in conjunction with removing a similar call made by the browser.
Now it will be centralized, and the browser's call site will be removed.
raphics/Canvas.cpp
c70e06bbfac0d92ec218a32e35d9d7fa80f23cc9 24-Apr-2009 Mike Reed <reed@google.com> Add (hidden for now) purgeable bitmaps

BitmapFactory::Options now let you specify if the resulting bitmap can be
"purgeable". If so, then its decoded pixels may be purged when not actively
being drawn, freeing up that RAM. When such a bitmap is drawn, it will
automatically be re-decoded on demand. This is done by having the bitmap
keep a reference/copy of the encoded data.

Where it is a reference or a copy is controlled by the "shareable" flag in
Options. If this is true, the implementation *may* just reference the encode
data (e.g. a file descriptor) rathern than making a complete copy of it.

Currently, purgeable is not supported for generic inputstreams, but is
enabled for byte-array, file-descriptor, and assets, though for impl
reasons only file-descripts are currently enabled for "shareable", but that
may change in the future.
raphics/BitmapFactory.cpp
43ca00b0e82711f67246030e70bfb1f423e4a67f 02-Apr-2009 Ray Chen <> AI 144209: am: CL 144176 To fix the race condition in case "requestCancelDecode"
happens earlier than AutoDecoderCancel object is added
to the gAutoDecoderCancelMutex linked list.
Original author: raychen
Merged from: //branches/donutburger/...

Automated import of CL 144209
raphics/BitmapFactory.cpp
8ba88775fe9df1146de7683a6ef59e36e749b271 02-Apr-2009 Mike Reed <> AI 144018: change path to return its internal cached bounds, making it much lighter-weight to get the bounds.
BUG=1748928

Automated import of CL 144018
raphics/Path.cpp
0a6a0e9e95fffc3b53be92ba617e97fff66d1401 02-Apr-2009 Ray Chen <> AI 144176: To fix the race condition in case "requestCancelDecode"
happens earlier than AutoDecoderCancel object is added
to the gAutoDecoderCancelMutex linked list.
BUG=1692286

Automated import of CL 144176
raphics/BitmapFactory.cpp
708c17b4168404042852e480f25a91a02cf14247 25-Mar-2009 Jack Palevich <> Automated import from //branches/master/...@141860,141860
pengl/util.cpp
0577b26b7fc0a0dba4445c7965e05e98d4253211 25-Mar-2009 Jack Palevich <> Automated import from //branches/donutburger/...@141859,141859
pengl/util.cpp
4df2423a947bcd3f024cc3d3a1a315a8dc428598 05-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@136594
raphics/Typeface.cpp
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/Camera.cpp
raphics/Canvas.cpp
raphics/ColorFilter.cpp
raphics/CreateJavaOutputStreamAdaptor.cpp
raphics/CreateJavaOutputStreamAdaptor.h
raphics/DrawFilter.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/Interpolator.cpp
raphics/LayerRasterizer.cpp
raphics/MaskFilter.cpp
raphics/Matrix.cpp
raphics/Movie.cpp
raphics/NIOBuffer.cpp
raphics/NIOBuffer.h
raphics/NinePatch.cpp
raphics/NinePatchImpl.cpp
raphics/Paint.cpp
raphics/Path.cpp
raphics/PathEffect.cpp
raphics/PathMeasure.cpp
raphics/Picture.cpp
raphics/PorterDuff.cpp
raphics/Rasterizer.cpp
raphics/Region.cpp
raphics/Shader.cpp
raphics/Typeface.cpp
raphics/Xfermode.cpp
pengl/poly.h
pengl/poly_clip.cpp
pengl/util.cpp
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/Camera.cpp
raphics/Canvas.cpp
raphics/ColorFilter.cpp
raphics/CreateJavaOutputStreamAdaptor.cpp
raphics/CreateJavaOutputStreamAdaptor.h
raphics/DrawFilter.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/Interpolator.cpp
raphics/LayerRasterizer.cpp
raphics/MaskFilter.cpp
raphics/Matrix.cpp
raphics/Movie.cpp
raphics/NIOBuffer.cpp
raphics/NIOBuffer.h
raphics/NinePatch.cpp
raphics/NinePatchImpl.cpp
raphics/Paint.cpp
raphics/Path.cpp
raphics/PathEffect.cpp
raphics/PathMeasure.cpp
raphics/Picture.cpp
raphics/PorterDuff.cpp
raphics/Rasterizer.cpp
raphics/Region.cpp
raphics/Shader.cpp
raphics/Typeface.cpp
raphics/Xfermode.cpp
pengl/poly.h
pengl/poly_clip.cpp
pengl/util.cpp
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
raphics/BitmapFactory.cpp
raphics/Canvas.cpp
raphics/CreateJavaOutputStreamAdaptor.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/NinePatch.cpp
f1e484acb594a726fb57ad0ae4cfe902c7f35858 22-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@127436
raphics/Bitmap.cpp
b798689749c64baba81f02e10cf2157c747d6b46 10-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@125939
raphics/Bitmap.cpp
raphics/Canvas.cpp
raphics/Shader.cpp
pengl/util.cpp
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/CreateJavaOutputStreamAdaptor.cpp
raphics/Graphics.cpp
raphics/Movie.cpp
raphics/NinePatch.cpp
raphics/NinePatchImpl.cpp
raphics/Paint.cpp
raphics/Shader.cpp
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
raphics/Bitmap.cpp
raphics/BitmapFactory.cpp
raphics/Camera.cpp
raphics/Canvas.cpp
raphics/ColorFilter.cpp
raphics/CreateJavaOutputStreamAdaptor.cpp
raphics/CreateJavaOutputStreamAdaptor.h
raphics/DrawFilter.cpp
raphics/Graphics.cpp
raphics/GraphicsJNI.h
raphics/Interpolator.cpp
raphics/LayerRasterizer.cpp
raphics/MaskFilter.cpp
raphics/Matrix.cpp
raphics/Movie.cpp
raphics/NIOBuffer.cpp
raphics/NIOBuffer.h
raphics/NinePatch.cpp
raphics/NinePatchImpl.cpp
raphics/Paint.cpp
raphics/Path.cpp
raphics/PathEffect.cpp
raphics/PathMeasure.cpp
raphics/Picture.cpp
raphics/PorterDuff.cpp
raphics/Rasterizer.cpp
raphics/Region.cpp
raphics/Shader.cpp
raphics/Typeface.cpp
raphics/Xfermode.cpp
pengl/poly.h
pengl/poly_clip.cpp
pengl/util.cpp