1434 Commits

Author SHA1 Message Date
Tor Norbye
b6a3ef1834 Merge "Add typedefs and nullness annotations." 2013-09-12 22:22:06 +00:00
Igor Murashkin
33069f40e5 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
2013-09-11 17:22:40 -07:00
Tor Norbye
d9273d6f28 Add typedefs and nullness annotations.
This changeset adds in typedef annotations (custom annotations
marked with @IntDef) for various int parameters and return values
in the API. It also adds nullness annotations for cases where the
documentation explicitly mentioned null policy, or where it was
blindingly obvious from the context. Also fixed some typos in the
documentation.

Change-Id: Ica27c01368895818e26237544edd8483007155bb
2013-09-11 14:55:38 -07: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
4669a5d278 am 8eb3ece8: am 1d2daa78: Merge "Remove FD optimization case for decodeStream" into klp-dev
* commit '8eb3ece8eeaea4dc06c5b3854d8fd9efea4ef5fc':
  Remove FD optimization case for decodeStream
2013-09-10 09:31:04 -07:00
John Reck
1d2daa7809 Merge "Remove FD optimization case for decodeStream" into klp-dev 2013-09-10 16:25:14 +00:00
Stephen Hines
319cc55c02 am 9b448989: am e3d0f022: Merge "Don\'t set Allocation mSize when we have no Type." into klp-dev
* commit '9b4489897974db2a7a6d9e19b4de2817bbb4755a':
  Don't set Allocation mSize when we have no Type.
2013-09-09 22:26:58 -07: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
Tim Murray
86ebf2876d am 9163b1d9: am 23ae1461: Merge "Add flags word to initialization." into klp-dev
* commit '9163b1d9ceeca3e956218dda1ca19a748dc48d8d':
  Add flags word to initialization.
2013-09-09 16:58:12 -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
Andy McFadden
5b4b94ca59 am 324738e7: am 440f4dfa: Merge "Fix pixel test" into klp-dev
* commit '324738e700c7cce33eec2e0d7f6f2e86a91def7a':
  Fix pixel test
2013-09-09 16:02:37 -07:00
Andy McFadden
440f4dfac8 Merge "Fix pixel test" into klp-dev 2013-09-09 22:55:35 +00:00
Chris Craik
ebc6c4bb17 am 177718a7: am f25fceef: Merge "Update doc for BitmapFactory.Options to include BitmapRegionDecoder" into klp-dev
* commit '177718a7d2fa22ee8b982b1c19d4db50beb5790b':
  Update doc for BitmapFactory.Options to include BitmapRegionDecoder
2013-09-09 14:14:46 -07:00
Andy McFadden
5d2cace4c5 Fix pixel test
A deprecated format was dropped entirely.

Bug 10666734

Change-Id: I6b64bd27db8965a1696d72387232b7de4bce6574
2013-09-09 10:19:44 -07:00
Chris Craik
352919efd0 Update doc for BitmapFactory.Options to include BitmapRegionDecoder
bug:9987022
Change-Id: I1a4e187e1c35a7758b70f69a0a25914597920e8f
2013-09-06 18:52:22 -07:00
Chet Haase
672fcd5c9a am 04f31501: am a9fa33b3: Merge "Change build version from KEY_LIME_PIE to KITKAT" into klp-dev
* commit '04f31501602a87ae9526983f4a92e623b4d68bb3':
  Change build version from KEY_LIME_PIE to KITKAT
2013-09-05 10:13:34 -07:00
Chet Haase
e8222dddaf Change build version from KEY_LIME_PIE to KITKAT
Issue #10631619 Change build version to KitKat

Change-Id: I6ad13f6169ad74204078d36929479998b498ad8b
2013-09-05 08:44:33 -07:00
Tim Murray
d2c576dba1 am 4965dbc3: am d2676f9b: Merge "Add YUV element convenience function." into klp-dev
* commit '4965dbc3149b1b1b4ff16b8da60cd31aed1c6e15':
  Add YUV element convenience function.
2013-09-05 00:41:18 -07:00
Tim Murray
d2676f9bd9 Merge "Add YUV element convenience function." into klp-dev 2013-09-05 07:36:43 +00:00
Tim Murray
932e78e990 Add YUV element convenience function.
Change-Id: Ie67dfba6a4c4f1913875ad9817c53e45d56809ae
2013-09-04 16:15:45 -07:00
Romain Guy
b6c4324fba am 9a160a52: am e182bfd4: Merge "Prevent NPE when cloning gradients Bug #10436856" into klp-dev
* commit '9a160a52b9edfc32e2fe444b3925534ae21ed5bc':
  Prevent NPE when cloning gradients Bug #10436856
2013-09-03 16:38:55 -07:00
Romain Guy
e182bfd4dc Merge "Prevent NPE when cloning gradients Bug #10436856" into klp-dev 2013-09-03 23:32:33 +00:00
Romain Guy
9622adf6e8 Prevent NPE when cloning gradients
Bug #10436856

Change-Id: I98cbce941a06842112b8caa3753a3fa32b227da9
2013-09-03 16:08:00 -07:00
Romain Guy
083cdca013 am 3d179241: am 3e8105e2: Merge "Update Bitmap.Config.ARGB_4444 documentation Bug #10510122" into klp-dev
* commit '3d179241bfbdeb4e293d2b773cfe6a586158d4b0':
  Update Bitmap.Config.ARGB_4444 documentation Bug #10510122
