By having quickReject round out the window-space geometry bounds, we
prevent the AA perimeter (which falls outside the local bounds passed
in) from drawing outside the clip.
Change-Id: I8ee36be9039a9c47906815ee2f0dbaa5eb910b82
Don't ever need the cached UTF-16 string conversions on the
device. Don't need to create those strings, and don't need
to create the lookup array for them at all. This requires
fixing all of the remaining places in the platform where we
interacted with the resources with the blind assumption that
the strings are UTF-16.
Change-Id: Ia0e5a150499837471e494e85b23b05fa06e0cf1d
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
The 9patch format allows to define more empty quads than this, remove
the use of a single int to index empty quads and replace it with a
lookup in the 9patch resource data structure.
Change-Id: I148ee5d9e0c96822b534a344e15c9d88078db7c2
An array of indices local to a layer would only be necessary if
we changed the way we resolve T-junctions. Since we only ever
draw quads, let's just use the indices we use everywhere else.
This change also uses the global indices array to render list
of colored rectangles to save on the number of vertices generated
CPU-side.
Change-Id: Ia6d1970b0e9247805af5a114ca2a84b5d0b7c282
setMatrix() was crashing in native code, only with hw acceleration on.
concat() would throw a NullPointerException. It now ignores null matrices.
Change-Id: Iebd8b410a957d2ba501570c6fbb3f680ff4a1a23
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
No longer compile libandroidfw as a static library on the device
since it already exists as a shared library. Keeping the static
library would force us to provide a static library version of
libinput for the device as well which doesn't make sense.
Change-Id: I3517881b87b47dcc209d80dbd0ac6b5cf29a766f
Bug #9425270
A better solution would be to use glCopyTexImage2D whenever possible but
this change would be a little more dangerous.
Change-Id: Ib1aaceda39d838716285ef97f356721416822dbb
Bug #9589379
If the atlas is terminated/reinitialized and a view does not invalidate
in between it might end up using a stale AssetAtlas::Entry. This change
is similar to how 9patch meshes are cached in DrawPatchOp: we simply
track the generation ID of the cache to make sure we always use the
latest data.
Change-Id: Ib5abb3769d2ce0eabe9adc04e320ca27c422019e
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 allows merged, clipped operations to behave correctly within a
savelayer, even if the base viewport has a large offset.
Additionally, disregard opaqueness when within a
complexclip/savelayer, as the coverage can't be trusted.
Change-Id: Ic908b82a4bb410bc7fac1b4295f4874ed166efc5
This change also fixes the way batched bitmaps were handled
inside a layer. The layer is now correctly dirtied to minimize
the amount of pixels to blend.
Fix alpha, mode and opaque computations for DrawPatchOp.
Change-Id: I1b6cd581c0f0db66c1002bb4fb1a9811e55bfa78
It turns out that SOCK_SEQPACKET sockets may sometimes return
ECONNREFUSED or ECONNRESET errors when the peer dies instead of
the usual EPIPE.
Bug: 9479906
Change-Id: Ia7e572b08bf63e43ba5aeda58281508beb5f8c73
This reduces state changes when we draw 9patches and text together,
which happens *a lot*. Also disable the NV profiling extension by
default since it doesn't play nice with display lists deferrals.
To enable it set debug.hwui.nv_profiling to true.
Change-Id: I518b44b7d294e5def10c78911ceb9f01ae401609
We were treating immediate mode bounds as pre translate, which is
inconsistent with using them for quickRejection.
This fixes the overdraw counter not drawing correctly (since it uses
immediate mode drawing.
Change-Id: I1c734d367a00942bd7d9b041822c0a9f284e70a8
bug:9464358
Previously, empty and unknown sized ops are assumed to fully cover
their clip. This is now corrected such that empty sized ops are
pre-rejected before defer. Additionally, unknown sized ops disable
overdraw avoidance.
Change-Id: Icf2ce24f98be5ea6299e24ffcf826790373564a1
bug:9310706
In some cases flush will occur after a layer is destroyed. Avoid
trying to draw after putting the layer in the layer cache.
Change-Id: I55d66f420e7354fe552c82eb3145a7d91b4441e3