1344 Commits

Author SHA1 Message Date
Mathias Agopian
2ca204e4c0 get rid of PixelFormatInfo and simplify things
Change-Id: I487d4eef7db0095ace4babf5bb100a8769711257
2013-07-25 19:25:10 -07:00
Mathias Agopian
d84feebba4 Merge "update to new Consumer APIs" 2013-07-20 01:03:22 +00:00
Chris Craik
ef5498edf6 Merge "Add reconfigure method to Bitmap" 2013-07-18 22:55:44 +00:00
Chris Craik
c84d203da2 Add reconfigure method to Bitmap
bug:9797004

Grants a means to reuse a bitmap's allocation for different
width/height/Config without going through
BitmapFactoryOptions.inBitmap

Change-Id: Ib62319f3bd96c451fc1636288adf06a8275b4e3d
2013-07-17 12:08:01 -07:00
Mathias Agopian
e32632682c update to new Consumer APIs
Change-Id: I8649f3add40e0aeeeb0396b98e2cb93312e8e990
2013-07-16 23:14:24 -07:00
Romain Guy
4e7b772b73 Fix crashes in setMatrix() and concat()
setMatrix() was crashing in native code, only with hw acceleration on.
concat() would throw a NullPointerException. It now ignores null matrices.

Change-Id: Iebd8b410a957d2ba501570c6fbb3f680ff4a1a23
2013-07-16 14:52:55 -07:00
Romain Guy
787e35793f Trace bitmaps decoding
Also remove dead code

Change-Id: Ie931b21858ccbe6ee4def54caf028fd2aed23317
2013-07-11 17:37:31 -07:00
Andy McFadden
e68720ee15 Merge "Minor fixes to android.graphics.Matrix" 2013-07-10 16:44:40 +00:00
Andy McFadden
73b81e75df Minor fixes to android.graphics.Matrix
Tweaked equals() and finalize(), introduced trivial hashCode().

(Also picked up a handful of automatic trailing-space removals.)

Bug 9756081

Change-Id: I4639cf1e970a16179fa6c0d24785f4d0dfbe58ed
2013-07-09 16:45:20 -07:00
Chris Craik
0c20c3898a Use global references for Bitmap AndroidPixelRefs
bug:9621717

Because we're no longer holding onto Bitmaps Java side during
DisplayList lifetime, use global refs to keep the backing byte arrays
around.

Adds back bitmap buffer passing + native ref management removed by
3b748a44c6bd2ea05fe16839caf73dbe50bd7ae9

Adds back globalRef-ing removed by
f890fab5a6715548e520a6f010a3bfe7607ce56e

Change-Id: Ia59ba42f05bea6165aec2b800619221a8083d580
2013-07-08 11:08:02 -07:00
Jason Sams
ec6221e555 Merge "Add 2,3 vectors to allowed intrinsic list." 2013-06-27 22:45:26 +00:00
Jason Sams
d93fdb77d8 Add 2,3 vectors to allowed intrinsic list.
Change-Id: Iafd90ef4337076ed9d1e335c16272a0517f846b3
2013-06-27 15:42:30 -07:00
Romain Guy
e3b0a0117a Refcount 9-patches and properly handle GC events
This change adds refcounting of Res_png_9patch instances, the native
data structure used to represent 9-patches. The Dalvik NinePatch class
now holds a native pointer instead of a Dalvik byte[]. This pointer
is used whenever we need to draw the 9-patch (software or hardware.)

Since we are now tracking garbage collection of NinePatch objects
libhwui's PatchCache must keep a list of free blocks in the VBO
used to store the meshes.

This change also removes unnecessary instances tracking from
GLES20DisplayList. Bitmaps and 9-patches are refcounted at the
native level and do not need to be tracked by the Dalvik layer.

Change-Id: Ib8682d573a538aaf1945f8ec5a9bd5da5d16f74b
2013-06-26 17:15:08 -07:00
Romain Guy
f296dca95f (Small) 9patch drawing improvements
Save a bit of memory in meshs generated from native code
Avoid an extra if/else when drawing with hardware accelration on

Change-Id: I31a4550bde4d2c27961710ebcc92b66cd71153cc
2013-06-24 16:45:41 -07:00
Svetoslav Ganov
ff4adde573 Generate PDF from Canvas.
This change adds simple APIs that enable an Android application
to generate a PDF document by drawing content on a canvas.

Change-Id: Ibac93d7c37b01a376ce7c48238657d8c7698d588
2013-06-19 19:35:38 -07:00
Jason Sams
9274384ff0 Fix docs
Change-Id: Ie6563f633481951d97f319aefd282b15c049e281
2013-06-18 18:52:42 -07:00
Jason Sams
1a3edb00c5 Update histogram docs.
Change-Id: I6cfedb5cac459befb083f352f43ed33f4418145a
2013-06-18 18:23:37 -07:00
Jason Sams
048c978ae5 Allow single channel and float convolve.
Change-Id: If448ea2ae38de2f8b95fc884ea0dbf8222964012
2013-06-18 17:39:10 -07:00
Jason Sams
8ace2acbf1 Add support for vec2 histogram
Change-Id: I30ab758a44485a8ea30043c4cd782c3560074c58
2013-06-18 17:34:34 -07:00
Jason Sams
109c46b8ea Merge "Add histogram intrinsic" 2013-06-19 00:26:38 +00:00
Jason Sams
01e9f90576 Add histogram intrinsic
Change-Id: I67bcaaef033d8770047923e8243e739010238539
2013-06-18 11:53:03 -07:00
Zhijun He
1eb818e5b3 Add Y8 and Y16 image format
These APIs are hidden. Also correct the value of RAW_SENSOR.

Bug: 9254294
Change-Id: Ic6271f5f6bfcfdd8b545d69a9a2154241c34d73b
2013-06-18 10:13:18 -07:00
Alan Viverette
f390f770ee Postpone creating new drawables for DrawableContainerState.
When creating a DrawableContainerState from a constant state, calls to
ConstantState.newDrawable() are postponed and made as they are needed.

Bug: 9280861
Change-Id: I03c93a43ee00aca3ff618d66d7f507f1722538d1
2013-06-13 15:11:16 -07:00
Eino-Ville Talvala
b2675542c2 Initial commit of new camera API, mostly just the interface.
- New core API classes in android.hardware.photography
- android.media.Image and android.media.ImageReader classes for
  application access to direct hardware image buffers.
- Additions to android.graphics.ImageFormat to describe new image
  types needed by new camera API.
- Some documentation included; very little implementation.

Bug: 9111736
Change-Id: I0680f35944d1cb8845b7dc0c67edc8c0f0864573
2013-06-07 21:29:45 +00:00
Romain Guy
81056427e8 Merge "Remove unnecessary Rect, better reuse of NinePatch objects" 2013-06-07 20:14:58 +00:00
Romain Guy
f3187b7df1 Remove unnecessary Rect, better reuse of NinePatch objects
Cloning drawables (which happens a lot) was creating copies of NinePatch
objects, which would cause the hardware renderer to generate more meshes
than necessary. Also avoid keeping a String we don't need (it was interned
but still.) Last but not least, remove 1 RectF per NinePatch in the system.

Change-Id: If4dbfa0c30892c9b00d68875e334fd5c2bde8b94
2013-06-07 12:17:11 -07:00
Chris Craik
34bff87b32 Merge "Add support for post-decode density scaling with reuse" 2013-06-06 21:04:49 +00:00
Alan Viverette
b33d778e9c Merge "Deprecate DrawableStateList.getChildren() and add getChild()." 2013-06-06 17:36:40 +00:00
Chris Craik
1e97ceb469 Merge "Support all formats for BitmapFactory.Options.inBitmap" 2013-06-06 16:13:30 +00:00
Alan Viverette
7214643332 Deprecate DrawableStateList.getChildren() and add getChild().
Moves from exposing the internal structure of a drawable state list
to only exposing the data. Adds getCapacity() and mutate() as
package-private APIs to support various drawable subclasses.

Change-Id: Id08743f979287e1a305f069ccc3c0085a7da6f7b
2013-06-05 17:12:19 -07:00
Chris Craik
905e8246ef Add support for post-decode density scaling with reuse
Also, simplifies scaling path, removing java variant - we always do
the scaling in native, which has the benefit of avoiding non-native
temporary allocations

Change-Id: I39c2219f5d77a267719629704e65611cf4388a82
2013-06-05 16:09:31 -07:00
Tim Murray
3f4579fbe4 am 379641a7: am ea45ab6f: Merge "Improve RS documentation." into jb-mr2-dev
* commit '379641a7ef09e1d7fab34d3027c5809fb2bc21ad':
  Improve RS documentation.
2013-06-05 13:53:28 -07:00
Tim Murray
c11e25c4e6 Improve RS documentation.
bug 8570568
Change-Id: I465fcc8ec3e2cc892dc3cb0067aacf5224338102
2013-06-05 11:28:45 -07:00
Chris Craik
7e8c03c0fe Support all formats for BitmapFactory.Options.inBitmap
bug:9194265

Instead of using custom code in skia to avoid allocations, use a
custom allocator that reuses the allocations from the inBitmap.

In order to avoid inconsistent state, the decode is done in a
separate bitmap and swapped into the existing native bitmap.

Eventually, we'd like to support inScaled=true completely avoiding
java allocations.

Change-Id: Ic4a2f2373b100a80a32c1cdebb7bcb726711c8a7
2013-06-03 18:14:44 -07:00
Jason Sams
1b1c39d773 am d19068a7: am 413adc92: Merge "Fix free after use with createFromBitmapResource" into jb-mr2-dev
* commit 'd19068a7d28d129f5a1a1be478e972b40cea04eb':
  Fix free after use with createFromBitmapResource
2013-06-01 09:51:46 -07:00
Jason Sams
3ece2f3268 Fix free after use with createFromBitmapResource
Bug 9227350

Change-Id: Iee7610a9bf3d9d1baf14b968aed2a7d0876d2af7
2013-05-31 14:01:04 -07:00
Romain Guy
54999da4b6 Remove MipmapDrawable
It's a hidden API that nobody uses.

Change-Id: Ie0ecbc45cd191a595e53fe8765defe6f2aa7e3f6
2013-05-30 17:34:27 -07:00
Chris Craik
9f58361e98 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
2013-05-28 13:50:33 -07:00
Romain Guy
ccccc44b13 am ac629ee8: am 529a9e39: Merge "TransitionDrawable should not become a LayerDrawable Bug #9057757" into jb-mr2-dev
* commit 'ac629ee86d9e60e35098d8e731a35fc36b3bf3d5':
  TransitionDrawable should not become a LayerDrawable Bug #9057757
2013-05-24 17:42:41 -07:00
Romain Guy
529a9e391e Merge "TransitionDrawable should not become a LayerDrawable Bug #9057757" into jb-mr2-dev 2013-05-25 00:38:26 +00:00
Romain Guy
90e10cc586 TransitionDrawable should not become a LayerDrawable
Bug #9057757

Calling TransitionDrawable.mutate() would turn it into a LayerDrawable,
causing it to draw all its children on screen at the same time.

Change-Id: I5efa87c43114a9c817719f08890ce41965f3220a
2013-05-24 17:31:17 -07:00
Tim Murray
6d7a53cbdd Add support to Java for RS tracing.
Change-Id: I95c365345fea3a1e132a7eb2270d541be0745d02
2013-05-24 13:36:32 -07:00
Fabrice Di Meglio
d04aaa97c9 am ddd02537: am b4426f15: Merge "Fix bug #8858012 layer-list\'s bitmap item\'s start/end gravity is incorrect on RTL under certain conditions" into jb-mr2-dev
* commit 'ddd02537a3fb499a82097453535194f4e29583dc':
  Fix bug #8858012 layer-list's bitmap item's start/end gravity is incorrect on RTL under certain conditions
2013-05-13 11:24:47 -07:00
Fabrice Di Meglio
b4426f155f Merge "Fix bug #8858012 layer-list's bitmap item's start/end gravity is incorrect on RTL under certain conditions" into jb-mr2-dev 2013-05-13 18:18:17 +00:00
Fabrice Di Meglio
731ba6649a Fix bug #8858012 layer-list's bitmap item's start/end gravity is incorrect on RTL under certain conditions
- set correct layout direction for Drawable

Change-Id: Ic8968acadbc7c9aa0bb68dd4dfbe09aa4e7cfa62
2013-05-10 19:21:35 -07:00
Tim Murray
119143de98 am 9917c1e2: am 17502c4b: Merge "Remove extraneous logging." into jb-mr2-dev
* commit '9917c1e2e9ba8a0bd4f29ce05844cd539c3a41b9':
  Remove extraneous logging.
2013-05-10 17:08:42 -07:00
Tim Murray
da67debe22 Remove extraneous logging.
bug 8888887

Change-Id: I68d01c2ba649257be1577d53f330ad28d3b57011
2013-05-09 14:45:43 -07:00
Derek Sollenberger
0c8c0add4e am c195ef73: am bee78812: Merge "Fix bug where we incorrectly clipped the bounds to the device size." into jb-mr2-dev
* commit 'c195ef73445c3ba605355798b9f1f9a78bc52f11':
  Fix bug where we incorrectly clipped the bounds to the device size.
2013-05-09 14:19:45 -07:00
Derek Sollenberger
708144e828 Fix bug where we incorrectly clipped the bounds to the device size.
This CL also updates the documenation to make it clear that the API
returns in local space, not clipped to the size of the bitmap/device.

bug: 8747526
Change-Id: I389844672ce955341863f9940c3b401ab00dc1dc
2013-05-09 14:00:29 -04:00
Derek Sollenberger
07da9df62b am e3326143: am 2c76016c: Merge "Fix error where clips/matrices are incorrectly transferred." into jb-mr2-dev
* commit 'e3326143c63e791863c1fd95599fb9db74fb4eed':
  Fix error where clips/matrices are incorrectly transferred.
2013-05-09 05:05:47 -07:00