Commit 3501c165 by Nicolas Capens

Make available EGL surface parameters queryable.

BUG=angle:331 Change-Id: Idb3c3ddc6ddd6bfc21b15b7e8942975ce4cd051f Reviewed-on: https://chromium-review.googlesource.com/200811Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarNicolas Capens <nicolascapens@chromium.org>
parent 893ab087
// //
// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved. // Copyright (c) 2002-2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
...@@ -358,18 +358,8 @@ bool Surface::postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) ...@@ -358,18 +358,8 @@ bool Surface::postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height)
// Spec is not clear about how this should be handled. // Spec is not clear about how this should be handled.
return true; return true;
} }
return swapRect(x, y, width, height);
}
EGLint Surface::getWidth() const return swapRect(x, y, width, height);
{
return mWidth;
}
EGLint Surface::getHeight() const
{
return mHeight;
} }
EGLint Surface::isPostSubBufferSupported() const EGLint Surface::isPostSubBufferSupported() const
...@@ -388,7 +378,7 @@ void Surface::setSwapInterval(EGLint interval) ...@@ -388,7 +378,7 @@ void Surface::setSwapInterval(EGLint interval)
{ {
return; return;
} }
mSwapInterval = interval; mSwapInterval = interval;
mSwapInterval = std::max(mSwapInterval, mRenderer->getMinSwapInterval()); mSwapInterval = std::max(mSwapInterval, mRenderer->getMinSwapInterval());
mSwapInterval = std::min(mSwapInterval, mRenderer->getMaxSwapInterval()); mSwapInterval = std::min(mSwapInterval, mRenderer->getMaxSwapInterval());
...@@ -396,6 +386,36 @@ void Surface::setSwapInterval(EGLint interval) ...@@ -396,6 +386,36 @@ void Surface::setSwapInterval(EGLint interval)
mSwapIntervalDirty = true; mSwapIntervalDirty = true;
} }
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;
......
// //
// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved. // Copyright (c) 2002-2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
...@@ -47,9 +47,6 @@ class Surface ...@@ -47,9 +47,6 @@ class Surface
bool swap(); bool swap();
bool postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height); bool postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height);
virtual EGLint getWidth() const;
virtual EGLint getHeight() const;
virtual EGLint isPostSubBufferSupported() const; virtual EGLint isPostSubBufferSupported() const;
virtual rx::SwapChain *getSwapChain() const; virtual rx::SwapChain *getSwapChain() const;
...@@ -57,6 +54,12 @@ class Surface ...@@ -57,6 +54,12 @@ class Surface
void setSwapInterval(EGLint interval); void setSwapInterval(EGLint interval);
bool checkForOutOfDateSwapChain(); // Returns true if swapchain changed due to resize or interval update bool checkForOutOfDateSwapChain(); // Returns true if swapchain changed due to resize or interval update
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 EGLenum getFormat() const; virtual EGLenum getFormat() const;
......
// //
// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved. // Copyright (c) 2002-2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
...@@ -427,7 +427,7 @@ EGLBoolean __stdcall eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint ...@@ -427,7 +427,7 @@ EGLBoolean __stdcall eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint
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();
...@@ -448,19 +448,19 @@ EGLBoolean __stdcall eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint ...@@ -448,19 +448,19 @@ EGLBoolean __stdcall eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint
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
......
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