History log of /frameworks/base/core/jni/android/graphics/Graphics.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
55455181233cadcd6d2e28d28d0dfc9a653f7787 16-Apr-2017 Romain Guy <romainguy@google.com> Properly decode colors spaces in BitmapRegionDecoder

Reusing a bitmap with BitmapRegionDecoder would preserve the
previous color space. This change also tweaks color space
matching to make sure we pick Display P3 with parameter d=0.039
or d=0.04045

Bug: 36905374
Test: CtsGraphicsTestCases
Change-Id: I4d2d66e5babebb0b5ce5cbdc7e8244177b4b7f9c
/frameworks/base/core/jni/android/graphics/Graphics.cpp
95648b8a590995e57948ff2fd57d234bdbf30be0 14-Apr-2017 Romain Guy <romainguy@google.com> Add BitmapFactory.Options.inColorSpace

This allows applications to load bitmap in a preferred
target color space, similar to inPreferredConfig for
configurations.

This change also applies recent changes made to BitmapFactory
to BitmapRegionDecoder: support for outColorSpace, inColorSpace
and outConfig.

Bug: 32984164, 36905374
Test: CtsGraphicsTestCase (BitmapColorSpaceTest/BitmapRegionDecoderTest)
Change-Id: I4eded9190d1aa9c7f3033f9bb78a6854cc48a3ef
/frameworks/base/core/jni/android/graphics/Graphics.cpp
2ecdfc2a331ee38d4494377330721d93e9f77ced 08-Mar-2017 Matt Sarett <msarett@google.com> Use SkColorSpace::isSRGB() in place of pointer comparison

Test: Refactor

Change-Id: I26301339fb964c6feca8c92f058524f8b83156ff
/frameworks/base/core/jni/android/graphics/Graphics.cpp
ce217faddb4b40c1b3e698944da1951027080427 09-Mar-2017 Romain Guy <romainguy@google.com> Make Bitmap.get/setPixel[s] color space aware

Bug: 32984164
Test: cts-tradefed run singleCommand cts-dev --module CtsGraphicsTestCases --test android.graphics.cts.BitmapColorSpaceTest
Change-Id: Iee8c4abb264f0d2a44bae59788fbf4dcb2d0fdf7
/frameworks/base/core/jni/android/graphics/Graphics.cpp
3b75a823066d2606af5e90583285f024594f509f 10-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Report bitmap config when decoding only metadata"
e8d2ebb5c29efb996179f9a4b62c78e4d3037e14 10-Feb-2017 Romain Guy <romainguy@google.com> Report bitmap config when decoding only metadata

With the introduction of support for 16 bit images, bitmaps returned
by BitmapFactory may be using the RGBA_F16 configuration. Some apps
and libraries assume the returned configuration is always ARGB_8888
and make assumptions based on that to compute cache sizes, etc.

This changes extract the output config when BitmapFactory is invoked
with the inJustDecodeBounds option. Despite its name, this option
is already used (and documented!) to decode more than bounds as it
also decodes the MIME type.

Bug: 35108998
Test: CtsGraphicsTestCases
Change-Id: If71959751458816678e42b21ab26c889aba5dea0
/frameworks/base/core/jni/android/graphics/Graphics.cpp
89ddb1f1644e0b47de060d2c9aaf6d5387c38f2f 10-Feb-2017 Matt Sarett <msarett@google.com> Update framework to use new SkColorSpace API

Test: This compiles with SK_USE_LEGACY_NAMED_COLOR_SPACE
turned off.

Change-Id: Ie573f59e0aa475bab06b38589db3c6158ad82c5a
/frameworks/base/core/jni/android/graphics/Graphics.cpp
c2d9470aa9d92be3ffb998ecbbff157b94fdee12 13-Jan-2017 Ben Wagner <bungeman@google.com> Remove SkDevice.h includes.

SkDevice.h is being removed from Skia. This removes these already unused
includes which mention this file.

Test: refactoring CL. Existing unit tests still pass.

Change-Id: I8340a5822ad2b75c54fe0dca1303ceab9bbee805
/frameworks/base/core/jni/android/graphics/Graphics.cpp
9505a6552764461c22ce48f1ac13d025d23e1579 14-Dec-2016 Romain Guy <romainguy@google.com> Add new RGBA_F16 bitmap config

This configuration uses 64 bits per pixel. Heach component is stored as a
half precision float value (16 bits). Half floats can be decoded/encoded
using android.util.Half.

RGBA_F16 bitmaps are used to decode wide-gamut images stored in 16 bit
formats (PNG 16 bit for instance). aapt is currently not aware of PNG
16 bits so such files must be placed in raw/ resource directories.

