Commit 557b14e5 by Nicolas Capens

Make available EGL surface parameters queryable.

BUG=14959041 Change-Id: I0447c512554e3da98c3b5b0f7a88cdadb96ef4d4
parent ae799b19
...@@ -196,16 +196,6 @@ void Surface::swap() ...@@ -196,16 +196,6 @@ void Surface::swap()
} }
} }
EGLint Surface::getWidth() const
{
return mWidth;
}
EGLint Surface::getHeight() const
{
return mHeight;
}
gl::Image *Surface::getRenderTarget() gl::Image *Surface::getRenderTarget()
{ {
if(backBuffer) if(backBuffer)
...@@ -238,6 +228,36 @@ void Surface::setSwapInterval(EGLint interval) ...@@ -238,6 +228,36 @@ void Surface::setSwapInterval(EGLint interval)
mSwapInterval = std::min(mSwapInterval, mDisplay->getMaxSwapInterval()); mSwapInterval = std::min(mSwapInterval, mDisplay->getMaxSwapInterval());
} }
EGLint Surface::getConfigID() const
{
return mConfig->mConfigID;
}
EGLint Surface::getWidth() const
{
return mWidth;
}
EGLint Surface::getHeight() const
{
return mHeight;
}
EGLint Surface::getPixelAspectRatio() const
{
return mPixelAspectRatio;
}
EGLenum Surface::getRenderBuffer() const
{
return mRenderBuffer;
}
EGLenum Surface::getSwapBehavior() const
{
return mSwapBehavior;
}
EGLenum Surface::getTextureFormat() const EGLenum Surface::getTextureFormat() const
{ {
return mTextureFormat; return mTextureFormat;
......
...@@ -46,14 +46,18 @@ public: ...@@ -46,14 +46,18 @@ public:
void swap(); void swap();
EGLNativeWindowType getWindowHandle(); EGLNativeWindowType getWindowHandle();
virtual EGLint getWidth() const;
virtual EGLint getHeight() const;
virtual gl::Image *getRenderTarget(); virtual gl::Image *getRenderTarget();
virtual gl::Image *getDepthStencil(); virtual gl::Image *getDepthStencil();
void setSwapInterval(EGLint interval); void setSwapInterval(EGLint interval);
virtual EGLint getConfigID() const;
virtual EGLint getWidth() const;
virtual EGLint getHeight() const;
virtual EGLint getPixelAspectRatio() const;
virtual EGLenum getRenderBuffer() const;
virtual EGLenum getSwapBehavior() const;
virtual EGLenum getTextureFormat() const; virtual EGLenum getTextureFormat() const;
virtual EGLenum getTextureTarget() const; virtual EGLenum getTextureTarget() const;
virtual sw::Format getInternalFormat() const; virtual sw::Format getInternalFormat() const;
......
...@@ -448,7 +448,7 @@ EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLin ...@@ -448,7 +448,7 @@ EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLin
UNIMPLEMENTED(); // FIXME UNIMPLEMENTED(); // FIXME
break; break;
case EGL_CONFIG_ID: case EGL_CONFIG_ID:
UNIMPLEMENTED(); // FIXME *value = eglSurface->getConfigID();
break; break;
case EGL_HEIGHT: case EGL_HEIGHT:
*value = eglSurface->getHeight(); *value = eglSurface->getHeight();
...@@ -469,19 +469,19 @@ EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLin ...@@ -469,19 +469,19 @@ EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLin
UNIMPLEMENTED(); // FIXME UNIMPLEMENTED(); // FIXME
break; break;
case EGL_PIXEL_ASPECT_RATIO: case EGL_PIXEL_ASPECT_RATIO:
UNIMPLEMENTED(); // FIXME *value = eglSurface->getPixelAspectRatio();
break; break;
case EGL_RENDER_BUFFER: case EGL_RENDER_BUFFER:
UNIMPLEMENTED(); // FIXME *value = eglSurface->getRenderBuffer();
break; break;
case EGL_SWAP_BEHAVIOR: case EGL_SWAP_BEHAVIOR:
UNIMPLEMENTED(); // FIXME *value = eglSurface->getSwapBehavior();
break; break;
case EGL_TEXTURE_FORMAT: case EGL_TEXTURE_FORMAT:
UNIMPLEMENTED(); // FIXME *value = eglSurface->getTextureFormat();
break; break;
case EGL_TEXTURE_TARGET: case EGL_TEXTURE_TARGET:
UNIMPLEMENTED(); // FIXME *value = eglSurface->getTextureTarget();
break; break;
case EGL_VERTICAL_RESOLUTION: case EGL_VERTICAL_RESOLUTION:
UNIMPLEMENTED(); // FIXME UNIMPLEMENTED(); // FIXME
...@@ -859,9 +859,6 @@ EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurfac ...@@ -859,9 +859,6 @@ EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurfac
UNIMPLEMENTED(); // FIXME UNIMPLEMENTED(); // FIXME
} }
egl::Surface* previousDraw = static_cast<egl::Surface*>(egl::getCurrentDrawSurface());
egl::Surface* previousRead = static_cast<egl::Surface*>(egl::getCurrentReadSurface());
egl::setCurrentDisplay(dpy); egl::setCurrentDisplay(dpy);
egl::setCurrentDrawSurface(draw); egl::setCurrentDrawSurface(draw);
egl::setCurrentReadSurface(read); egl::setCurrentReadSurface(read);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment