Last Comment Bug 752643 - Make CompositorParent eglSurface setup available for non-android environment
: Make CompositorParent eglSurface setup available for non-android environment
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics: Layers (show other bugs)
: Trunk
: All Linux
: -- normal (vote)
: mozilla15
Assigned To: Oleg Romashin (:romaxa)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-07 12:50 PDT by Oleg Romashin (:romaxa)
Modified: 2012-05-09 03:45 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
EGL Surface enable API (4.04 KB, patch)
2012-05-07 12:50 PDT, Oleg Romashin (:romaxa)
no flags Details | Diff | Review
EGL Surface enable API v2 (6.70 KB, patch)
2012-05-08 01:15 PDT, Oleg Romashin (:romaxa)
no flags Details | Diff | Review
EGL Surface enable API v3 (6.72 KB, patch)
2012-05-08 01:57 PDT, Oleg Romashin (:romaxa)
ajuma.bugzilla: review+
Details | Diff | Review

Description Oleg Romashin (:romaxa) 2012-05-07 12:50:00 PDT
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
Comment 1 Oleg Romashin (:romaxa) 2012-05-07 12:50:31 PDT
Created attachment 621693 [details] [diff] [review]
EGL Surface enable API
Comment 2 Ali Juma [:ajuma] 2012-05-07 15:04:43 PDT
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).
Comment 3 Oleg Romashin (:romaxa) 2012-05-08 01:15:06 PDT
Created attachment 621907 [details] [diff] [review]
EGL Surface enable API v2

https://tbpl.mozilla.org/?tree=Try&rev=f1cc31526ef2
Comment 4 Ali Juma [:ajuma] 2012-05-08 01:23:05 PDT
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.
Comment 5 Oleg Romashin (:romaxa) 2012-05-08 01:57:43 PDT
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
Comment 7 Ed Morley [:emorley] 2012-05-09 03:45:56 PDT
https://hg.mozilla.org/mozilla-central/rev/dc71f78478e7

Note You need to log in before you can comment on or make changes to this bug.