Quite a few things going on in this commit:
- Enable bitmap strikes by default in Paint objects.
The SkPaint parameter that enables bitmap strikes was not previously
included in DEFAULT_PAINT_FLAGS. This effectively disabled bitmap
fonts. Oops! It's for the best, though, as additional work was needed
in Skia to make bitmap fonts work anyway.
- Complain if TEXTURE_BORDER_SIZE is not 1.
Our glyph cache code does not currently handle any value other than 1
here, including zero. I've added a little C preprocessor check to
prevent future engineers (including especially future-me) from
thinking that they can change this value without updating the related
code.
- Add GL_RGBA support to hwui's FontRenderer and friends
This also happened to involve some refactoring for convenience and
cleanliness.
Bug: 9577689
Change-Id: I0abd1e5a0d6623106247fb6421787e2c2f2ea19c
Path ops can be used to combine two paths instances in a single path
object. The following operations can be used:
- Difference
- Reverse difference
- Union
- XOR
- Intersection
To use the API:
Path p1 = createCircle();
Path p2 = createRect();
Path result = new Path();
result.op(p1, p2, Path.Op.DIFFERENCE);
This code will subtract the rectangle from the circle and generate
the resulting path in "result."
Change-Id: Ic25244665b6691a7df0b0002a09da73d937b553b
bug:9797004
Grants a means to reuse a bitmap's allocation for different
width/height/Config without going through
BitmapFactoryOptions.inBitmap
Change-Id: Ib62319f3bd96c451fc1636288adf06a8275b4e3d
setMatrix() was crashing in native code, only with hw acceleration on.
concat() would throw a NullPointerException. It now ignores null matrices.
Change-Id: Iebd8b410a957d2ba501570c6fbb3f680ff4a1a23
Tweaked equals() and finalize(), introduced trivial hashCode().
(Also picked up a handful of automatic trailing-space removals.)
Bug 9756081
Change-Id: I4639cf1e970a16179fa6c0d24785f4d0dfbe58ed
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
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
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
This change adds simple APIs that enable an Android application
to generate a PDF document by drawing content on a canvas.
Change-Id: Ibac93d7c37b01a376ce7c48238657d8c7698d588
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
- 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
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
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
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
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