This first pass provides only partial drawing support with hardware
acceleration. RGBA_F16 bitmaps are stored in linear space and need
to be encoded to gamma space with the appropriate OETF to be rendered
properly on Android's current surfaces. They are however suitable for
linear blending. Full rendering support will be provided in a future
CL (BitmapShaders might be a bit tricky to handle properly during
shader generation).

Bug: 32984164
Test: bit CtsGraphicsTestCases:android.graphics.cts.BitmapRGBAF16Test

Change-Id: I328e6b567441a1b9d152a3e7be944a2cf63193bd
/frameworks/base/core/jni/android/graphics/Graphics.cpp
19b4b019169424d62bf3edc40b9560984206cf80 14-Dec-2016 sergeyv <sergeyv@google.com> Fix getConfig function for hw bitmaps

Test: HardwareBitmapTests#testGetConfig
bug:30999911
Change-Id: I93a1c9fc88567ada2462a7a3b6cef8f796844e15
/frameworks/base/core/jni/android/graphics/Graphics.cpp
da6c8ffcc594493c3936f83255efccdbf964cd21 23-Nov-2016 sergeyv <sergeyv@google.com> Introduce Bitmap.Config.Hardware with @hide annotation

Test: HardwareBitmapTests
bug:30999911
Change-Id: Iaa0e18842704cb6bcd483c63a095dcb22baaf5e0
/frameworks/base/core/jni/android/graphics/Graphics.cpp
ab12c1fe73734a18ac19a06b97f276528f6d027a 03-Nov-2016 Mike Reed <reed@google.com> update callers to newer Skia APIs

Test: refactoring CL. Existing unit tests still pass.

Change-Id: I47e73e00f14f78dd9d4c48a142ac9853e7e4cad7
/frameworks/base/core/jni/android/graphics/Graphics.cpp
aed7f58fb05a25ce2112829e77c0eb5dd268e8a7 15-Oct-2016 sergeyv <sergeyv@google.com> Pass Bitmap instead of SkBitmap in canvas.drawBitmap(Bitmap, float,float,Paint)
Test: refactoring cl.
bug:32216791

Change-Id: If9f9fbc19e683b14cce6c3c268258bd832d495d2
/frameworks/base/core/jni/android/graphics/Graphics.cpp
c1c54062f8cc9d47bdea820ae5ab6aef260b4488 20-Oct-2016 sergeyv <sergeyv@google.com> Rename hwui/PixelRef to hwui/Bitmap
Test: refactoring cl.
bug:32216791

Change-Id: I26de43f71027bccb43a5011f84080ab4631b2883
/frameworks/base/core/jni/android/graphics/Graphics.cpp
c36bd6c16ddfc160732ff7e4518564714c8aa66e 12-Oct-2016 sergeyv <sergeyv@google.com> Move allocatePixelRef methods to hwui.
This patch also makes tests to use SkBitmap backed by hwui/PixelRef,
Test: refactoring cl.
bug:27762775

Change-Id: Ib936e81877790849118420f5e565fc8f4466c1be
/frameworks/base/core/jni/android/graphics/Graphics.cpp
253f2c213f6ecda63b6872aee77bd30d5ec07c82 29-Sep-2016 Romain Guy <romainguy@google.com> Linear blending, step 1

NOTE: Linear blending is currently disabled in this CL as the
feature is still a work in progress

Android currently performs all blending (any kind of linear math
on colors really) on gamma-encoded colors. Since Android assumes
that the default color space is sRGB, all bitmaps and colors
are encoded with the sRGB Opto-Electronic Conversion Function
(OECF, which can be approximated with a power function). Since
the power curve is not linear, our linear math is incorrect.
The result is that we generate colors that tend to be too dark;
this affects blending but also anti-aliasing, gradients, blurs,
etc.

The solution is to convert gamma-encoded colors back to linear
space before doing any math on them, using the sRGB Electo-Optical
Conversion Function (EOCF). This is achieved in different
ways in different parts of the pipeline:

- Using hardware conversions when sampling from OpenGL textures
or writing into OpenGL frame buffers
- Using software conversion functions, to translate app-supplied
colors to and from sRGB
- Using Skia's color spaces

Any type of processing on colors must roughly ollow these steps:

[sRGB input]->EOCF->[linear data]->[processing]->OECF->[sRGB output]

For the sRGB color space, the conversion functions are defined as
follows:

OECF(linear) :=
linear <= 0.0031308 ? linear * 12.92 : (pow(linear, 1/2.4) * 1.055) - 0.055

EOCF(srgb) :=
srgb <= 0.04045 ? srgb / 12.92 : pow((srgb + 0.055) / 1.055, 2.4)

The EOCF is simply the reciprocal of the OECF.
While it is highly recommended to use the exact sRGB conversion
functions everywhere possible, it is sometimes useful or beneficial
to rely on approximations:

- pow(x,2.2) and pow(x,1/2.2)
- x^2 and sqrt(x)

The latter is particularly useful in fragment shaders (for instance
to apply dithering in sRGB space), especially if the sqrt() can be
replaced with an inversesqrt().

Here is a fairly exhaustive list of modifications implemented
in this CL:

- Set TARGET_ENABLE_LINEAR_BLENDING := false in BoardConfig.mk
to disable linear blending. This is only for GLES 2.0 GPUs
with no hardware sRGB support. This flag is currently assumed
to be false (see note above)
- sRGB writes are disabled when entering a functor (WebView).
This will need to be fixed at some point
- Skia bitmaps are created with the sRGB color space
- Bitmaps using a 565 config are expanded to 888
- Linear blending is disabled when entering a functor
- External textures are not properly sampled (see below)
- Gradients are interpolated in linear space
- Texture-based dithering was replaced with analytical dithering
- Dithering is done in the quantization color space, which is
why we must do EOCF(OECF(color)+dither)
- Text is now gamma corrected differently depending on the luminance
of the source pixel. The asumption is that a bright pixel will be
blended on a dark background and the other way around. The source
alpha is gamma corrected to thicken dark on bright and thin
bright on dark to match the intended design of fonts. This also
matches the behavior of popular design/drawing applications
- Removed the asset atlas. It did not contain anything useful and
could not be sampled in sRGB without a yet-to-be-defined GL
extension
- The last column of color matrices is converted to linear space
because its value are added to linear colors

Missing features:
- Resource qualifier?
- Regeneration of goldeng images for automated tests
- Handle alpha8/grey8 properly
- Disable sRGB write for layers with external textures

Test: Manual testing while work in progress
Bug: 29940137

Change-Id: I6a07b15ab49b554377cd33a36b6d9971a15e9a0b
/frameworks/base/core/jni/android/graphics/Graphics.cpp
c69853c8b72540e5031d28e03cbce5a390c6959f 07-Oct-2016 sergeyv <sergeyv@google.com> Remove all hacks around ref counting in Bitmap
Test: refactoring cl.
bug:27762775

Change-Id: If7ebb8d5ee3a3085c1ef9ffc277cf6feaeab89e1
/frameworks/base/core/jni/android/graphics/Graphics.cpp
4508218850faedea95371188da587b6734f5f3da 30-Sep-2016 sergeyv <sergeyv@google.com> Make bitmap backed by native memory instead of java byte array
Test: refactoring CL. Existing unit tests still pass.
bug:27762775

Change-Id: Ic4e914b3a941c3d545f8ce9e320e638973df0e91
/frameworks/base/core/jni/android/graphics/Graphics.cpp
003bdee0b6680b8ab0d1fa07451e50e8c3555160 12-Sep-2016 John Reck <jreck@google.com> Ensure munmap matches mmap

Bug: 31350622
Change-Id: I6d3f9faec32d54360caa6706d17405e20b50966c
/frameworks/base/core/jni/android/graphics/Graphics.cpp
db4773f0df43da92ef5878e5c845552e251b3790 19-May-2016 Matt Sarett <msarett@google.com> Correct rowBytes on SkBitmap to match recycled bitmap sooner

This will prevent us from triggering asserts when we
call lockPixels().

skbug.com/4538

Change-Id: Ibcd18818e33ccbacdcdfa57e822b04dd91b6af17
/frameworks/base/core/jni/android/graphics/Graphics.cpp
a9471b1bd6806114e38c58b6286a0b70aa8b85a3 25-Mar-2016 Derek Sollenberger <djsollen@google.com> Update pixelRef genID when reusing pixels in RecyclingClippingPixelAllocator.

When this code was refactored to support the new RegionDecoder it appears that
we dropped a call to bump the genID. Adding it back is functionally correct
and should fix the recycling issue.

bug: 26617759
Change-Id: I966d398ca983edb40040e01345799b3cc9957fe0
/frameworks/base/core/jni/android/graphics/Graphics.cpp
dccca44ffda4836b56a21da95a046c9708ffd49c 21-Mar-2016 sergeyv <sergeyv@google.com> Reland: Move text logic from jni to hwui level

Initial CL: https://googleplex-android-review.git.corp.google.com/#/c/886854/

