Commit Graph

645 Commits

Author SHA1 Message Date
Jan Henning
558586f7ec Bug 1427285 - Fix typo in build.gradle to correctly reflect crash reporter state in BuildConfig. r=JanH
MozReview-Commit-ID: DSypUp5s5O9

--HG--
extra : rebase_source : fffa4ece34bad5570586eba0d27a475019eab669
2017-12-28 17:15:05 +01:00
Jim Chen
52370a906b Bug 1425262 - 3. Follow-up to fix wrong comment; r=me
Fix comment referencing support for transformation matrix.
2017-12-20 12:14:01 -05:00
Jim Chen
7a04621843 Bug 1425262 - 2. Use new GeckoDisplay from GeckoView; r=rbarker
Use the new GeckoDisplay class and acquireDisplay/releaseDisplay calls
from GeckoView.

MozReview-Commit-ID: 7Y9VYrZCdvQ

--HG--
extra : rebase_source : 8cb4144d49d74846613feacb7e1be9772b3c62c0
2017-12-19 17:17:38 -05:00
Jim Chen
320c4d7d7b Bug 1425262 - 1. Implement GeckoDisplay as a class managed by GeckoSession; r=rbarker
Implement GeckoDisplay as a class managed by GeckoSession and used by
GeckoSession clients. Also add `acquireDisplay` and `releaseDisplay`
methods to manage the GeckoDisplay instance.

MozReview-Commit-ID: 6yTdXmx4yIO

--HG--
extra : rebase_source : 05c6a80ada847e7effa1cf938476e999439ff3d0
2017-12-19 17:17:37 -05:00
Jim Chen
8a3fd41d0a Bug 1425553 - Only process input calls when Gecko is ready; r=esawin
Track the Gecko ready state in TextInputController through
GeckoSession's NativeQueue, and only pass through input calls when Gecko
is ready.

MozReview-Commit-ID: KugQ6whg2QA

--HG--
extra : rebase_source : 6ea266d9746d22c58cdd21c7122fa7f20ec730fc
2017-12-19 17:02:46 -05:00
Jim Chen
af3a18ee62 Bug 1416918 - 4b. Move GeckoEditable{Client,Listener} to TextInputController; r=esawin
Move GeckoEditableClient and GeckoEditableListener to inside
TextInputController, next to TextInputController.Delegate. This
consolidates the three internal interfaces used for IME in one place.

The patch also changes the last notifyIMEContext parameter to an int
flag to indicate private browsing or user action. This allows for future
expansion without adding more parameters to notifyIMEContext.

MozReview-Commit-ID: BjscdNr9TkO

--HG--
extra : rebase_source : 87166a55e5978eda4a7c3065db9b68658e33af35
2017-12-13 22:57:21 -05:00
Jim Chen
9db87f4a1c Bug 1416918 - 4. Remove unused code; r=esawin
Remove InputConnectionListener, which was replaced by
TextInputController.Delegate, and remove IME_STATE_PLUGIN, which is not
used anymore.

MozReview-Commit-ID: GCbJXWNCmTk

--HG--
extra : rebase_source : c90bc79585ce4c5b9c0de5e07b0ea52531b65e04
2017-12-13 22:57:21 -05:00
Jim Chen
96ffac273d Bug 1416918 - 3. Use TextInputController in GeckoView; r=esawin
Use the new TextInputController API in GeckoView to process key events
and input method interactions.

MozReview-Commit-ID: H0oyCDkGHul

--HG--
extra : rebase_source : a0ab70e77aa05b7d3aa05982c47299a0222f3ee5
2017-12-13 22:57:21 -05:00
Jim Chen
9ba6dc8991 Bug 1416918 - 2. Make GeckoEditable/GeckoInputConnection work with TextInputController; r=esawin
Let GeckoEditable be created and managed by TextInputController, instead
of being managed by native code. Let GeckoInputConnection also be
managed by TextInputController, instead of being managed by
GeckoEditable. Getting rid of native calls in GeckoEditable makes it
easier to separate native code into a separate process down the road.

MozReview-Commit-ID: HQI3qcAzOvT

--HG--
extra : rebase_source : 83ad25bab663b6652cfeecdf10bbf8e0b28dadfa
2017-12-13 22:57:21 -05:00
Jim Chen
6075204d7c Bug 1416918 - 1. Add TextInputController; r=esawin
Add TextInputController and add a getter for it in GeckoSession.
TextInputController is used to process key events and to interact with
the input method manager.

MozReview-Commit-ID: 1j2Moqukf8U

--HG--
extra : rebase_source : 03fee51ba3e2034b8689c4fa6fe58f7432dc1ad4
2017-12-13 22:57:21 -05:00
James Cheng
3f9db6bda9 Bug 1424168 - Reduce the Exoplayer buffer size to avoid OOM. r=kikuo
MozReview-Commit-ID: J1pi3S9Hxa7

--HG--
extra : rebase_source : c7e134b66fcb45feb4f38b1a2d99c6201ea3d69e
2017-12-08 16:46:42 +08:00
James Cheng
d04758259c Bug 1423518 - Add Samsung Galaxy S4 Mini GT-I9195 into blacklist. r=jolin
MozReview-Commit-ID: LYqXif8kMmm

--HG--
extra : rebase_source : 6bd80e121c0d96a4b6092740d2f3434b5a7eba19
2017-12-06 18:02:00 +08:00
Jim Chen
2119c96737 Bug 1423010 - 3. Clean up o.m.g.gfx package; r=rbarker
Remove unused classes and make classes that are not used outside of the
package package-private.

MozReview-Commit-ID: 9FxcL5QsM1Q

--HG--
extra : rebase_source : d9ed39d06a0e2aadec131d06c92cb11ef342a320
2017-12-05 11:40:10 -05:00
Jim Chen
93f25f7335 Bug 1423010 - 2. Fix other code that use BitmapUtils; r=rbarker
Use o.m.g.util.BitmapUtils in code that use BitmapUtils.

MozReview-Commit-ID: KPM05Aqf1kW

--HG--
extra : rebase_source : ea910333fc195b329ef41bf168d0299584e63d20
2017-12-05 11:40:10 -05:00
Jim Chen
dadd929ff8 Bug 1423010 - 1. Move BitmapUtils to util package; r=rbarker
I think BitmapUtils is better suited for the o.m.g.util package instead
of o.m.g.gfx, since none of the other classes in gfx actually use
BitmapUtils.

MozReview-Commit-ID: IEwSIb5h9Y7

--HG--
rename : mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/BitmapUtils.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/BitmapUtils.java
extra : rebase_source : 3960fbd5172b745b3a41d1da8e855a2a539ed906
2017-12-05 11:40:10 -05:00
Jim Chen
d9c1816b68 Bug 1416330 - 5. Remove LayerView; r=rbarker
Remove LayerView now that it's no longer used. FullScreenState is
obsolete as well and is removed.

MozReview-Commit-ID: Jt7OMAoarOJ

--HG--
extra : rebase_source : da9285999fe093c41ea6d7693cf9255c0db1d688
2017-12-04 11:50:20 -05:00
Jim Chen
203776418e Bug 1416330 - 3. Update Fennec code to not use LayerView; r=rbarker
Use GeckoSession/LayerSession or GeckoView in Fennec code instead of
using LayerView.

MozReview-Commit-ID: Iod7XsqKy1e

--HG--
extra : rebase_source : 5917540422698f5526ca373f17c4358a712cdcef
2017-12-04 11:50:20 -05:00
Jim Chen
5477ffbc19 Bug 1416330 - 2. Stop using LayerView in GeckoView; r=rbarker
Implement the setSurfaceBackgroundColor functionality in a new
coverUntilFirstPaint method. Because we no longer rely on any LayerView
functionality, GeckoView now inherits directly from FrameLayout.

