Commit Graph

8984 Commits

Author SHA1 Message Date
TreeHugger Robot
16c9e8bac7 Merge "Visualize view focus in debug mode." 2016-10-13 20:28:57 +00:00
Vladislav Kaznacheev
1ed3c63bb8 Merge "Avoid sending incorrect or redundant hover events." 2016-10-13 18:29:20 +00:00
TreeHugger Robot
3bc72e5549 Merge "Fix import statement in view|transition|animation packages." 2016-10-12 21:31:56 +00:00
Aurimas Liutikas
67e2ae8639 Fix import statement in view|transition|animation packages.
This change also remove trailing whitespace.

Test: code still compiles
Change-Id: I7eff4546320d67d2bae58d31bad0625ea0791b8f
2016-10-12 09:09:52 -07:00
Vadim Tryshev
cdf38ba2c8 Visualize view focus in debug mode.
See the bug for motivation.

Bug: 32099818
Test: Manual check with enabling the dev setting.
Change-Id: I77262f77ac709639e5b1314a0be45612bde70ad6
2016-10-11 18:36:49 -07:00
Romain Guy
253f2c213f 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
2016-10-11 17:47:58 -07:00
Vladislav Kaznacheev
5a77c37488 Avoid sending incorrect or redundant hover events.
Make sure ACTION_HOVER_EXIT is never sent to a
ViewGroup more than once.

While processing ACTION_HOVER_MOVE during exiting
a hover target never send it a ACTION_HOVER_ENTER.

Test: android.view.cts.HoverTest
Bug: 32071138
Bug: 32071098
Change-Id: Ibc1809137907176437a3a5a4ea14b00f1c629b58
2016-10-10 16:11:15 -07:00
John Reck
5cb74bca88 Canvas fastjni -> @FastNative
Just the basic cleanup first, will follow-up with a more
comprehensive update later
Test: builds & boots, refactor no behavior change

Change-Id: Ie3a7144b5fefdfda085e2ab50da8b0e627a1ecb8
2016-10-10 08:19:15 -07:00
Phil Weaver
6e91196404 Merge "Move a11y event dispatch back to ui thread." 2016-10-05 21:13:48 +00:00
TreeHugger Robot
838277059f Merge "More fixes in drag/drop docs." 2016-10-05 20:11:11 +00:00
Phil Weaver
65097bf83f Move a11y event dispatch back to ui thread.
Test: Ran CTS

Bug: 31753900
Change-Id: I0ba096cb99dd8347a7e9d6c41ff0aa8293dc5d15
2016-10-05 11:08:20 -07:00
John Reck
f6f26015f2 Merge "DisplayEventReceiver -> @FastNative" 2016-10-04 15:57:42 +00:00
John Reck
e46af37e3e DisplayEventReceiver -> @FastNative
Test: make && boot
Change-Id: Id75648a2398a13c5af24eabc217bdef778618872
2016-10-03 16:21:30 -07:00
John Reck
0970997326 Update MotionEvent JNI
Switch to @CriticalNative & @FastNative
Test: make & boot

Change-Id: I8962663348b354d30995b397619ee101e405e57c
2016-10-03 15:47:18 -07:00
TreeHugger Robot
c097209f91 Merge "Making old apps passing null ClipData to startDrag work again." 2016-10-03 17:51:58 +00:00
TreeHugger Robot
d67b4f53d5 Merge "Some fixes in ClipData and ClipDescription delivery." 2016-10-01 00:32:20 +00:00
Vadim Tryshev
697331784b Making old apps passing null ClipData to startDrag work again.
This is for compatibility; see the bug.

Bug: 31865195
Test: manually rant an old app
Change-Id: If2f55ffd424b31f18610b96dd30bca87408e3df0
2016-09-30 17:25:30 -07:00
John Reck
15473e00ae SurfaceView only call forceDisconnect if isValid am: 6ba466ff3e am: 5a0da698a7
am: 88123c4ef4

Change-Id: I612a1aafbb9deace211845d93c20f8edaf0746e4
2016-10-01 00:23:16 +00:00
Vadim Tryshev
ad57431f49 More fixes in drag/drop docs.
Bug: 31702571
Test: Built docs, inspected in Chrome.
Change-Id: Ib7c421a6eacac5e352bbba64eedb9f8b689cbe60
2016-09-30 16:47:07 -07:00
John Reck
88123c4ef4 SurfaceView only call forceDisconnect if isValid am: 6ba466ff3e
am: 5a0da698a7

Change-Id: I356848f7edb11304d9ab4584dab8e5895ff49762
2016-09-30 23:23:17 +00:00
John Reck
5a0da698a7 SurfaceView only call forceDisconnect if isValid
am: 6ba466ff3e

Change-Id: I890142436b2442cced212550ac916bedf1306bc9
2016-09-30 23:15:04 +00:00
Vadim Tryshev
a61efa4c33 Some fixes in ClipData and ClipDescription delivery.
See the bug.

Bug: 31809803
Test: Ran Drag/Drop CTS
Change-Id: Ie48a172bc465cd33e176801865e54e8aded4ce55
2016-09-30 15:36:35 -07:00
John Reck
6ba466ff3e SurfaceView only call forceDisconnect if isValid
Change-Id: I683c2f937f44d8b3d912839a3e91cbd5b5c7f437
Fixes: 31778946
Test: Manual, launch Cookie Jam then tap recents
2016-09-30 21:33:34 +00:00
Kevin Hufnagle
7f3010a6cd docs: Clarified definition of KeyEvent.Callback.onKeyMultiple() am: b248b1f689 am: f3f234ff36
am: 88af737268

Change-Id: I1e6173b6f50aa8e981c8979349e428d02c4d133a
2016-09-27 02:02:57 +00:00
Kevin Hufnagle
73bc7dbed2 docs: Clarified definition of KeyEvent.Callback.onKeyMultiple() am: b248b1f689 am: fcd4541b06
am: 8aff16acb7

Change-Id: I81108107b9d9f0cb3e1a58201ebb094552d5e2fd
2016-09-27 00:00:29 +00:00
Kevin Hufnagle
8aff16acb7 docs: Clarified definition of KeyEvent.Callback.onKeyMultiple() am: b248b1f689
am: fcd4541b06

Change-Id: If0e9042f0df23403a128e45ca61258930b7db982
2016-09-26 23:47:09 +00:00
Kevin Hufnagle
88af737268 docs: Clarified definition of KeyEvent.Callback.onKeyMultiple() am: b248b1f689
am: f3f234ff36

Change-Id: I2c86132a817e6629435baaaa5a525ea828b6848d
2016-09-26 23:45:05 +00:00
Kevin Hufnagle
fcd4541b06 docs: Clarified definition of KeyEvent.Callback.onKeyMultiple()
am: b248b1f689

Change-Id: Ie7380c80fc81b65a89337c7c126abc1dfe58a76e
2016-09-26 23:12:46 +00:00
Kevin Hufnagle
f3f234ff36 docs: Clarified definition of KeyEvent.Callback.onKeyMultiple()
am: b248b1f689

Change-Id: I9f1c7377e09fc6a7831ab3e49784c21c4a3cf873
2016-09-26 23:10:26 +00:00
TreeHugger Robot
d2ecfc8744 Merge "Remove unused private flags from View" 2016-09-26 15:41:19 +00:00
Kirill Grouchnikov
4b1983a379 Merge "Mark a hidden MotionEvent method to be visible for tests" 2016-09-26 13:07:14 +00:00
Vadim Tryshev
4a30e888da Update/correct Drag and Drop docs. am: c5109b3f6e am: db56a09d00
am: 066004d674

Change-Id: I01c06cb3a25bc4ef05675b56b45513b2d516d7cc
2016-09-26 09:15:58 +00:00
Mark Lu
12e182a99e docs: update javadoc description for View.setVisibility() method am: ae0459f532 am: 56be5c1ae0
am: 41f36a5264

Change-Id: I107738e4c4322c8189aa84a94c3fca12c6980323
2016-09-26 09:05:12 +00:00
Gopal Krishna Shukla
42a99377f5 Merge "Provide synchronization to setview to avoid NPE" am: b05b93a674 am: 810c31fdca am: 621e87d72f
am: 260af96306

