Commit Graph

635 Commits

Author SHA1 Message Date
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
Jim Chen
11dc67a595 Bug 1415994 - 1. Don't report screen size in GeckoLayerClient; r=rbarker
We don't actually use the screen size through GeckoLayerClient anymore.
Getting rid of it lets us get rid of the Context field in
GeckoLayerClient as well.

MozReview-Commit-ID: GM1jlhAZm4T

--HG--
extra : rebase_source : 04827eb61d6304d4782a7a935d5528013255726f
2017-11-14 18:18:34 -05:00
Nick Alexander
0d056acc9a Bug 1415778 - Part 3: Fix up Gradle. r=jchen
This patch makes the :geckoview Gradle project only use
o.m.geckoview.BuildConfig, and makes the :app Gradle project use all
of the preprocessed code coming from the moz.build system.
Eventually, we'll reduce that set of preprocessed code to only
o.m.gecko.BuildConfig, which will then be produced by Gradle.

MozReview-Commit-ID: Dnkde7axyZL

--HG--
extra : rebase_source : dc0b7f9fa542cbfd9c665bfac761d45f5957f7b8
2017-11-09 09:44:40 -08:00
Nick Alexander
4d8546e06b Bug 1415778 - Part 2: Move AppConstants to o.m.geckoview.BuildConfig. r=jchen
Some of these make no sense for GeckoView, but perfect is the enemy of
the good here.

MozReview-Commit-ID: 9MwRkc61v9P

--HG--
extra : rebase_source : 8e7fa8102c615f34dbd76394fb6877188007c3c7
2017-11-08 21:14:44 -08:00
Nick Alexander
26c00638a1 Bug 1415778 - Part 1: Stop using AppConstants.Versions. r=jchen
Versions is no more efficient than checking android.os.Build, and it
actually interferes with the Android lint that checks API
compatibility.

MozReview-Commit-ID: Cl1227uHWKZ

--HG--
extra : rebase_source : 91ceba45906ad5fbb47d55c982ecbb65569a3f00
2017-11-08 20:41:57 -08:00
Nick Alexander
6f9dfe6900 Bug 1415778 - Pre: Don't use ANDROID_PACKAGE_NAME in GeckoView. r=jchen
MozReview-Commit-ID: FswHnEIBM35

--HG--
extra : rebase_source : 0dcccaab5e907dfb415a3626cc353ff7de823ea3
2017-11-08 21:15:12 -08:00
Andreea Pavel
7fb4cc447c Merge inbound to mozilla-central r=merge a=merge 2017-11-11 11:59:20 +02:00
Ryan VanderMeulen
ef843a0e30 Merge m-c to inbound. a=merge 2017-11-10 16:14:16 -05:00
Dylan Roeh
ebd39f9ce0 Bug 1337078 - Improve the use of Android API in OSPreferences r=snorp
Add BrowserLocaleManager.refreshLocales, a native function which calls OSPreferences::Refresh, and BrowserLocaleManager.getLocale, which returns the current locale string. Use these in place of observing modification of the intl.locale.os pref.
2017-11-10 09:20:04 -06:00
Makoto Kato
4fa452ee6e Bug 1416113 - Unnecessary to set LOCALE_THOUSANDS_SEP, LOCALE_DECIMAL_POINT and LOCALE_GROUPING. r=snorp
LOCALE_THOUSANDS_SEP, LOCALE_DECIMAL_POINT and LOCALE_GROUPING are only used by
old code without ICU.  Since we turn on ICU with ECMA-402 support, it is
unnecessary to set LOCALE_THOUSANDS_SEP, LOCALE_DECIMAL_POINT and
LOCALE_GROUPING in GeckoLoader.setupLocaleEnvironment.

MozReview-Commit-ID: LlGQdLlM7I2

--HG--
extra : rebase_source : 559fafd4ded9e351805fdd7b10e7aaebfc09637e
2017-11-10 13:55:56 +09:00
Margareta Eliza Balazs
7e070192d7 Merge inbound to mozilla-central r=merge a=merge 2017-11-10 11:55:43 +02:00