MozReview-Commit-ID: 3xgWsgk64GM

--HG--
extra : rebase_source : 1185e40456ffce6c40676230e6f921dd0f3cbc3e
2017-12-04 11:50:20 -05:00
Jim Chen
6ad1d8bbfb Bug 1416330 - 1. Add CompositorController; r=rbarker
Add CompositorController and LayerSession.getCompositorController for
accessing miscellaneous compositor-related methods such as adding draw
callbacks and getting pixels.

A simple Runnable is used for draw callbacks instead of using the
DrawListener interface from LayerView. A first-paint callback is added
to implement the "clear surface background on first paint" requirement
when switching between documents in Fennec.

MozReview-Commit-ID: 8pE1B5HYe2w

--HG--
extra : rebase_source : abd35b189d04073c203b542fb9f9ef763027e117
2017-12-04 11:50:20 -05:00
Jamie Nicol
834586be68 Bug 1421586 - Limit maximum number of SurfaceTextures in existence. r=snorp
Limit the number of SurfaceTextures to ensure that we do not reach the
process's fd limit. 200 was chosen as the limit because it allows for
more tiles than any reasonable page should require, yet should not
come close to the 1024 fd limit, even with 2 fds (buffer and sync
fence) per SurfaceTexture.

MozReview-Commit-ID: F21H1Rj4FVF

--HG--
extra : rebase_source : 379b460c8067cc3c5aa11a47cc66f865bae1ac64
2017-11-29 16:08:12 +00:00
Kilik Kuo
b5261ea942 Bug 1365505 - [P2][Fennec] Only include exoplayer & HLSDecoder related components when building --with-gradle. r=maliu
MozReview-Commit-ID: 7Y0bZynN66i

--HG--
extra : rebase_source : 6730f4e09c559074387b3fcf9dd2fb038628d448
2017-11-30 17:53:00 +08:00
Jim Chen
675847149d Bug 1416316 - 4. Update comments and bindings; r=jchen
MozReview-Commit-ID: 9CBe7Iej1D8

--HG--
extra : rebase_source : 0db28213833915747d9b34fe58458348a33458ad
2017-11-30 13:25:51 -05:00
Jim Chen
84ca8a1479 Bug 1416316 - 3. Update NPZC usages; r=rbarker
Remove NPZC references from LayerView, and add an NPZC getter in
LayerSession. Use the new APIs in GeckoView to forward events to NPZC.

MozReview-Commit-ID: 1UcJkpW0XuM

--HG--
extra : rebase_source : 6f50d1ca9398a2549678cc4e0fbb2578d284f63a
2017-11-30 13:25:50 -05:00
Jim Chen
bd61ff7f2f Bug 1416316 - 2. Clean up NativePanZoomController; r=rbarker
Clean up the NativePanZoomController object including,

1) Remove references to LayerView because NPZC will be created and used
by LayerSession.

2) Rename `mDestroyed` to `mAttached` because NPZC now needs to support
cases where it's used before being attached, in addition to after being
destroyed.

3) Move origin of synthesized event coordinates from the screen to the
surface in native code, so we don't need to do the same thing in Java.

4) Invoke all callbacks from native code on the UI thread.

MozReview-Commit-ID: Fu4XIY59yKw

--HG--
extra : rebase_source : cb4d432cb940cfa92f3c0a931f1f2d2991932462
2017-11-30 13:25:50 -05:00
Jim Chen
c8f7a24671 Bug 1416316 - 1. Move overscroll to LayerSession; r=rbarker
There is some overscroll handling code in NativePanZoomController that
should be moved, along with other overscroll code in LayerView, to
LayerSession. LayerSession now provides a getter for
OverscrollEdgeEffect, which is cleaned up to have a public API with
documentation.

MozReview-Commit-ID: LkKHFS8OkR7

--HG--
extra : rebase_source : dc6b680b1cc7d7e2dd221091a63a208971d63c80
2017-11-30 13:25:50 -05:00
Andrew Gaul
ea51a3fcd3 Bug 1419268: Make some static fields final r=nalexander
This allows compile-time initialization instead of runtime in clinit.
2017-11-20 21:01:10 -08:00
James Cheng
c1c5121e36 Bug 1419677 - Fix typo to make BuildConfig.DEBUG_BUILD work properly. r=nalexander
MozReview-Commit-ID: ITszwTqsSqk

--HG--
extra : rebase_source : 7ba31f01cabb962a8e97c75ef2f02e2684d90ac0
2017-11-23 11:12:38 +08:00
James Cheng
75bf8e9453 Bug 1419249 - Fix the wrong logic calculating starttime of the first sample. r=kikuo
MozReview-Commit-ID: 3je7idVeYoZ

--HG--
extra : rebase_source : ecd1a43d6a98e0f0cf5fd53c5b3f0d830d985fc4
2017-11-22 17:47:03 +08:00
James Cheng
89998341ee Bug 1418766 - Fix Crash in java.lang.OutOfMemoryError by making Exoplayer pause by default. r=kikuo
MozReview-Commit-ID: JGIRcYLXtdv

--HG--
extra : rebase_source : f83c395358c46458d40729176b5f5a3cc463009d
2017-11-21 17:21:19 +08:00
shindli
a0b20fcb81 Merge mozilla-central to mozilla-autoland. r=merge a=merge CLOSED TREE 2017-11-22 23:42:02 +02:00
James Willcox
d6ec9137a6 Bug 1416015 - Fix checkstyle failure r=me
MozReview-Commit-ID: I9KkGiP8fUm
2017-11-21 13:58:56 -06:00
James Willcox
436c2828a9 Bug 1416015 - Ensure SurfaceTexture desctruction happens correctly r=jnicol
MozReview-Commit-ID: I4X1jQQC7ry
2017-11-21 12:43:31 -06:00
Jim Chen
82c5935b9b Bug 1416319 - 8. Switch to using LayerSession coordinates APIs; r=rbarker
Use the LayerSession coordinates APIs instead of manually calculating
coordinates using viewport metrics and toolbar height, which is prone to
error.

MozReview-Commit-ID: 4ebI3BHEOXR

--HG--
extra : rebase_source : 264f03f3032f101687c2a39d1cf052ac1805f12b
2017-11-22 14:12:23 -05:00
Jim Chen
0c82587e52 Bug 1416319 - 7. Don't expose viewport metrics from LayerSession; r=rbarker
Provide a set of coordinates APIs in LayerSession instead of exposing
the raw viewport metrics, which are hard to use. This also lets us
remove ImmutableViewportMetrics completely.

The new APIs provide rectangular bounds in client or surface
coordinates, and matrices to transform those coordinates to screen
coordinates. This is done because the transformation to screen
coordinates could (in the future) involve skew, rotation, etc, so it's
up to the application to decide how to handle non-rectangular screen
bounds.

MozReview-Commit-ID: 8Yw8L63TmrQ

--HG--
extra : rebase_source : 76954d32da9fb8435ec68ea53b6dc618f8cb0121
2017-11-22 14:12:23 -05:00
Jim Chen
e1e55d7285 Bug 1416319 - 6. Remove DynamicToolbarAnimator from LayerView; r=rbarker
Remove all DynamicToolbarAnimator-related code from LayerView now that
they are in LayerSession.

MozReview-Commit-ID: 56AO79T3NoK

--HG--
extra : rebase_source : 7685806436d43dc203cc034dd5105eb1f9c80a94
2017-11-22 14:12:23 -05:00
Jim Chen
dc678eed57 Bug 1416319 - 5. Update DynamicToolbarAnimator usage in other classes; r=rbarker
Use DynamicToolbarAnimator through the session in places where we need
to interact with the toolbar or get the current toolbar height.

