Closed Bug 752643 Opened 12 years ago Closed 12 years ago

Make CompositorParent eglSurface setup available for non-android environment

Categories

(Core :: Graphics: Layers, defect)

All
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: romaxa, Assigned: romaxa)

Details

Attachments

(1 file, 2 obsolete files)

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
Attached patch EGL Surface enable API (obsolete) — Splinter Review
Assignee: nobody → romaxa
Status: NEW → ASSIGNED
Attachment #621693 - Flags: review?(ajuma)
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)
Attached patch EGL Surface enable API v2 (obsolete) — Splinter Review
https://tbpl.mozilla.org/?tree=Try&rev=f1cc31526ef2
Attachment #621693 - Attachment is obsolete: true
Attachment #621907 - Flags: review?(ajuma)
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)
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)
Attachment #621915 - Flags: review?(ajuma) → review+
https://hg.mozilla.org/mozilla-central/rev/dc71f78478e7
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: