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
This change also adds full support for local transformation matrices on
sweep and radial gradients.
Change-Id: Id8773bc0766575190e3f3d51984fc5e57b266c3f
In nativeCreateLargeBitmapFromFileDescriptor() if the file descriptor
can not be rewinded isShareable should be set to false.
Change-Id: I7dd545c9d52d21c226e11b8921e35a1d9bba9515
Merge commit '8fc6f8b2152564cab6ede025644f9bc3ee61ce16'
* commit '8fc6f8b2152564cab6ede025644f9bc3ee61ce16':
Revert "Rename LargeBitmap to BitmapRegionDecoder for having a better API."
Merge commit 'a295a3908befeb9dd30203c612d95411d68492ed'
* commit 'a295a3908befeb9dd30203c612d95411d68492ed':
Rename LargeBitmap to BitmapRegionDecoder for having a better API.
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
Move AssetStreamAdaptor, AutoFDSeek and nullObjectReturn to Utils.h because
BitmapFactory.cpp and BitmapRegionDecoder.cpp both need to use these utility functions.
Change-Id: I3e60c7fe4abd0289e1384e69a08fd20fe6fb0e10
Merge commit '9f7257f0a14cd17d8b55bc3bd1584dac2f9dd1b2'
* commit '9f7257f0a14cd17d8b55bc3bd1584dac2f9dd1b2':
Fix a bug, where one thread is using JNIEnv associated with another thread.
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
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
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
This change adds the following blending modes for shaders and color filters:
Add
Multiply
Screen
Overlay
Darken
Lighten
Change-Id: Iff22f5ce6041b43c71b1857d73013f5010ab3413
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
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
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
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
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
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
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
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