Change-Id: I9dfd85fe1d2a2c44f4360c8a29fd58d80e6f31c8
/frameworks/base/core/jni/android/graphics/Graphics.cpp
afbd0f1fef46ef0ddf633dfde0de724db3da1405 21-Mar-2016 Sergei Vasilinetc <sergeyv@google.com> Revert "Move text logic from jni to hwui level"

This reverts commit a7f6bba1a3565c19715e878dfe7f0e01022944ff.

Change-Id: If4f36f87a85411b6128fd92d391313803ccaf9dd
/frameworks/base/core/jni/android/graphics/Graphics.cpp
a7f6bba1a3565c19715e878dfe7f0e01022944ff 16-Mar-2016 sergeyv <sergeyv@google.com> Move text logic from jni to hwui level

bug:25865834
Change-Id: I2d8c9c9544afcb5ce1784f732aed3e54e0eda372
/frameworks/base/core/jni/android/graphics/Graphics.cpp
1819bb5230241b3428b75f848c3f9977afd0186f 05-Feb-2016 Matt Sarett <msarett@google.com> Copy appropriate number of rows in RecyclingClippingPixelAllocator

This is used by BitmapRegionDecoder to decode into a recycled
bitmap.

Since the specification does not guarantee that the recycled
bitmap will be larger than the decoded region, we must be careful
to only to copy min(recycledHeight, decodeHeight) rows.

This should fix flakiness in the BitmapRegionDecoderTest on cts.

BUG:26978886
Change-Id: I318468b0eaa67bd9a7860824f75d45df9bf5fbce
/frameworks/base/core/jni/android/graphics/Graphics.cpp
1f979639c168ebdf77ad8d7771786fc321ce8234 27-Oct-2015 Matt Sarett <msarett@google.com> Merge new implementation of BitmapRegionDecoder.

This is a combination of the following 4 commits.

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

Make SkBitmapRegionDecoder use SkAndroidCodec

The current implementation of SkBitmapRegionDecoder relies
on SkImageDecoder::decodeSubset() which itself relies on
forked copies of libjpeg and libpng.

This implementation has caused numerous correctness and memory
bugs, and also prevented us from updating to the latest
optimized versions of libjpeg-turbo and libpng.
https://docs.google.com/a/google.com/document/d/1w0vdC9sPPquwgJLY4wjBvzwm8QZIqIgg1q3tDEvOoUU/edit?usp=sharing

The SkAndroidCodec implementation fixes known correctness and
memory bugs, at least matches the performance of the
the old implementation (and in many cases improves upon it),
and uses standard copies of libjpeg-turbo and libpng.

In addition to improving region decodes, switching to new
copies of libjpeg-turbo and libpng will improve performance
of full image decodes significantly. Jpeg, in particular,
will be about 2x faster.

Change-Id: Ia51645009b243607d3022d49e8e0c82ec4e959bc

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

Make JavaPixelAllocator and RCPAllocator implement SkBRDAllocator

This will allow us to optimize decodes when destination memory
is zero initialized.

Change-Id: I1e56cd5410d1e9b6544b0e47aac8da740bca5252

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

Fix build by using SkBRDAllocator

Change-Id: Icf031409f0e58496d80b9bdc91def8ff97f7d0d2

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

Fix bug in RecyclingPixelAllocator::copyIfNecessary()

This was exposed by a new test that I hope to add to
the BitmapRegionDecoderTests.

Change-Id: Ic5a32e095ff3ce457abab7216a8da1acf17db27b

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

Depends on adding libjpeg-turbo to the manifest.
Change-Id: Ic8ffa339722bfa9f40f44f68d03ce9a3faef1ee2

Depends on update to Skia.
Change-Id: I4bdaacb8a04e2dee5e3eccc58033601384c77b7d

BUG:25424175
BUG:25344771
http://skbug.com/1243
http://skbug.com/4475
https://code.google.com/p/android/issues/detail?id=77195
http://skbug.com/4417
https://code.google.com/p/android/issues/detail?id=162760
http://skbug.com/4264
https://code.google.com/p/android/issues/detail?id=76976
http://skbug.com/4418
http://skbug.com/1282
https://code.google.com/p/android/issues/detail?id=189248
https://code.google.com/p/android/issues/detail?id=80316
https://buganizer.corp.google.com/u/0/issues/20224409
http://skbug.com/4319
http://skbug.com/4361
https://code.google.com/p/android/issues/detail?id=165546
https://code.google.com/p/android/issues/detail?id=81068
https://buganizer.corp.google.com/u/0/issues/22527238
https://buganizer.corp.google.com/u/0/issues/23731509
https://code.google.com/p/skia/issues/detail?id=4469
http://skbug.com/4360
http://skbug.com/4489
http://skbug.com/4490
/frameworks/base/core/jni/android/graphics/Graphics.cpp
746f86815b241b5e5b7b1af899a5dc642ee5b020 06-Nov-2015 Matt Sarett <msarett@google.com> Rename SkBitmapRegionDecoder to BitmapRegionDecoder

