1448 Commits

Author SHA1 Message Date
John Reck
fc603ca6b5 am abf701e6: Merge "Eliminate mHasAlpha" into klp-dev
* commit 'abf701e6751aed487d4ed0986e0fae8810c3658f':
  Eliminate mHasAlpha
2014-03-21 19:41:00 +00:00
John Reck
91f0a455bb Eliminate mHasAlpha
Bug: 13580771

 The cached value mHasAlpha on Bitmap could get out of sync with the
 real value stored in the SkBitmap. Fix this by just eliminating the
 cached value. This adds an extra JNI call in copy(), createBitmap(),
 and setPremultiplied(), none of which are going to be significantly
 impacted by the extra JNI call.

Change-Id: I4fce069a77d9b3bbb47dde04275ff8510ce7e4f0
2014-03-21 18:16:18 +00:00
Jason Sams
780d57b81a am cf8573c1: Fix destruction issues relating to AllocationAdapter.
* commit 'cf8573c15456c4581b691c7380722ea6dccf11c5':
  Fix destruction issues relating to AllocationAdapter.
2014-03-11 01:12:32 +00:00
Jason Sams
e14d5e9011 am 5757bf89: Add hidden minor version ID for support lib workarounds.
* commit '5757bf89c44e7a4805340b5634bec13a1caf39f8':
  Add hidden minor version ID for support lib workarounds.
2014-03-11 01:12:29 +00:00
Jason Sams
0165db3802 am ff7256e7: Fix destruction issues relating to AllocationAdapter.
* commit 'ff7256e757502279b1777127a12eba235be679ae':
  Fix destruction issues relating to AllocationAdapter.
2014-03-11 01:12:23 +00:00
Jason Sams
cf8573c154 Fix destruction issues relating to AllocationAdapter.
bug 13170046

Change-Id: I2a2ba3cbd7d08c659ed8958fbcc01919e36e86b0
2014-03-10 13:32:42 -07:00
Jason Sams
5757bf89c4 Add hidden minor version ID for support lib workarounds.
bug 13170046

Change-Id: I0c77901752e9a0b10bd5be62311c79a0ab7128e5
2014-03-10 13:32:21 -07:00
Jason Sams
ff7256e757 Fix destruction issues relating to AllocationAdapter.
bug 13170046

Change-Id: I922b19c086b675949c6fae66c6dcb4c8af3b715f
2014-03-10 13:31:51 -07:00
Leon Scroggins III
87e9e744ed am 92a32832: DO NOT MERGE - Fix Javadoc build break.
* commit '92a3283286df3a6c2a27ecde8eddf23abbb87de9':
  DO NOT MERGE - Fix Javadoc build break.
2014-03-06 21:31:31 +00:00
Leon Scroggins III
92a3283286 DO NOT MERGE - Fix Javadoc build break.
Remove links to non-specific function name.

Bug: 13246311

Change-Id: I5643074149d0a511bd760d638751c44e3ec4c557
(cherry picked from commit 2bc49ca96eb786f66dc2b9573e1f09bdb2d82d5e)
2014-03-06 20:44:16 +00:00
Leon Scroggins III
8d3281f5f7 am ee008d42: Merge "Update framework to use M33 Skia. DO NOT MERGE" into klp-dev
* commit 'ee008d4264a95bba5f90b17856fc06fa29a6f12c':
  Update framework to use M33 Skia. DO NOT MERGE
2014-03-06 19:49:58 +00:00
Leon Scroggins III
5e49b497ae 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
2014-03-06 12:14:47 -05:00
Katie McCormick
484b57a565 am 9d0a88bd: Merge "Doc updates: Javadoc fixes" into klp-docs
* commit '9d0a88bd4e07deac01d7759b70cdf160456be1c0':
  Doc updates: Javadoc fixes
2013-11-26 21:58:18 +00:00
Katie McCormick
f2ef28d840 Doc updates: Javadoc fixes
Change-Id: I82381056f9f13e53ab8a0525f5a53bf98674c052
2013-11-26 13:52:48 -08:00
Svetoslav
134631b907 am 90242fe5: Merge "Switch to the new Skia PDF generation APIs." into klp-dev
* commit '90242fe5581c8f665c09337a0971a7c3fc908f7c':
  Switch to the new Skia PDF generation APIs.
2013-11-07 16:22:22 -08:00
Svetoslav
90242fe558 Merge "Switch to the new Skia PDF generation APIs." into klp-dev 2013-11-08 00:20:10 +00:00
Svetoslav
35aacf2eb3 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
2013-11-07 14:15:19 -08:00
Fabrice Di Meglio
e34c477060 am 435c0ee1: Merge "Fix bug #11537133 Hideycling looks broken (KOT36), missing left padding" into klp-dev
* commit '435c0ee10af132937dc0a22c39380624e6efd5ab':
  Fix bug #11537133 Hideycling looks broken (KOT36), missing left padding
2013-11-07 11:21:03 -08:00
Fabrice Di Meglio
435c0ee10a Merge "Fix bug #11537133 Hideycling looks broken (KOT36), missing left padding" into klp-dev 2013-11-07 19:18:00 +00:00
Newton Allen
badb59cd5d am 47feee53: Merge "Fix some documentation typos." into klp-docs
* commit '47feee535f9e4e77165b93b6b9f10379e7aa4bbd':
  Fix some documentation typos.
2013-11-07 05:19:12 +00:00
Fabrice Di Meglio
f7a93ef384 Fix bug #11537133 Hideycling looks broken (KOT36), missing left padding
- enforce the Drawable boolean getPadding(Rect) contract for NinePatchDrawable
and DrawableContainer.

- as NinePatchDrawable was not enforcing it, the consequence was that the
mUserPaddingLeftInitial / mUserPaddingRitghInitial were reset to "0" (even
if they got the correct value before the reset).

Change-Id: I1efe7fad5f89c0ca47f90189f6d89940e0e9c6ae
2013-11-06 15:32:01 -08:00
Chris Craik
47742d4bb0 Merge "Fix NPE with inPurgeable Bitmaps in getAllocationByteCount" into klp-dev 2013-11-06 23:23:56 +00:00
Chris Craik
222f2ad294 Fix NPE with inPurgeable Bitmaps in getAllocationByteCount
bug:11556330
Change-Id: I430136ea15baeb60adfb9bb2acdde9505ce707fe
2013-11-06 14:01:28 -08:00
John Spurlock
9d383ece52 Merge "Fix recent regression in DrawableContainer." into klp-dev 2013-11-06 02:29:20 +00:00
Adam Koch
57c9886d4b Doc fix: add more detail to BitmapFactory.Options.inPurgeable flag.
Bug: 6064760

Change-Id: I3fd833a3205be451ff6548fab3555d170c9c570e
(cherry picked from commit e1693df494dbdedfb5eac56bf59f86afc893b778)
2013-11-06 01:18:05 +00:00
Adam Koch
be0b05a028 Merge "Doc fix: add more detail to BitmapFactory.Options.inPurgeable flag. Bug: 6064760" into klp-dev 2013-11-06 01:13:44 +00:00
John Spurlock
f68bb66c6e Fix recent regression in DrawableContainer.
Ensure optical insets are never null.

Bug:11537082
Change-Id: Ib75be83909fac612ae947f501835285cd8a79862
2013-11-05 19:15:41 -05:00
Adam Koch
e1693df494 Doc fix: add more detail to BitmapFactory.Options.inPurgeable flag.
Bug: 6064760

Change-Id: I3fd833a3205be451ff6548fab3555d170c9c570e
2013-11-05 16:00:09 -05:00
Fabrice Di Meglio
f48bcd5b68 Merge "Fix bug #11256076 Spinner text is too close from the opening triangle in RTL Locales" into klp-dev 2013-11-05 00:46:19 +00:00
Newton Allen
ff236f5fc1 Fix some documentation typos.
Change-Id: I0360d468d54d970c87f313e24e50965245206f28
(cherry picked from commit c502744f2ddcc80a34f5197b5d2c0d701c7d6e71)
2013-11-01 02:38:01 +00:00
Svetoslav Ganov
78da147d42 Update the PdfDocument docs with unsupported operations.
The PDF generating canvas we use does not yet support all
drawing operations. This change adds docs which operations
are not yet supported.

Change-Id: I8d5ee8c1e2a473ba783b5e62f23ab90a54bbf106
(cherry picked from commit 8db45b844b5482cf61839404c0f6847e053de817)
2013-10-31 23:05:55 +00:00
Svetoslav Ganov
8db45b844b Update the PdfDocument docs with unsupported operations.
The PDF generating canvas we use does not yet support all
drawing operations. This change adds docs which operations
are not yet supported.

Change-Id: I8d5ee8c1e2a473ba783b5e62f23ab90a54bbf106
2013-10-31 08:10:12 -07:00
Fabrice Di Meglio
600d7dd1c6 Fix bug #11256076 Spinner text is too close from the opening triangle in RTL Locales
Background Drawable padding was not taken into account in RTL Locales

- make sure the Drawables are resolved before resolving padding
- during padding resolution take care about background padding

Change-Id: Ib0c722adf5341ab4fa2182a0d0ac2ca639e85cfc
2013-10-18 11:26:48 -07:00
Eino-Ville Talvala
cd92588528 DO NOT MERGE: Hide new camera API.
Not yet ready.

Bug: 11141002

Change-Id: I4704bffb9ba36af47a66dc5b49cbba00be623aae
2013-10-11 19:26:08 +00:00
Adam Powell
31049d76c5 Use SCREEN Xfermode for keyguard badges; update SeekBar
Plumb through the necessary API features through Drawables and
ImageView but leave it hidden for now pending future API review and
plumbing through the rest of the framework Drawable implementations.

Update SeekBar assets used for keyguard transport control.

Set selected status directly instead of finding views by id.

Bug 10531608
Bug 10784913

Change-Id: Ia38bd04ad1bc26e9e6da1dda8a374c9ba3ceccb3
2013-10-07 16:14:17 -07:00
Mike Klein
d0f379c197 Preserve fill type in Path.reset().
Bug: 10838355
Change-Id: I7bdecb945fc35dfed02d37745678ae7bda906628
2013-10-07 21:04:47 +00:00
Jeff Sharkey
ee3e1603fd Fix animations, padding in RTL mode.
Show directory animations coming in from left-side when in RTL
language.  Also fix NinePatchDrawable to correctly mirror its padding
when auto-mirrored, and fix InsetDrawable to propagate the layout
direction to the wrapped Drawable.

Bug: 10987190, 11030793
Change-Id: I1213802a07d0c4ced93438df1e6ddf5aed3df677
2013-10-01 16:03:00 -07:00
Victoria Lease
a4eb894a55 Merge "clarify Paint flag docs" into klp-dev 2013-09-26 21:40:55 +00:00
Victoria Lease
8dc7d5ea26 clarify Paint flag docs
Bug: 10460797
Change-Id: Iae622b302cad3dc788f512b472e3a59ec227a8d7
2013-09-26 13:40:47 -07:00
Leon Scroggins III
321bc46b3c Update docs to state that mark is no longer called.
BUG:6493544

Change-Id: I97a4d90ce2efcd12f8f1cc5b545f822f8e5a5ab0
2013-09-25 18:02:32 -04:00
Svetoslav
6811f4e92c 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
2013-09-19 17:12:47 -07:00
Leon Scroggins III
7315f1baee 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
2013-09-18 12:01:20 -04:00
Igor Murashkin
2cad64c0fb Merge "Surface: Change OutOfResourcesException to be a runtime exception" into klp-dev 2013-09-11 18:28:07 +00:00
John Reck
1d2daa7809 Merge "Remove FD optimization case for decodeStream" into klp-dev 2013-09-10 16:25:14 +00:00
Stephen Hines
e3d0f02282 Merge "Don't set Allocation mSize when we have no Type." into klp-dev 2013-09-10 05:23:15 +00:00
Igor Murashkin
a86ab640f7 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
2013-09-09 21:53:59 -07:00
Stephen Hines
88990da58d Don't set Allocation mSize when we have no Type.
Bug: 10667740

A3D creates Allocations before knowing the underlying Type (and thus size).
Moving the mSize calculation to be conditional for concrete Allocations
eliminates the bug. In the future, we could let A3D dynamically update the
Allocation size if it is necessary to improve heap behavior.

Change-Id: I520246806b6ead0387a1a41372dade1a6e7c2271
2013-09-09 17:56:07 -07:00
John Reck
5835157d76 Remove FD optimization case for decodeStream
Bug: 10677727
 The problem is that the FileInputStream may be wrapping a pipe or
 AssetFileDescriptor which fails if handed to decodeFileDescriptor.
 The problem is that AFDs can start in the middle of a file, whereas
 decodeFileDescriptor assumes it can mmap() the FD and start at
 the beginning.

Change-Id: I98a3c5f789865145e25a99b32d205e290808c1cf
2013-09-09 23:41:20 +00:00
Tim Murray
23ae1461d2 Merge "Add flags word to initialization." into klp-dev 2013-09-09 23:34:38 +00:00
Tim Murray
9578e64240 Add flags word to initialization.
bug 10427951

Change-Id: I1356b9b96315ead44aa3898de5604d75f9bb8be5
2013-09-09 16:23:27 -07:00