5053 Commits

Author SHA1 Message Date
Chris Craik
5d39a77992 Fix projection offset caching - DO NOT MERGE
bug:13214038

Because the caching of projection matrix didn't account for changes in
the offset flag, the flag could be ignored. Now we use both to verify
that the cached matrix can be used.

Change-Id: I193b94eaf0b98f046a6484f0866c3d25048653fd
(cherry picked from commit d04a6b15f74035fd2068f34225825b55e94521f4)
2014-03-19 20:09:04 +00:00
Leon Scroggins III
5e49b497ae Update framework to use M33 Skia. DO NOT MERGE
(These CLs are already in master.)

Bug: 13246311

This cherry-picks 7 CLs:

-----------------------------------------------------------------------

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.

cherry-pick from: I1b36b0b0ce7126031eb7b769b563c17dcd4b306a

-----------------------------------------------------------------------

Merge AssetStream with AssetStreamAdaptor.

Add enums to the constructor for AssetStreamAdaptor to choose the
different behaviors used by the (former) two different classes.

The old clients of AssetStream now get the following features of
AssetStreamAdaptor
- Debugging statements on error.
- The stream is an SkStreamRewindable.
- getLength() returns the correct value, and the old way of getting
  the length (read(NULL, 0)) is no longer implemented, since it is
  no longer used.
- isAtEnd() returns the correct value. ToT Skia makes it pure virtual,
  so some implementation is necessary.

cherry-pick from: I2a5395914e4f53830aaefee396556459083a1c56

-----------------------------------------------------------------------

Deprecate Android-specific SkPaint functions.

The following functions were problematic:
 const SkGlyph& getUnicharMetrics(SkUnichar, const SkMatrix*);
 const SkGlyph& getGlyphMetrics(uint16_t, const SkMatrix*);
 const void* findImage(const SkGlyph&, const SkMatrix*);

Replacing them with calls through SkGlyphCache solved a nasty crash
bug, so they have all been deprecated.

Bug: 11968757
cherry-pick from: Id746315d41aec5b211b78b172a883c2061130f08

-----------------------------------------------------------------------

pass SkGlyphCache into updateGlyphCache()

Doing so prevents us from double-locking the glyph cache, thereby
effectively locking ourselves out of reusing work that we'd just done.

Bug: 11968757
cherry-pick from: I5c552f2d0bbe30af2ce9054ba684e7da756a0d89

-----------------------------------------------------------------------

Updates to the Skia API needed to merge the WebView m33 version of Skia.

cherry-pick from: I0f63b53f2aae58871413b132742fc84138f069a3

Bugfix for screenshots (recent apps) due to incorrect rowBytes computation

bug: 12915192
cherry-pick from: I4d5fe2a2f75baf66099e0970fb646686a1992714

-----------------------------------------------------------------------

Fix bug in AndroidPixelRef where we did not store the correct imageInfo for a recycled bitmap.

cherry-pick from: I882483b78886e2f19fa4e43a86e69f5a82b3b7e5

-----------------------------------------------------------------------

Change-Id: Ie2b731a9f0795802418cfecddb4b684c92c64d33
2014-03-06 12:14:47 -05:00
Romain Guy
318ae7bb92 Take SkBitmap's stride into account when uploading textures
Bug #10151807

Change-Id: I7ba4804fa3619088fea70eb55f10519fff0bf5f0
2013-09-25 22:31:31 +00:00
Chris Craik
d8a84a8609 Merge "Correct bitmap merging logic" into klp-dev 2013-09-21 00:33:36 +00:00
Chris Craik
996fe65634 Correct bitmap merging logic
bug:10863163

This fixes two issues

The check for pure translation was incorrect. It was fixed and renamed
for clarity.

Certain matrix paths weren't setting kTypePositiveScale. For
simplicity (and because positive scale is simple to check) removed
flag in favor of dynamic checking.

Change-Id: Ic5ce235653ef49a68b8b242bd89fc2e95874ecc9
2013-09-20 17:25:31 -07:00
Victoria Lease
16c84069a4 fix emoji clipping in hw draw path
I guess we don't want to overwrite the last line in every RGBA glyph
with our one-line texture atlas spacer?

Bug: 10841207
Change-Id: Ief85ca58650c731e9d21dbf90942b7b44670abcc
2013-09-19 15:38:21 -07:00
Chris Craik
ce9ee16d65 Merge "Conservatively estimate geometry bounds" into klp-dev 2013-09-18 01:50:02 +00:00
Chris Craik
a42ceb03cf Merge "Disallow negative scale matrices in merged Bitmap drawing" into klp-dev 2013-09-18 01:49:32 +00:00
Chris Craik
32f05e343c Conservatively estimate geometry bounds
bug:10761696

Avoids a case where a rect with top coordinate of (e.g.) 0.51f is
assumed to not draw in the first row of pixels, which leads to it not
being clipped. Since rounding can cause it to render in this first
pixel anyway, we very slightly expand geometry bounds.

Now, in ambiguous cases, the geometry bounds are expanded so clipping
is more likely to happen.

Change-Id: I119b7c7720de07bac1634549724ffb63935567fc
2013-09-17 17:48:14 -07:00
Chris Craik
d965bc5823 Disallow negative scale matrices in merged Bitmap drawing
bug:10622962

Change-Id: I55ac18ad56b53dc9e6e6ea14cd3ec4bdafa98ac3
2013-09-16 18:19:55 -07:00
Chris Craik
5af5fc50c2 Fix merged operation clipping
bug:10745870

Missing 'const' meant MergingDrawBatch would never clip anything.

Change-Id: Ia6367eff94cf5f437efafbc3ba7f0da102ffd956
2013-09-13 14:44:08 -07:00
Romain Guy
1de466fc91 Always disable the clip for layers
Bug #8149344

Change-Id: Ifd413cadb171232eb846b3d91b05b2d2457b9f35
2013-09-12 23:13:38 +00:00
Chris Craik
88ee0dac81 Merge "Move DeferredDisplayState out of ops" into klp-dev 2013-09-12 22:08:54 +00:00
Chris Craik
c1c5f08702 Move DeferredDisplayState out of ops
bug:9969358

Instead of storing DeferredDisplayState within an op (thus forcing ops
to be tied to a single state instance), associate each op with a new
state at DeferredDisplayList insertion time.

Now, DisplayLists (and the ops within) can be reused in a single
DeferredDisplayList draw call, as ops will use different state
instances at different points in the frame.

Change-Id: I525ab2abe0c3883679f2fa00b219b293e9ec53d9
2013-09-12 13:33:01 -07:00
Kenny Root
1c7cf90af4 Fix another off-by-one error in ZipFileRO
Bug: 10424836
Change-Id: I491458bd31ef39e87127d061427b32a3d59ac807
2013-09-11 15:28:39 -07:00
Kenny Root
0d6c2d7b9d Reconcile differences between zip implementations
Reconcile the difference between ZipFileRO and java.util.ZipFile to have
the same behavior.

Bug: 10424836
Change-Id: I6bde1bad7e20065ee650945fd43a913c05ce5ac7
2013-09-11 11:44:40 -07:00
Kenny Root
0c4b3646b0 Revert "Reconcile differences between zip implementations"
This reverts commit 9ffddc7eb50653cf60ce6b27a0e1945eed5b5ce1.

Change-Id: Ifeba63511211bfc2b375f2205e319e91403b7d06
2013-09-11 18:10:09 +00:00
Kenny Root
9ffddc7eb5 Reconcile differences between zip implementations
Reconcile the difference between ZipFileRO and java.util.ZipFile to have
the same behavior.

Bug: 10424836
Change-Id: Iff159c9e1a91b59f6c5346dc0278cb9e4bbc1a39
2013-09-11 00:29:18 +00:00
John Reck
874ae2adf8 Merge "Fix scissor for functor invocation" into klp-dev 2013-09-10 21:03:48 +00:00
Tim Murray
7a454ba5fe Fix FontRenderer bug.
bug 10691313

Change-Id: Icd5341a3c2066e337911f040ddc935c48c8d7cd1
2013-09-10 13:46:49 -07:00
John Reck
25d2f7bc1f Fix scissor for functor invocation
Bug: 10677765
 enableScissor() must precede setScissorFromClip() as
 otherwise setScissorFromClip() doesn't do anything.
 Also make sure to call setScissorFromClip() if
 enableScissor() returns true as enableScissor() calls
 resetScissor() if the scissor state has changed.

Change-Id: I9226b20bb256c92066aae344e4e6407540b6eae9
2013-09-10 20:45:29 +00:00
Tim Murray
9578e64240 Add flags word to initialization.
bug 10427951

Change-Id: I1356b9b96315ead44aa3898de5604d75f9bb8be5
2013-09-09 16:23:27 -07:00
Chris Craik
66063ae2d6 Dump the right matrix when logging display lists
bug:10631274
Change-Id: I6b32bfcb3e207321da60807091d7ac0ecf6112ab
2013-09-05 16:11:18 -07:00
Chris Craik
54f574acf4 Move functor GL setup to just before functor
bug:10399469

Because the stencil setup can issue draws, it *must* come before the
GL state setup.

Change-Id: I52a36213549fc60b091a90cbb923a1f0d35f9a65
2013-08-26 11:23:46 -07:00
Romain Guy
5d92320084 Second attempt at avoiding infinite loop in PathCache::trim()
Bug #10347089

Change-Id: I70f5a3933e848632473acc6636c88be5dc6ac430
2013-08-21 18:42:46 -07:00
Romain Guy
0a8c51b1d0 Properly account for created paths in the cache
Change-Id: I47b89b3085cefab6daac9194e7bfd3c140b37fa2
2013-08-21 17:35:38 -07:00
Romain Guy
627c6fd913 Add overdraw debugging that accounts for Deuteranomaly
Change-Id: I31f68a07aa7cf0490d2572e24e4c5ac2066a1151
2013-08-21 11:53:18 -07:00
Tim Murray
d8c8aaa82e Handle updates to C++ API.
Change-Id: I8ab17cbae3a9a4cc3c3202b8277d49f27bdf1fec
2013-08-19 12:07:52 -07:00
Romain Guy
46bfc48110 Fix hardware layers lifecycle
Bug #10075732

Hardware layers could survive across EGL terminate events.

Change-Id: Ie8565d55cb29fe6625fa1584d695edfecd37ab5e
2013-08-16 18:38:29 -07:00
Romain Guy
b0a41ed3dc Prevent ANR in apps using drawPath()
Bug #10347089

If an app clears its path cache before stopping background tasks, it could
get into an infinite loop in PathCache::trim().

Change-Id: Ieb865b762e7b00aebaba0c023769c2db286a94f5
2013-08-16 14:44:38 -07:00
Romain Guy
b746371de7 Clear FBO cache on full memory flush
Change-Id: I44e06d5d15cd899a0522c62d7c0d042170665abb
2013-08-16 13:55:29 -07:00
Victoria Lease
723b2feb92 fix kBW_Format glyphs
Oops! kBW_Format was omitted from a couple of switch statements,
resulting in glyphs in that format being invisible.

Bug: 10206452
Change-Id: Ib2aa52250aeeecc0de1b1b78e3d0f568f368c73e
2013-08-12 15:12:49 -07:00
Romain Guy
9b5a1a28c3 Take shadow bounds into account for quick rejects
Bug #8634346

Change-Id: I995c5205c2959d8e4da638ae47fedcda92eb1b36
2013-08-09 14:06:29 -07:00
Romain Guy
003123004f Remove an unnecessary allocation
Also remove dead code from OpenGLRenderer.cpp

Change-Id: I7eb54ca19e77ee3c32f1fe9513a031e6b2e115cf
(cherry picked from commit 5c7d5ab878b26f855175a3305a14ac12fcacf25e)
2013-08-09 03:52:29 +00:00
Romain Guy
7f6d6b0370 Split assets atlas batches
Bug #10185769

The assets atlas contains assets that need to be blended and assets
that do not need to be blended. With a single merge id, currently
set to be the pointer to the atlas itself, draw ops merging could
generate batches of commands containing both opaque and translucent
assets. The blend state was chosen from only one of the assets in
the batch, leading either to inefficiencies (blending large opaque
assets) or incorrect behaviors (not blending translucent assets.)

This change introduces two new merge ids in the atlas: an opaque
key and a blend key. These keys are simple booleans set to false
and true respectively (the values do not matter really.) Their
memory addresses are used as the merge ids when createing draw ops
batches, allowing all opaque ops to be batched together and all
translucent ops to be batched together.

Change-Id: I114dba0533c44987e53864b471ccb28c811f2025
2013-08-06 18:35:01 -07:00
Elliott Hughes
83ad4e393a Remove an unused C zip API.
Change-Id: I10ae849bdedf3e3bb97547c4f9e5a20742e9d6b1
2013-08-05 14:12:50 -07:00
Tim Murray
250b1cfc83 Handle updates to RS C++ API.
Change-Id: I73127fc7369643b94d4a49f31a516b50c74b54ac
2013-08-02 15:31:29 -07:00
Chris Craik
b213cec0ce Merge "Fix quickReject's handling of AA ramp geometry" 2013-08-02 20:34:38 +00:00
Chris Craik
5e49b307eb Fix quickReject's handling of AA ramp geometry
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
2013-08-02 11:29:22 -07:00
Romain Guy
b7b93e0089 Fix region clipping bugs
See external bug #58344

Change-Id: Iecd6c41fc8076cd76add2335d3442a6dd8878f12
2013-08-01 15:35:24 -07:00
Victoria Lease
f296e317fb Merge "Support RGBA fonts and bitmap fonts (and RGBA bitmap fonts)" 2013-08-01 14:40:54 +00:00
Dianne Hackborn
d45c68dd24 Resource memory optimization.
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
2013-07-31 15:57:49 -07:00
Victoria Lease
1e546815bb Support RGBA fonts and bitmap fonts (and RGBA bitmap fonts)
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
2013-07-31 15:50:47 -07:00
Romain Guy
fb6c743c6e Merge "Fix 9patches' limitation of 32 empty quads" 2013-07-24 18:54:11 +00:00
Romain Guy
6cad75744e Fix 9patches' limitation of 32 empty quads
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
2013-07-24 11:49:33 -07:00
Colin Cross
0d6e7315eb add static dependency on liblog
Change-Id: I8056aa744b37ef0c31229329a0de79c58c5955ea
2013-07-23 18:04:24 -07:00
Chris Craik
98427708a8 Merge "Ensure glActiveTexture is cleaned up correctly on functor resume" 2013-07-22 23:31:20 +00:00
Chris Craik
9ab2d18475 Ensure glActiveTexture is cleaned up correctly on functor resume
Change-Id: I103d7d63b17289d599c2c08dcc442cfba9b8e51d
2013-07-22 16:21:55 -07:00
Romain Guy
448455fe78 Use global indices array to draw layers
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
2013-07-22 14:37:21 -07:00
Chris Craik
b3d8388822 Merge "Support stencil-based clipping for functors" 2013-07-16 22:43:02 +00:00