This is temporary, we are planning to delete this class.
Renaming will allow us to have an SkBitmapRegionDecoder class
in Skia.

Change-Id: I8d24d481d4e8cf782f578fa6deb6e3245c998a37
/frameworks/base/core/jni/android/graphics/Graphics.cpp
f35b989d26bb98900f6c5fa2e586326b30b6e161 31-Jul-2015 Leon Scroggins III <scroggo@google.com> Merge six commits from master-skia to master

Also corrects some code under development behind the HWUI_NEW_OPS flags
to match the updated Skia API.

Include external/skia/include/private
use SrcConstraint for drawBitmapRect
clean up to allow removal of flags for SCALAR_DIV and IMAGEINFO_FIELDS
don't call DEPRECATED getDevice()
update to newer API for drawBitmapRect
asABitmap is deprecated, used isABitmap

previous-Change-Id: I12208855a95948897077b1c1549eb35416cc801e
previous-Change-Id: I5044f0f61315fe48c60d7af5e261a7d0ed574f56
previous-Change-Id: Ic34a3ba77b3f9e091fa7aaba75018a307abacdab
previous-Change-Id: I79f8dd779920565d1204f7fe67b3286b1bbf4e9b
previous-Change-Id: Ic04d1f8274f6a862ea00f8d241363cf31f5ec1ec
previous-Change-Id: I9e4ae257a1976c74302b6a73f17405174ae58cec
previous-Change-Id: I85de3462ad1e4877784df38edc4bcd0acbd24e5e
Change-Id: Ide8e2f669e91a13c32521af3a16efdaa085c81d0
/frameworks/base/core/jni/android/graphics/Graphics.cpp
d8f904f256b82e48e9a85561eb96e15399b0b2d9 28-Oct-2015 Tom Hudson <tomhudson@google.com> Revert "Merge six commits from master-skia to master"

This reverts commit 550780745fa28ae9a87d02331841ca5ce4f9c763.

Change-Id: Ic71eccea454b26261fe6e9a9a7a24eff56396989
/frameworks/base/core/jni/android/graphics/Graphics.cpp
550780745fa28ae9a87d02331841ca5ce4f9c763 31-Jul-2015 Leon Scroggins III <scroggo@google.com> Merge six commits from master-skia to master

Include external/skia/include/private
use SrcConstraint for drawBitmapRect
clean up to allow removal of flags for SCALAR_DIV and IMAGEINFO_FIELDS
don't call DEPRECATED getDevice()
update to newer API for drawBitmapRect
asABitmap is deprecated, used isABitmap

Change-Id: I519f54f97321a7a365ea81a3b78cb03b9bdca021
previous-Change-Id: I12208855a95948897077b1c1549eb35416cc801e
previous-Change-Id: I5044f0f61315fe48c60d7af5e261a7d0ed574f56
previous-Change-Id: Ic34a3ba77b3f9e091fa7aaba75018a307abacdab
previous-Change-Id: I79f8dd779920565d1204f7fe67b3286b1bbf4e9b
previous-Change-Id: Ic04d1f8274f6a862ea00f8d241363cf31f5ec1ec
previous-Change-Id: I9e4ae257a1976c74302b6a73f17405174ae58cec
/frameworks/base/core/jni/android/graphics/Graphics.cpp
a316c5dfbc6355f536d765959cacb06bbfed76ad 06-Jun-2015 Jeff Brown <jeffbrown@google.com> Fix Bitmap parceling through ashmem.

Fixes a bug where the Bitmap parceling code was unable to deal with
sending bitmaps through Parcels that disallow file descriptors.
Uses extended functionality of the Parcel blob interface to pass
buffers around more efficiently while adapting to whether FDs
are allowed.

Bug: 21428802
Change-Id: If24926f4388d29aa2aac627000436beb015edcb9
/frameworks/base/core/jni/android/graphics/Graphics.cpp
721ae5fec5f1fd4f93aa2a361a0ac298e15ce353 12-May-2015 Riley Andrews <riandrews@google.com> Add internal bitmap api for creating immutable ashmem backed bitmaps.

Bug 21037890
Change-Id: I827e83dd75e301e7d93ead5efdd744f0d8435ae5
/frameworks/base/core/jni/android/graphics/Graphics.cpp
39d7f30ebe490c1d6aee76b0b61e3e67dec13e34 14-Nov-2014 Riley Andrews <riandrews@google.com> Use ashmem to optimize all bitmap copies.

Bug 21037890
Change-Id: Ie32ca3a0c527755f1a1b77db7548cb9629e2001b
/frameworks/base/core/jni/android/graphics/Graphics.cpp
ae2e8b4891491e8e89bed5f2c9626415adee09cb 06-May-2015 John Reck <jreck@google.com> Add warning if an in-use Bitmap is reconfigured

Bug: 18928352

Also fix an issue around re-configure not properly handling
mPinnedCount in android::Bitmap

Change-Id: I1815b121f1474ad931060771bb1d52ef31d2aac7
/frameworks/base/core/jni/android/graphics/Graphics.cpp
f29ed28c7b878ef28058bc730715d0d32445bc57 07-Apr-2015 John Reck <jreck@google.com> Attempt to solve the double-GC problem

Fix the issue where Bitmap requires two GC passes
to release its byte[] by using some questionable
ref-counting hacks to manage whether or not
native has a strong or weak ref to the byte[]

Change-Id: Ia90a883579f61c0b1904b5549a66bd0ef34b32c5
/frameworks/base/core/jni/android/graphics/Graphics.cpp
ed207b92747234eac88dd3664ecfb535e45d8ed1 10-Apr-2015 John Reck <jreck@google.com> Change how Java Bitmaps are accessed in a few places

Stop assuming that a Java Bitmap has a SkBitmap* that
has some externally managed lifecycle, and instead switch
a bunch of users to accessing the bitmap by providing
their own SkBitmap* on which to set the (ref counted!)
SkPixelRef* instead

Attempt #2 to land this, original issue was in getSkBitmap
and should be fixed

Change-Id: I0fd9e193968b41e5597784140d56b4885906864a
/frameworks/base/core/jni/android/graphics/Graphics.cpp
c1b33d665c8caf5760f68c45c6ca0baa649b832a 22-Apr-2015 John Reck <jreck@google.com> GraphicsJNI Canvas cleanup

Change-Id: I72e142986a8bc9f464c1951b6b5187919de3462e
/frameworks/base/core/jni/android/graphics/Graphics.cpp
edc22fba5921f5c2d3502727e707f959b8c3a460 21-Apr-2015 John Reck <jreck@google.com> Revert "Change how Java Bitmaps are accessed in a few places"

Bug: 20207616

This reverts commit a771b9861d11671c780092d35c0062eeefcf37c0.

Change-Id: Ifd891cc075274a7986e987229e0fed5a04ed9ff0
/frameworks/base/core/jni/android/graphics/Graphics.cpp
a771b9861d11671c780092d35c0062eeefcf37c0 10-Apr-2015 John Reck <jreck@google.com> Change how Java Bitmaps are accessed in a few places

Stop assuming that a Java Bitmap has a SkBitmap* that
has some externally managed lifecycle, and instead switch
a bunch of users to accessing the bitmap by providing
their own SkBitmap* on which to set the (ref counted!)
SkPixelRef* instead

Change-Id: I0fd9e193968b41e5597784140d56b4885906864a
/frameworks/base/core/jni/android/graphics/Graphics.cpp
f4faeac3525fe1ce3707ab785a1651aec367589d 05-Mar-2015 John Reck <jreck@google.com> Cleanup Bitmap JNI attempt #2

Original version missed a spot

This reverts commit c02977e3bbfaaedcb1b1d67e1692becc7dddd59b.

Change-Id: I56244ce10d709fcdef42a001fe4c6ba7b6bbb04d
/frameworks/base/core/jni/android/graphics/Graphics.cpp
c02977e3bbfaaedcb1b1d67e1692becc7dddd59b 05-Mar-2015 Chad Jones <chadj@google.com> Revert "Cleanup Bitmap JNI"

This reverts commit b2915245b74b3b5541b123e38403f8e26426b4b7.

Change-Id: Idd7d7f33eec4ea5024c83de6b10d3d1a6ab2b17a
/frameworks/base/core/jni/android/graphics/Graphics.cpp
b2915245b74b3b5541b123e38403f8e26426b4b7 04-Mar-2015 John Reck <jreck@google.com> Cleanup Bitmap JNI

Fix a bunch of places where mNativeBitmap was being
poked at directly, switch them either to the NDK API
or to GraphicsJNI where it made sense

