The default bug view has changed. See this FAQ.

Make CompositorParent eglSurface setup available for non-android environment

RESOLVED FIXED in mozilla15

Status

()

Core
Graphics: Layers
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: romaxa, Assigned: romaxa)

Tracking

Trunk
mozilla15
All
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

5 years ago
I've found problems with embedding Gecko OGL layers rendering with offsets(rendering into subarea inside EGLSurface)
And it seems EGLSurface trick help to solve that problem.

Suggesting to make that configurable for subCompositorParent classes
(Assignee)

Comment 1

5 years ago
Created attachment 621693 [details] [diff] [review]
EGL Surface enable API
Assignee: nobody → romaxa
Status: NEW → ASSIGNED
Attachment #621693 - Flags: review?(ajuma)

Comment 2

5 years ago
Comment on attachment 621693 [details] [diff] [review]
EGL Surface enable API

Review of attachment 621693 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/layers/ipc/CompositorParent.cpp
@@ +71,3 @@
>  {
> +#ifdef MOZ_JAVA_COMPOSITOR
> +  mRenderToEGLSurface = true;

I'd rather have this passed as an argument to the constructor.

@@ +169,5 @@
>  
>  void
> +CompositorParent::SetEGLSurfaceSize(int width, int height)
> +{
> +  mRenderToEGLSurface = true;

If this is passed as an argument to the constructor, we won't have to keep setting it here anymore.

@@ +181,1 @@
>  CompositorParent::ResumeCompositionAndResize(int width, int height)

This should now call SetEGLSurfaceSize.

@@ +477,5 @@
>  {
>    if (backendType == LayerManager::LAYERS_OPENGL) {
> +    nsRefPtr<LayerManagerOGL> layerManager;
> +    if (mRenderToEGLSurface) {
> +      if (!mEGLSurfaceSize.width && !mEGLSurfaceSize.height) {

Instead of needing to condition on mEGLSurfaceSize here, we should take the initial surface size as an optional argument to the constructor (just like LayerManagerOGL does).
Attachment #621693 - Flags: review?(ajuma)
(Assignee)

Comment 3

5 years ago
Created attachment 621907 [details] [diff] [review]
EGL Surface enable API v2

https://tbpl.mozilla.org/?tree=Try&rev=f1cc31526ef2
Attachment #621693 - Attachment is obsolete: true
Attachment #621907 - Flags: review?(ajuma)

Comment 4

5 years ago
Comment on attachment 621907 [details] [diff] [review]
EGL Surface enable API v2

Review of attachment 621907 [details] [diff] [review]:
-----------------------------------------------------------------

One more thing to fix to get this working on Android.

::: widget/xpwidgets/nsBaseWidget.cpp
@@ +875,5 @@
>    mCompositorThread = new Thread("CompositorThread");
>    if (mCompositorThread->Start()) {
> +    bool renderToEGLSurface = false;
> +#ifdef MOZ_JAVA_COMPOSITOR
> +    renderToEGLSurface = true;

We'll need to get the current widget size (by calling this->GetBounds(rect)) and pass this to the constructor as the initial surface size.
Attachment #621907 - Flags: review?(ajuma)
(Assignee)

Comment 5

5 years ago
Created attachment 621915 [details] [diff] [review]
EGL Surface enable API v3

Oh, sorry, kept that in mind and forgot at last moment about this part
Attachment #621907 - Attachment is obsolete: true
Attachment #621915 - Flags: review?(ajuma)

Updated

5 years ago
Attachment #621915 - Flags: review?(ajuma) → review+
(Assignee)

Comment 6

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/dc71f78478e7
https://hg.mozilla.org/mozilla-central/rev/dc71f78478e7
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
You need to log in before you can comment on or make changes to this bug.