History log of /frameworks/base/core/jni/android/graphics/GraphicsJNI.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
7ca5ad1d06c94d99f17b2f1f27cd853d47b5bcf4 19-Oct-2016 Sergei Vasilinetc <sergeyv@google.com> Merge "Move allocatePixelRef methods to hwui. This patch also makes tests to use SkBitmap backed by hwui/PixelRef, Test: refactoring cl. bug:27762775"
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/GraphicsJNI.h
260ab726486317496bc12a57d599ea96dcde3284 07-Oct-2016 Mike Reed <reed@google.com> use SkBlendMode instead of SkXfermode
use sk_sp versions of paint setters/getters

Change-Id: I86591a0a8ec92e6039776cbf00424ea24f585b28
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
21986f2ae73e9ae3395a37dd3976af55e75d4f9d 12-Oct-2016 Romain Guy <romainguy@google.com> Merge "Linear blending, step 1"
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/GraphicsJNI.h
163f88140e18f13575886e88af0336e0ab1ec846 08-Oct-2016 sergeyv <sergeyv@google.com> Move PixelRef to hwui
Test: refactoring cl.
bug:27762775

Change-Id: Idd13b865ce22d4c51ced9b0fe3e9174452e87c6e
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
003bdee0b6680b8ab0d1fa07451e50e8c3555160 12-Sep-2016 John Reck <jreck@google.com> Ensure munmap matches mmap

Bug: 31350622
Change-Id: I6d3f9faec32d54360caa6706d17405e20b50966c
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
900b2ab6d74d37b4c727a45208d3c4b7f95ff151 01-Sep-2016 Chih-Hung Hsieh <chh@google.com> Merge "Fix google-explicit-constructor warnings in core/jni." am: cfc9f5d03d am: ed4b31f9e1 am: 276322ad2e
am: 7af6508766

Change-Id: Iacc44f2bf7dfea03b3d023bb9b58bbb296ebbcfe
a6543289f56a939fd2e3c6a471f25f3459074277 29-Aug-2016 Chih-Hung Hsieh <chh@google.com> Fix google-explicit-constructor warnings in core/jni.

* Add explicit keyword to conversion constructors.
Bug: 28341362
Test: build with WITH_TIDY=1

Change-Id: I6125b7b761cb26831d42aabf10870ed68f0bf092
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
8898c16987831db47542a92151ed7209e22268aa 24-Mar-2016 Matt Sarett <msarett@google.com> Remove references to SkImageDecoder (part 2)

As of this CL, SkImageDecoder is no longer used in Android and
will be deleted by Skia.

(cherry picked from commit 097a6ea4b65046df3e3cbf93d1acfc4e6833e02f)

Change-Id: Ic754ab0dde7ad1b65ccf3b2bc23fcbc5ef44ed08
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
bad99183916ba2bac6659efc8a28273e344ba511 17-Mar-2016 sergeyv <sergeyv@google.com> Clean up and rename TypefaceImpl

bug:25865834
Change-Id: I77e8a627163e040a5c25865054a8a936052af367
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
c1b33d665c8caf5760f68c45c6ca0baa649b832a 22-Apr-2015 John Reck <jreck@google.com> GraphicsJNI Canvas cleanup

Change-Id: I72e142986a8bc9f464c1951b6b5187919de3462e
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
1022888d33c82dedb3ab3a53d1c3bb432eca93f7 05-Dec-2014 John Reck <jreck@google.com> resolved conflicts for merge of 203c8171 to master

Change-Id: I256397410c261fae049bae4572f132235be1c5c9
203c8171806a15b83efa9ad56be048281a40693b 04-Dec-2014 Derek Sollenberger <djsollen@google.com> am c1a2f38c: am 4d9da135: Merge "Update AndroidPixelRef to prevent VM from cleaning up memory prematurely." into lmp-mr1-dev

* commit 'c1a2f38ce0447b005d0cde6836857f451af84dc6':
Update AndroidPixelRef to prevent VM from cleaning up memory prematurely.
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/GraphicsJNI.h
3643f928824d285252eddea44f62e543108bf4b8 22-Nov-2014 Chih-hung Hsieh <chh@google.com> am 29d1b12d: am 05f7c39e: am fc4a7538: Merge "Revert "Frameworks/base: Mask Skia warning in GraphicsJNI""

* commit '29d1b12ddae8950ee7d2a8f31a040340185a331e':
Revert "Frameworks/base: Mask Skia warning in GraphicsJNI"
fc4a7538a65449428e9d321deb6a413e19461c6c 22-Nov-2014 Chih-hung Hsieh <chh@google.com> Merge "Revert "Frameworks/base: Mask Skia warning in GraphicsJNI""
158b6c98508f111de041853cab1d7a87b771b651 21-Nov-2014 Andreas Gampe <agampe@google.com> resolve merge conflicts of 7d13d9d to master.

Change-Id: I4d8a7ec4a25471565859050939ec05b0c1261627
9ebffb40d80cb6eb1c3bcd51007a3b68f32e4ba7 21-Nov-2014 Chih-hung Hsieh <chh@google.com> Revert "Frameworks/base: Mask Skia warning in GraphicsJNI"

Should be unnecessary after c/115476.
This reverts commit ba823cee8bafff98640408a777fe105a72fcea0d.

Change-Id: I3ef4d3e04805e450038d469d9672dc064f729b0f
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
ed6b9dff563c5e22f040ff37e12c0d771e0478ae 21-Nov-2014 Andreas Gampe <agampe@google.com> Frameworks/base: Consistency in core/jni

Make consistent use of core_jni_helpers for registration.

Translate some #ifdefs into const bools.

Change-Id: I37639aa053dd50f003a552cbd8550dddecc811c5
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
4bac6e11aef61e508303711f034e81e224b31699 21-Nov-2014 Dan Albert <danalbert@google.com> am 3a091b79: resolved conflicts for merge of 8e0cfe7c to lmp-mr1-dev-plus-aosp

* commit '3a091b79978caa9b5d58ae19f693279e5a717c2a':
Fix clang warnings in core/jni.
46d8444631b4b1253a76bfcc78a29d26014d022f 19-Nov-2014 Dan Albert <danalbert@google.com> Fix clang warnings in core/jni.

There are a few bugs in here too (mostly people expecting + to
concatenate C strings) :(

Change-Id: I0a243c05c4ea8b56e84896f37814d0fbea4c39d5
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
05ff23fdadc8efcedd8a39c8e61e04976b134d2c 11-Nov-2014 Andreas Gampe <agampe@google.com> am 8c48c68c: am 71f83672: Merge "Frameworks/base: Mask Skia warning in GraphicsJNI"

* commit '8c48c68cc7801451d069819c4417a3a240a64294':
Frameworks/base: Mask Skia warning in GraphicsJNI
ba823cee8bafff98640408a777fe105a72fcea0d 11-Nov-2014 Andreas Gampe <agampe@google.com> Frameworks/base: Mask Skia warning in GraphicsJNI

Do not allow unused-parameter warnings from Skia includes.

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

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

Change-Id: Ida181d2aac760072cf2d01409edac37699dea216
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
57ee620ced8caed1eb8651717f6a6d2d5f1f9a5b 05-Jun-2014 Leon Scroggins III <scroggo@google.com> Read premultiplied status from the SkBitmap.

Replace the Java variable with mRequestPremultiplied, to better
reflect what it represents. In both native and Java, the SkBitmap
is used as the decision maker of whether a Bitmap is premultiplied.
When changing other settings, mRequestedPremultiplied is used to
determine whether it should be premultiplied (if the new config/
hasAlpha-ness etc supports it).

ChooseFromColorProc now reads both the colortype (instead of the
deprecated Config) and alphatype on the SkBitmap. Same with
ChooseToColorProc. In the process, this caught a bug, where the
wrong procs were being used for Index8.

Replace instances of SkBitmap::Config with SkColorType where I
was already changing code.

Use the new versions of setConfig/allocPixels that take an SkImageInfo
as a parameter.

Document isPremultiplied's return value for ALPHA_8.

BUG:13618134
Change-Id: I91fc1f1e46e9294364b1af0ab4bdb37c68d7058e
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
3d528c403c8945cc326bb656ff0c2e11373401da 26-Jun-2014 Raph Levien <raph@google.com> Fix build breakage

Other files were including GraphicsJNI.h and didn't have Minikin in the
include path. This patch eliminates the offending include.

Change-Id: I05c9dbf80b93f1731fd0192015e2c9c68a9dd3c6
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
4c9355c35a0f62805739823a62ad41ca1cbc6502 07-May-2014 Mike Reed <reed@google.com> Frameworks changes to support latest Skia (r14729)

Required for a merge in external/skia
(I88b4d5cc81c357a8e223bd7860b1029590265200).

Includes two cherry-picks:

I456df543e1925b280f785c7b3bb81370157f9b09:
replace SkRasterizer* with NativeRasterizer* in JNI

I98adb200e023369d3ee75f21927fa98f23095a77:
Fix Paint.getFlags,setFlags wrt FILTER_BITMAP_FLAG

In Paint.setFlags(), turn FILTER_BITMAP_FLAG into a call to
SkPaint::setFilterLevel().

In Paint.getFlags(), read SkPaint::getFilterLevel() to determine
whether to include FILTER_BITMAP_FLAG in the result.

Fixes CTS tests with ToT Skia.

Change-Id: I2736f3f68683651574d79a169ff0ab563e0a469e
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
5827cb5059ed0eec4c73adf1acbd7ee47b2c5c8f 26-Jul-2013 Derek Sollenberger <djsollen@google.com> Changes needed to support Skia at r10377.

Change-Id: Id1e1c8c5938ee1a33c6fa3caabd2c28e89243eb4
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
12d81c49a015ed8d5ef7af2d854eee1e80472219 18-Dec-2010 Carl Shapiro <cshapiro@google.com> Fix a constructor declaration to match its definition.

The second argument of the JavaPixelAllocator constructor was
eliminated by an earlier change but the class definition was not
updated to match that edit.

Change-Id: I27af0cc52c748cfdec02eb4edcf512dd13f72567
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
afde46ed008f150e45e1b0d7e1dc588fc047b74f 15-Dec-2010 Patrick Dubroy <dubroy@google.com> Turn fatal assertion in decodeRegion into a warning.
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
340ce75b446f6a6afc12b0582be3fc34ac3a5364 08-Sep-2010 Wei-Ta Chen <weita@google.com> Revert "Rename LargeBitmap to BitmapRegionDecoder for having a better API."

This reverts commit 50ba3d2c09a9131f3578d271adf2bc8258ca1742.
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
50ba3d2c09a9131f3578d271adf2bc8258ca1742 07-Sep-2010 Wei-Ta Chen <weita@google.com> Rename LargeBitmap to BitmapRegionDecoder for having a better API.

Move AssetStreamAdaptor, AutoFDSeek and nullObjectReturn to Utils.h because
BitmapFactory.cpp and BitmapRegionDecoder.cpp both need to use these utility functions.

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

Change-Id: I5c1b4ac3c02eb4350ef0ba9a7877b22cfd730cfb
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
c04851fd0af87f44a7d7351e0c17442fa1d3fc28 28-Oct-2009 Mike Reed <reed@google.com> add boundary patch
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
1b22b979256cf163ab9bbfd4fcfa16a8ce862ed1 17-Jul-2009 Mike Reed <reed@google.com> add hidden Options field for native allocations
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
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/GraphicsJNI.h
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/jni/android/graphics/GraphicsJNI.h