2013-09-03 14:49:41 -07:00
Romain Guy
3e8105e212 Merge "Update Bitmap.Config.ARGB_4444 documentation Bug #10510122" into klp-dev 2013-09-03 21:41:39 +00:00
Romain Guy
25ba1c8694 Update Bitmap.Config.ARGB_4444 documentation
Bug #10510122

ARGB_4444 is deprecated and always replaced with ARGB_8888.

Change-Id: I0da96216af701a7df00ad35913066fbfa997d790
2013-09-03 11:50:23 -07:00
Jason Sams
c850221500 am a2c13b3a: am c2b582c0: Merge "Cleanup API typo" into klp-dev
* commit 'a2c13b3a08b4b5a8f340cdedfd56557699dcb177':
  Cleanup API typo
2013-08-29 17:08:11 -07:00
Jason Sams
a49e89d228 Cleanup API typo
bug 10548782

Change-Id: I3654b7d1f8ea10eb51006804248cc2a7d20eabb0
2013-08-29 17:00:37 -07:00
Jason Sams
7407850c8a am 1a81725e: am 6b115980: Merge "Unhide USAGE_IO_INPUT functions" into klp-dev
* commit '1a81725ececffe68af466d1f8dcea56b86a84247':
  Unhide USAGE_IO_INPUT functions
2013-08-29 14:28:33 -07:00
Jason Sams
6b11598048 Merge "Unhide USAGE_IO_INPUT functions" into klp-dev 2013-08-29 21:24:28 +00:00
Jason Sams
42ef238208 Unhide USAGE_IO_INPUT functions
Change-Id: I9c1a7e5d65adee133b99b9a94729ab0b3d5a097f
2013-08-29 13:30:59 -07:00
Leon Scroggins III
f7142e3e8b 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
2013-08-29 10:24:21 -07:00
Leon Scroggins III
4b2993123b Merge "Replace stream wrap-function w/ more specific ones" into klp-dev 2013-08-29 17:12:01 +00:00
Alan Viverette
dd5745b7c7 am c6de5c74: am 236ae4f2: Merge "Set alpha channel correctly when recomputing gradient" into klp-dev
* commit 'c6de5c74e1e5dd92c011a1f060e26e10b15ffb77':
  Set alpha channel correctly when recomputing gradient
2013-08-28 14:06:38 -07:00
Alan Viverette
4d971c1fa0 Set alpha channel correctly when recomputing gradient
The alpha channel is applied by modulateAlpha(). Setting it to
mAlpha in ensureValidRect() locked the maximum alpha channel to
whatever value was set before layout. Setting it to BLACK
ensures it can be modulated later.

BUG: 10514848
Change-Id: If7a824410a66f1e9b648e20ee627bdf99a42ae78
2013-08-28 10:24:12 -07:00
Leon Scroggins III
ca32021b43 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
2013-08-27 15:28:58 -04:00
Tim Murray
61cc40bedc am 493a4c85: am c264e044: Merge "Add garbage collection hooks" into klp-dev
* commit '493a4c85cd6476a9b932a3146421eab0f662113a':
  Add garbage collection hooks
2013-08-26 15:11:11 -07:00
Tim Murray
c264e04400 Merge "Add garbage collection hooks" into klp-dev 2013-08-23 23:40:48 +00:00
Tim Murray
2f2472c42b Add garbage collection hooks
bug 10428172

Change-Id: I6365aa58bbc99aa134e1f261a5819e07a7d70fb0
2013-08-23 13:35:19 -07:00
Chris Craik
ed2515e853 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
2013-08-21 10:26:23 -07:00
Chris Craik
1abf5d6242 Add inPremutiplied option to BitmapFactory.Options, functionality in Bitmap
bug:2248948

Change-Id: I8fdd649332667598504a1076d5a447572bd53086
2013-08-20 18:29:33 -07:00
Eino-Ville Talvala
4e802a78e6 am 948e200e: am 9fac8a6a: Merge "Renderscript: Allow YUV_420_888 as a YUV type." into klp-dev
* commit '948e200e2d281c4547faac2f2a429c4aa73a010b':
  Renderscript: Allow YUV_420_888 as a YUV type.
2013-08-20 17:40:07 -07:00
Eino-Ville Talvala
9fac8a6a4a Merge "Renderscript: Allow YUV_420_888 as a YUV type." into klp-dev 2013-08-21 00:36:45 +00:00
Romain Guy
13656743cc Make color filters mutable
Change-Id: I3d035d24a75e09db13d136a22bd7dbd326d0ce36
2013-08-19 18:18:00 -07:00
Mike Klein
e78044a9e3 am bc37c299: am be925721: Remove comment that\'s only relevant for the underlying SkMatrix. Matrix has constructors.
* commit 'bc37c2991779b7c9372e5cbc3bd177273aae5644':
  Remove comment that's only relevant for the underlying SkMatrix.  Matrix has constructors.
2013-08-14 10:42:58 -07:00
Eino-Ville Talvala
ccadaf1eb4 Renderscript: Allow YUV_420_888 as a YUV type.
Change-Id: I1ed731103a49a814f9a049ecd01be98261b6d06b
2013-08-14 10:40:30 -07:00