Change-Id: I1907b2252ae2fa25667b3a0484f6852660c74da3
2016-09-25 21:25:39 +00:00
Robert Carr
603ed538e0 SurfaceView: Force surface disconnection before reuse. am: 387838be95 am: 288ce4fc42
am: cfaae3f795

Change-Id: I2c19bd545719e9eb1589ec4065ba26ae65ca03c1
2016-09-24 01:57:54 +00:00
Vadim Tryshev
066004d674 Update/correct Drag and Drop docs. am: c5109b3f6e
am: db56a09d00

Change-Id: Ibe139c05c7084142f6d8923b3f1fca3c8aa9c29c
2016-09-23 23:39:56 +00:00
Vadim Tryshev
db56a09d00 Update/correct Drag and Drop docs.
am: c5109b3f6e

Change-Id: I6b64deb63cfdf6a2afac41cb819fb163b76f8849
2016-09-23 23:33:42 +00:00
TreeHugger Robot
1bc452b5a5 Merge "Update/correct Drag and Drop docs." into nyc-mr1-dev 2016-09-23 23:23:22 +00:00
Mark Lu
cd980ffb7d docs: update javadoc description for View.setVisibility() method am: ae0459f532 am: 66192078c5
am: 357dfd039a

Change-Id: I4d8ec3cb3e31e17e2f5787fb940f96e5768deb72
2016-09-23 22:38:46 +00:00
Mark Lu
357dfd039a docs: update javadoc description for View.setVisibility() method am: ae0459f532
am: 66192078c5

Change-Id: I7f3775c5fd9e63252cea9fafb8ed4b79c95bfcba
2016-09-23 22:28:41 +00:00
Mark Lu
41f36a5264 docs: update javadoc description for View.setVisibility() method am: ae0459f532
am: 56be5c1ae0

Change-Id: I32ad4a0b53c1e1fbbfd287a4aa915e169038218f
2016-09-23 22:27:37 +00:00
Mark Lu
66192078c5 docs: update javadoc description for View.setVisibility() method
am: ae0459f532

Change-Id: Ie217e46288a11e86b2e5b6e56d8ce5cb2a214861
2016-09-23 22:19:47 +00:00
Mark Lu
56be5c1ae0 docs: update javadoc description for View.setVisibility() method
am: ae0459f532

Change-Id: I3c9d70fc6fc2b6770076454cdfbb1ed1b619dfb9
2016-09-23 22:18:35 +00:00
Vadim Tryshev
c5109b3f6e Update/correct Drag and Drop docs.
This CL reflects the N MR1 behavior and
fixes some bugs.

Defining the compatibility behavior will be
done separately.

Bug: 31702571
Change-Id: I2a79871f47849f9f5a9c3377a3061208488e6ecb
2016-09-23 11:47:09 -07:00
Vladislav Kaznacheev
5a32c4c0b6 Remove unused private flags from View
Change-Id: I738ce4a814b6e2ca237bc353a1d1b6222643198f
2016-09-23 10:20:28 -07:00
Gopal Krishna Shukla
260af96306 Merge "Provide synchronization to setview to avoid NPE" am: b05b93a674 am: 810c31fdca
am: 621e87d72f

Change-Id: Ib5b7470db042d60593d2e545c901240a456dcada
2016-09-23 13:14:51 +00:00
Gopal Krishna Shukla
621e87d72f Merge "Provide synchronization to setview to avoid NPE" am: b05b93a674
am: 810c31fdca

Change-Id: Ibd664e4836eaceef8a4d8363793667afa757387a
2016-09-23 13:11:23 +00:00
Robert Carr
cfaae3f795 SurfaceView: Force surface disconnection before reuse. am: 387838be95
am: 288ce4fc42

Change-Id: Ied020f66caa429249b9f0d8baf0978f0ece9362e
2016-09-23 00:09:19 +00:00
Robert Carr
288ce4fc42 SurfaceView: Force surface disconnection before reuse.
am: 387838be95

Change-Id: Ied6c33fac75612ed2cdeb45b24c521bbff979afa
2016-09-22 23:17:05 +00:00
TreeHugger Robot
9d88f86190 Merge "SurfaceView: Force surface disconnection before reuse." into nyc-mr1-dev 2016-09-22 22:52:16 +00:00