summaryrefslogtreecommitdiffstats
path: root/graphics
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Switch to the new Skia PDF generation APIs." into klp-devSvetoslav2013-11-081-20/+27
|\
| * Switch to the new Skia PDF generation APIs.Svetoslav2013-11-071-20/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Fix bug #11537133 Hideycling looks broken (KOT36), missing left ↵Fabrice Di Meglio2013-11-072-2/+3
|\ \ | |/ |/| | | padding" into klp-dev
| * Fix bug #11537133 Hideycling looks broken (KOT36), missing left paddingFabrice Di Meglio2013-11-062-2/+3
| | | | | | | | | | | | | | | | | | | | | | - 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
* | Merge "Fix NPE with inPurgeable Bitmaps in getAllocationByteCount" into klp-devChris Craik2013-11-061-0/+5
|\ \
| * | Fix NPE with inPurgeable Bitmaps in getAllocationByteCountChris Craik2013-11-061-0/+5
| | | | | | | | | | | | | | | bug:11556330 Change-Id: I430136ea15baeb60adfb9bb2acdde9505ce707fe
* | | Merge "Fix recent regression in DrawableContainer." into klp-devJohn Spurlock2013-11-061-1/+1
|\ \ \ | |_|/ |/| |
| * | Fix recent regression in DrawableContainer.John Spurlock2013-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | Ensure optical insets are never null. Bug:11537082 Change-Id: Ib75be83909fac612ae947f501835285cd8a79862
* | | Merge "Doc fix: add more detail to BitmapFactory.Options.inPurgeable flag. ↵Adam Koch2013-11-061-2/+14
|\ \ \ | |/ / |/| | | | | Bug: 6064760" into klp-dev
| * | Doc fix: add more detail to BitmapFactory.Options.inPurgeable flag.Adam Koch2013-11-051-2/+14
| | | | | | | | | | | | | | | | | | Bug: 6064760 Change-Id: I3fd833a3205be451ff6548fab3555d170c9c570e
* | | Merge "Fix bug #11256076 Spinner text is too close from the opening triangle ↵Fabrice Di Meglio2013-11-051-6/+25
|\ \ \ | |/ / |/| | | | | in RTL Locales" into klp-dev
| * | Fix bug #11256076 Spinner text is too close from the opening triangle in RTL ↵Fabrice Di Meglio2013-10-181-6/+25
| |/ | | | | | | | | | | | | | | | | | | | | 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
* | Update the PdfDocument docs with unsupported operations.Svetoslav Ganov2013-10-311-0/+25
|/ | | | | | | | 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
* DO NOT MERGE: Hide new camera API.Eino-Ville Talvala2013-10-111-4/+2
| | | | | | | | Not yet ready. Bug: 11141002 Change-Id: I4704bffb9ba36af47a66dc5b49cbba00be623aae
* Use SCREEN Xfermode for keyguard badges; update SeekBarAdam Powell2013-10-072-0/+19
| | | | | | | | | | | | | | | 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
* Preserve fill type in Path.reset().Mike Klein2013-10-072-0/+41
| | | | | Bug: 10838355 Change-Id: I7bdecb945fc35dfed02d37745678ae7bda906628
* Fix animations, padding in RTL mode.Jeff Sharkey2013-10-012-7/+25
| | | | | | | | | | 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
* Merge "clarify Paint flag docs" into klp-devVictoria Lease2013-09-261-12/+102
|\
| * clarify Paint flag docsVictoria Lease2013-09-261-12/+102
| | | | | | | | | | Bug: 10460797 Change-Id: Iae622b302cad3dc788f512b472e3a59ec227a8d7
* | Update docs to state that mark is no longer called.Leon Scroggins III2013-09-252-0/+10
|/ | | | | | BUG:6493544 Change-Id: I97a4d90ce2efcd12f8f1cc5b545f822f8e5a5ab0
* Move PdfDocument to android.graphics.pdfSvetoslav2013-09-192-0/+429
| | | | | | | | | | | | | | | 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
* Use a native buffer for decoding images.Leon Scroggins III2013-09-182-12/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge "Surface: Change OutOfResourcesException to be a runtime exception" ↵Igor Murashkin2013-09-111-5/+16
|\ | | | | | | into klp-dev
| * Surface: Change OutOfResourcesException to be a runtime exceptionIgor Murashkin2013-09-091-5/+16
| | | | | | | | | | | | | | | | | | - 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
* | Merge "Remove FD optimization case for decodeStream" into klp-devJohn Reck2013-09-101-15/+1
|\ \
| * | Remove FD optimization case for decodeStreamJohn Reck2013-09-091-15/+1
| |/ | | | | | | | | | | | | | | | | | | 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
* | Merge "Don't set Allocation mSize when we have no Type." into klp-devStephen Hines2013-09-101-1/+4
|\ \ | |/ |/|
| * Don't set Allocation mSize when we have no Type.Stephen Hines2013-09-091-1/+4
| | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Add flags word to initialization." into klp-devTim Murray2013-09-091-1/+1
|\ \
| * | Add flags word to initialization.Tim Murray2013-09-091-1/+1
| | | | | | | | | | | | | | | | | | bug 10427951 Change-Id: I1356b9b96315ead44aa3898de5604d75f9bb8be5
* | | Merge "Fix pixel test" into klp-devAndy McFadden2013-09-091-9/+10
|\ \ \ | |/ / |/| |
| * | Fix pixel testAndy McFadden2013-09-091-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | A deprecated format was dropped entirely. Bug 10666734 Change-Id: I6b64bd27db8965a1696d72387232b7de4bce6574
* | | Update doc for BitmapFactory.Options to include BitmapRegionDecoderChris Craik2013-09-061-12/+29
|/ / | | | | | | | | bug:9987022 Change-Id: I1a4e187e1c35a7758b70f69a0a25914597920e8f
* | Change build version from KEY_LIME_PIE to KITKATChet Haase2013-09-052-5/+5
| | | | | | | | | | | | Issue #10631619 Change build version to KitKat Change-Id: I6ad13f6169ad74204078d36929479998b498ad8b
* | Merge "Add YUV element convenience function." into klp-devTim Murray2013-09-053-3/+12
|\ \ | |/ |/|
| * Add YUV element convenience function.Tim Murray2013-09-043-3/+12
| | | | | | | | Change-Id: Ie67dfba6a4c4f1913875ad9817c53e45d56809ae
* | Merge "Prevent NPE when cloning gradients Bug #10436856" into klp-devRomain Guy2013-09-033-5/+6
|\ \
| * | Prevent NPE when cloning gradientsRomain Guy2013-09-033-5/+6
| | | | | | | | | | | | | | | | | | Bug #10436856 Change-Id: I98cbce941a06842112b8caa3753a3fa32b227da9
* | | Merge "Update Bitmap.Config.ARGB_4444 documentation Bug #10510122" into klp-devRomain Guy2013-09-032-1/+5
|\ \ \ | |/ / | | / | |/ |/|
| * Update Bitmap.Config.ARGB_4444 documentationRomain Guy2013-09-032-1/+5
| | | | | | | | | | | | | | | | Bug #10510122 ARGB_4444 is deprecated and always replaced with ARGB_8888. Change-Id: I0da96216af701a7df00ad35913066fbfa997d790
* | Cleanup API typoJason Sams2013-08-292-2/+6
| | | | | | | | | | | | bug 10548782 Change-Id: I3654b7d1f8ea10eb51006804248cc2a7d20eabb0
* | Merge "Unhide USAGE_IO_INPUT functions" into klp-devJason Sams2013-08-291-9/+5
|\ \
| * | Unhide USAGE_IO_INPUT functionsJason Sams2013-08-291-9/+5
| |/ | | | | | | Change-Id: I9c1a7e5d65adee133b99b9a94729ab0b3d5a097f
* | Merge "Replace stream wrap-function w/ more specific ones" into klp-devLeon Scroggins III2013-08-292-37/+44
|\ \
| * | Replace stream wrap-function w/ more specific onesLeon Scroggins III2013-08-272-37/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Set alpha channel correctly when recomputing gradientAlan Viverette2013-08-281-9/+10
|/ / | | | | | | | | | | | | | | | | | | 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
* | Merge "Add garbage collection hooks" into klp-devTim Murray2013-08-232-0/+27
|\ \ | |/ |/|
| * Add garbage collection hooksTim Murray2013-08-232-0/+27
| | | | | | | | | | | | bug 10428172 Change-Id: I6365aa58bbc99aa134e1f261a5819e07a7d70fb0
* | Add inPremutiplied option to BitmapFactory.Options, functionality in BitmapChris Craik2013-08-203-42/+105
| | | | | | | | | | | | bug:2248948 Change-Id: I8fdd649332667598504a1076d5a447572bd53086
* | Merge "Renderscript: Allow YUV_420_888 as a YUV type." into klp-devEino-Ville Talvala2013-08-211-6/+10
|\ \ | |/ |/|