Closed
Bug 1227608
Opened 9 years ago
Closed 9 years ago
Define layer client interface between gfx and Android widget
Categories
(Core Graveyard :: Widget: Android, defect)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: jchen, Assigned: jchen)
References
Details
Attachments
(4 files)
(deleted),
patch
|
snorp
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
snorp
:
review-
|
Details | Diff | Splinter Review |
(deleted),
patch
|
snorp
:
review-
|
Details | Diff | Splinter Review |
(deleted),
patch
|
snorp
:
review-
|
Details | Diff | Splinter Review |
Right now, gfx code uses AndroidBridge directly to access the widget/Java layer code, but we need a solution that works with individual widgets.
Assignee | ||
Updated•9 years ago
|
Summary: Define interface between code in gfx and code in widget → Define layer client interface between gfx and Android widget
Assignee | ||
Comment 1•9 years ago
|
||
To make code simpler on the C++ side, this patch adds a CreateEGLSurface
call in GeckoLayerClient, so that the C++ side only has to deal with
managing GeckoLayerClient.
Attachment #8692023 -
Flags: review?(snorp)
Assignee | ||
Comment 2•9 years ago
|
||
mozilla::widget::ILayerClient will be the interface that C++ gfx code
uses to interact with Java gfx code, through an intermediary in
LayerClientBridge. Using a standalone interface lets us support multiple
windows, whereas the existing approach using AndroidBridge calls does
not support multiple windows.
Attachment #8692024 -
Flags: review?(snorp)
Assignee | ||
Comment 3•9 years ago
|
||
Switch existing graphics code from using AndroidBridge calls to using
ILayerClient calls, using an instance obtained from nsIWidget.
Because this is an Android-specific interface, I didn't want to add a
getter to nsIWidget itself. Also, this interface is used on the
compositor thread, so the implementation has to be thread-safe, which
means we cannot just have nsWindow implement the interface. Due to these
reasons, this patch uses nsIWidget::GetNativeData as the means to get
the interface from widget.
Attachment #8692031 -
Flags: review?(snorp)
Assignee | ||
Comment 4•9 years ago
|
||
Remove the AndroiBridge calls made obsolete by the new ILayerClient
interface.
Attachment #8692032 -
Flags: review?(snorp)
Comment 5•9 years ago
|
||
Comment on attachment 8692031 [details] [diff] [review]
Use ILayerClient instead of AndroidBridge (v1)
Review of attachment 8692031 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/layers/composite/AsyncCompositionManager.cpp
@@ +1388,5 @@
> +{
> + Compositor* const compositor = mLayerManager->GetCompositor();
> + MOZ_ASSERT(compositor);
> +
> + nsIWidget* const widget = compositor->GetWidget();
Note that this gets run on the compositor thread so you should probably use a RefPtr for holding the widget at least.
Assignee | ||
Comment 6•9 years ago
|
||
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #5)
> Comment on attachment 8692031 [details] [diff] [review]
> Use ILayerClient instead of AndroidBridge (v1)
>
> Review of attachment 8692031 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: gfx/layers/composite/AsyncCompositionManager.cpp
> @@ +1388,5 @@
> > +{
> > + Compositor* const compositor = mLayerManager->GetCompositor();
> > + MOZ_ASSERT(compositor);
> > +
> > + nsIWidget* const widget = compositor->GetWidget();
>
> Note that this gets run on the compositor thread so you should probably use
> a RefPtr for holding the widget at least.
I tried that, but turns out nsWindow's ref-counting is non-threadsafe. We could switch it to be threadsafe, but I wasn't sure how much of a perf impact that would be. In Compositor, the widget is stored as a raw pointer presumably for the same reason.
Attachment #8692023 -
Flags: review?(snorp) → review+
Attachment #8692024 -
Flags: review?(snorp) → review-
Attachment #8692031 -
Flags: review?(snorp) → review-
Attachment #8692032 -
Flags: review?(snorp) → review-
Jim and I discussed, and we shouldn't need the ILayerClient once we kill all the Java stuff.
Assignee | ||
Comment 8•9 years ago
|
||
Gonna merge this bug with others.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Updated•3 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•