MozReview-Commit-ID: PdGX4FEHp5

--HG--
extra : rebase_source : 825fc70b584eb4b75f0ce9bd21a36c68f700c8c2
2017-11-22 14:12:22 -05:00
Jim Chen
5686bed431 Bug 1416319 - 4. Store DynamicToolbarAnimator in LayerSession; r=rbarker
Add getter/setter for DynamicToolbarAnimator in LayerSession in lieu of
LayerView. It is then LayerSession's responsibility to keep track of how
changes in the toolbar affects other things like the window and viewport
bounds.

MozReview-Commit-ID: HmRqxZ7EUCZ

--HG--
extra : rebase_source : 80648a17ed10672400daa4bcce0de49f4ee76557
2017-11-22 14:12:22 -05:00
Jim Chen
e5bc1dc324 Bug 1416319 - 3. Clean up DynamicToolbarAnimator API; r=rbarker
The plan is to incorporate DynamicToolbarAnimator into the official
GeckoView API and expose getter/setter in LayerSession. This patch
cleans up the class to make sure only public APIs are public, and to
assert they are called on the UI thread.

MozReview-Commit-ID: D3ePV3k2HvX

--HG--
extra : rebase_source : b1925ff484b5661f3a02f66079d4834961efffbe
2017-11-22 14:12:22 -05:00
Jim Chen
b21cdffaf4 Bug 1416319 - 1. Move content-document-is-displayed flag to native code; r=rbarker
One fix I forgot to make in bug 1416310 is to change the code to reset
the flag in LayerView. I think it's better if we just moved the whole
thing to native code, since we don't really use the flag in Java.

MozReview-Commit-ID: 9cbcYb89LhC

--HG--
extra : rebase_source : a209669d6657a60c198f59f4a0e4d959478485c3
2017-11-22 14:12:22 -05:00
Jim Chen
676e0a6e5c Bug 1416310 - 5. Remove GeckoLayerClient.java and update generated bindings; r=jchen
Remove GeckoLayerClient.java since it's no longer used, and update
auto-generated JNI bindings. r=me for trivial patch.

MozReview-Commit-ID: CiNPLLkh3VJ

--HG--
extra : rebase_source : 0cddae4f8914dd6f6a0631a7e69701828476f2b8
2017-11-20 17:17:02 -05:00
Jim Chen
85057e2e9a Bug 1416310 - 3. Merge GeckoLayerClient into other classes; r=rbarker
Move the GeckoLayerClient JNI callbacks to LayerSession.Compositor. Move
the rest of the viewport code to LayerView. Finally, move the input
event synthesis code to NativePanZoomController.

MozReview-Commit-ID: 1FEAM43KcwL

--HG--
extra : rebase_source : af2ded170a79f13afbb1f690ae466e77c7145ff6
2017-11-20 17:17:02 -05:00
Jim Chen
75a417ee33 Bug 1416310 - 2. Use per-GeckoView event to handle scroll-to-focused-input; r=rbarker
Instead of sending an event through the global EventDispatcher in
GeckoLayerClient, switch to using the per-GeckoView EventDispatcher in
GeckoInputConnection, to handle scroll-to-focused-input-on-resize. This
lets us implement the same functionality for standalone GeckoView.

The patch also fixes some small bugs including unregistering
not-registered events, not scrolling when switching input focus, and
inadvertent scrolling when not showing the keyboard.

MozReview-Commit-ID: 20OZP9dMXtI

--HG--
extra : rebase_source : d9dee0fd8b3d01147b8b2eda5154c380d0f167dd
2017-11-20 17:17:01 -05:00
Jim Chen
bbe7b4e34c Bug 1416310 - 1. Remove getMatrixForLayerRectToViewRect; r=rbarker
Patch gets rid of `LayerView.getMatrixForLayerRectToViewRect`, and just
uses `LayerView.getZoomFactor` directly when calculating the matrix in
GeckoInputConnection. This also lets us avoid the `isCompositorReady`
call on a non-UI thread. To get the correct offset, we need the screen
bounds from Gecko, so it's passed to Java as the first element in the
rect array. Using bounds from Gecko lets us avoid having to deal with
things like the dynamic toolbar animator ourselves.