Change-Id: I6b3df3712d6497cba828c2d3012e725cb4ebb64d
/frameworks/base/core/jni/android/graphics/Graphics.cpp
c4e4eef64a660bcc81dfcaec39822ad7711997b4 30-Jan-2015 Derek Sollenberger <djsollen@google.com> Merge "Rename Canvas::getSkCanvas to Canvas::asSkCanvas"
d37095b74eac610a719826311693078a670e9f71 29-Jan-2015 Derek Sollenberger <djsollen@google.com> Fix bitmap allocation error that causes crash when calling Bitmap::extractAlpha

bug: 19112656
Change-Id: Ib44ba4208449d5873402e9516abc8b6d8fa0b82a
/frameworks/base/core/jni/android/graphics/Graphics.cpp
b3d50e007523d1ada0866d384c391c72ac1a3577 29-Jan-2015 Derek Sollenberger <djsollen@google.com> Rename Canvas::getSkCanvas to Canvas::asSkCanvas

Change-Id: I967a45698d382e54eaa5ff64fa8909ff00908650
/frameworks/base/core/jni/android/graphics/Graphics.cpp
3d4eed7f1aa99401dabe2e45b82f98fb4fc2d754 04-Dec-2014 Derek Sollenberger <djsollen@google.com> Update HWUI to store its own SkBitmap objects

This enables us to...

1) simplify the lifecycle/ownership between Java and HWUI
2) remove DisplayListRenderer::drawBitmapData and associated logic
3) track pixel lifecycle using standard SkPixelRef refcounting
4) Remove uncessary calls to ref/unref the bitmap's pixels and colorTable

Change-Id: I3c95078da20995444f6388a029414280fd654318
/frameworks/base/core/jni/android/graphics/Graphics.cpp
71487eb0ceb2b7dea02649e78d99bb5952f5eaef 19-Nov-2014 Mike Reed <reed@google.com> Merge frameworks/base changes from master-skia to master.

Adaptations to changes in Skia upstream since Oct 2014.
(https://code.google.com/p/skia/issues/detail?id=2377)

cbb922d use new roundOut signature
77082de Call SkColorTable::readColors().
5456ab1 Handle the result of SkMatrix::asAffine.
25cfc78 Remove dependence on SK_LEGACY_PICTURE_SIZE_API.

BUG:18468293

Change-Id: I5a4d274e854298843891410b1ffd5e24f038b88a
/frameworks/base/core/jni/android/graphics/Graphics.cpp
1022888d33c82dedb3ab3a53d1c3bb432eca93f7 05-Dec-2014 John Reck <jreck@google.com> resolved conflicts for merge of 203c8171 to master

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

bug:18306529
Change-Id: I1ea94df1dcaf4fcf248b63dc8b0a13f36412570a
/frameworks/base/core/jni/android/graphics/Graphics.cpp
2b5edf651a3916632da348e9f83e2b2393664381 25-Nov-2014 Bo Liu <boliu@google.com> am 88309159: am 38134303: am 84be180e: Merge "Fix crash in getNativeCanvas when canvasHandle is NULL" into lmp-mr1-dev

* commit '88309159a53ceb4f34fe01056521e4b84e848ef7':
Fix crash in getNativeCanvas when canvasHandle is NULL
de92f4c72be8537d2efff6024390b9ab706286e1 24-Nov-2014 Bo Liu <boliu@google.com> Fix crash in getNativeCanvas when canvasHandle is NULL

BUG: 18261928
Change-Id: I01a5af201fe829d5752433e1bb0db7edc01733d4
/frameworks/base/core/jni/android/graphics/Graphics.cpp
ab22c1c792bc5f422a029a4ab6a23861e44136d8 03-Sep-2014 Derek Sollenberger <djsollen@google.com> cleanup so that the Paint.h is only accessed via its nativePtr not a JNI lookup

bug: 17641888
Change-Id: I8fc2a01fdcf62dd33b443b0a2302df5e29dc3f49
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
2cb8c3c9e5d79dfba10d2f39792ad553d4fbc292 21-Jul-2014 Derek Sollenberger <djsollen@google.com> Remove invalid SkASSERT that prevents us from running with SK_DEBUG

Change-Id: I5634990e6cb962d72b686f7f103b9af7d96d4b55
/frameworks/base/core/jni/android/graphics/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
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
1103b3255945d2eb2fa9c191e84e2270b343cca9 08-Jul-2014 Mike Reed <reed@google.com> SkBitmap::Config is deprecated, use SkColorType

Change-Id: Ic953741325607bf85598c097bb3ab648d4a08996
/frameworks/base/core/jni/android/graphics/Graphics.cpp
42a1d08df7d417fd4e67eabc91ff05ee77fd9995 08-Jul-2014 Mike Reed <reed@google.com> SkBitmap::Config is deprecated, use SkColorType

Change-Id: Ida181d2aac760072cf2d01409edac37699dea216
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
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
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
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
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
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
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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
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>
/frameworks/base/core/jni/android/graphics/Graphics.cpp
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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
dbccd44a638ae8705a5b14bff8b2dd74abc26045 22-Nov-2013 The Android Open Source Project <initial-contribution@android.com> Merge commit 'b873a17ce7be0a9771c24999adca6964431728f6' into HEAD

Change-Id: I938755073e70602cc8f51ce9bd420fdcf870cecd
6ecb7a9a27c96e50525de2bc5c78391bf401bf72 18-Oct-2013 Mathieu Chartier <mathieuc@google.com> Fix whitespace issues after casts.

Change-Id: Ief3e50fbedd193e22509aac783f16ba1288908de
/frameworks/base/core/jni/android/graphics/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)
/frameworks/base/core/jni/android/graphics/Graphics.cpp
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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
1abf5d62429e5a9329520b2f7c2b5a5e7a8e72ec 16-Aug-2013 Chris Craik <ccraik@google.com> Add inPremutiplied option to BitmapFactory.Options, functionality in Bitmap

bug:2248948

Change-Id: I8fdd649332667598504a1076d5a447572bd53086
/frameworks/base/core/jni/android/graphics/Graphics.cpp
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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
109109cdd5004789d5caf6da743986f26cb54e7b 03-Apr-2013 Derek Sollenberger <djsollen@google.com> Refactoring code to support r8352 of Skia.

Change-Id: Ica1463c84edaf7a46566d1ff792f7f73cef31997
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
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
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
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
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
2118b25ad422e946d4d87e191c5710bfacd7503e 18-Dec-2010 Carl Shapiro <cshapiro@google.com> Eliminate tracked allocations and the inNativeAlloc option.

Change-Id: Ic10b2b41a26925d799e5d1e50be77fc480ec0f17
/frameworks/base/core/jni/android/graphics/Graphics.cpp
a2f0e2d6b7f9dff3a52dd78d6db307070a71e9b2 16-Dec-2010 Patrick Dubroy <dubroy@google.com> Allow a JNI local ref to be passed directly into globalRef().

Change-Id: If3063e88ec1eba7a13c983f5f71be6a2d84c4d60
/frameworks/base/core/jni/android/graphics/Graphics.cpp
afde46ed008f150e45e1b0d7e1dc588fc047b74f 15-Dec-2010 Patrick Dubroy <dubroy@google.com> Turn fatal assertion in decodeRegion into a warning.
/frameworks/base/core/jni/android/graphics/Graphics.cpp
e4ac2d6b5723c95e648c489b187ddde449452c13 01-Dec-2010 Patrick Dubroy <dubroy@google.com> Allocate bitmap backing buffers in the Java heap.

Change-Id: I60f6ccff13357c1c518e9d56b02fe0171637edd1
/frameworks/base/core/jni/android/graphics/Graphics.cpp
e224fabb2c59e9f1274c3569c04b91787824add0 30-Sep-2010 Owen Lin <owenlin@google.com> Fix segfault when tring to throw IOException.

Change-Id: I530cc4409ba4ca17cec933afad077c5f60ba554f
/frameworks/base/core/jni/android/graphics/Graphics.cpp
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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
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
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
f1f48bc7f200f54c76b22d845d8ba8419879b375 19-Jul-2010 Joseph Wen <josephwen@google.com> Do JPEG tile-based decoding.

Change-Id: I5c1b4ac3c02eb4350ef0ba9a7877b22cfd730cfb
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
c04851fd0af87f44a7d7351e0c17442fa1d3fc28 28-Oct-2009 Mike Reed <reed@google.com> add boundary patch
/frameworks/base/core/jni/android/graphics/Graphics.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
/frameworks/base/core/jni/android/graphics/Graphics.cpp
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.
/frameworks/base/core/jni/android/graphics/Graphics.cpp
1b22b979256cf163ab9bbfd4fcfa16a8ce862ed1 17-Jul-2009 Mike Reed <reed@google.com> add hidden Options field for native allocations
/frameworks/base/core/jni/android/graphics/Graphics.cpp
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/jni/android/graphics/Graphics.cpp
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/jni/android/graphics/Graphics.cpp
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/frameworks/base/core/jni/android/graphics/Graphics.cpp
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/core/jni/android/graphics/Graphics.cpp
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/jni/android/graphics/Graphics.cpp