MozReview-Commit-ID: 6I61SZGyQyO

--HG--
extra : rebase_source : d576fb7ef9a42de10b14db662e5c4833f16f6312
2017-11-20 17:17:00 -05:00
Jim Chen
30cc0165d5 Bug 1417490 - Avoid crash in getMatrixForLayerRectToViewRect; r=me
Avoid crash in `GeckoLayerClient.getMatrixForLayerRectToViewRect` by not
calling `isCompositorReady`. If the compositor is really not ready, we will
return inaccurate data, but that's acceptable. r=me for trivial patch.

MozReview-Commit-ID: HobHchWYQ5D
2017-11-15 15:08:27 -05:00
Jim Chen
c9c8f7024a Bug 1415994 - 7. Migrate existing gfx code to use LayerSession; r=snorp
Remove most of the Compositor and Surface management code in LayerView.
And use LayerSession.Compositor in rest of the gfx code.

MozReview-Commit-ID: 5E9pj3eGHlv

--HG--
extra : rebase_source : 0b0a64113db58aaf376c98d5480f5cf31174a3d3
2017-11-14 18:18:35 -05:00
Jim Chen
db59a90277 Bug 1415994 - 6b. Track GeckoDisplay origin changes; r=snorp
Add a `screenOriginChanged` callback to GeckoDisplay.Listener, which
informs Gecko of changes in the origin of the display. The origin
translates to coordinates for web APIs like screenX/screenY and certain
other calculations.

Also, make GeckoDisplay listen to layout changes in the view tree (by
overriding gatherTransparentRegion as an optimization), and call
`screenOriginChanged` accordingly.

MozReview-Commit-ID: C72EHCkbV3T

--HG--
extra : rebase_source : 240c5c8fb3c2938ae966f40e86f7c5a0ca66526c
2017-11-14 18:18:35 -05:00
Jim Chen
eb9152fe63 Bug 1415994 - 6. Implement GeckoDisplay in GeckoView; r=snorp
Make GeckoView implement GeckoDisplay for its own SurfaceView, and use
that with GeckoSession.

MozReview-Commit-ID: LXllQGlCxaB

--HG--
extra : rebase_source : 1b41e411b2c293797d572d584c4f2b7036e83b23
2017-11-14 18:18:35 -05:00
Jim Chen
ff6c25061a Bug 1415994 - 5. Use LayerSession from GeckoSession; r=snorp
Make GeckoSession inherit from LayerSession, and connect its Compositor
to native code as part of the GeckoSession routine.

MozReview-Commit-ID: wQaH1A0a7z

--HG--
extra : rebase_source : ee4ae96e974d15c8cb9ad569ea9abf0ace4d0fa5
2017-11-14 18:18:35 -05:00
Jim Chen
3ef19c1765 Bug 1415994 - 3. Add LayerSession; r=snorp
Add a LayerSession class that's split off LayerView. Currently,
LayerSession takes over Surface management and the Compositor class from
LayerView. Eventually, all of LayerView will migrate to LayerSession.

MozReview-Commit-ID: F1ozOfZGY2g

--HG--
extra : rebase_source : eaf42122db1238c99b0da1e689bc365180a2835f
2017-11-14 18:18:34 -05:00
Jim Chen
915defe322 Bug 1415994 - 2. Introduce GeckoDisplay; r=snorp
Introduce a GeckoDisplay interface for interaction with GeckoSession.

MozReview-Commit-ID: 13prgWaPqKU

--HG--
extra : rebase_source : 282b27a1f7c11cf4e559b1f25946c3f4574e900a
2017-11-14 18:18:34 -05:00