Commit 40ac783b by Geoff Lang Committed by Commit Bot

Implement remaining eglQuerySurface and eglSurfaceAttrib enums.

BUG=angleproject:2075 Change-Id: I3b500fe80512e7a3e3a9ae9a9724015952c9cbc8 Reviewed-on: https://chromium-review.googlesource.com/587299Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 0328b575
......@@ -39,6 +39,15 @@ Surface::Surface(EGLint surfaceType, const egl::Config *config, const AttributeM
mDestroyed(false),
mType(surfaceType),
mPostSubBufferRequested(false),
mLargestPbuffer(false),
mGLColorspace(EGL_GL_COLORSPACE_LINEAR),
mVGAlphaFormat(EGL_VG_ALPHA_FORMAT_NONPRE),
mVGColorspace(EGL_VG_COLORSPACE_sRGB),
mMipmapTexture(false),
mMipmapLevel(0),
mHorizontalResolution(EGL_UNKNOWN),
mVerticalResolution(EGL_UNKNOWN),
mMultisampleResolve(EGL_MULTISAMPLE_RESOLVE_DEFAULT),
mFixedSize(false),
mFixedWidth(0),
mFixedHeight(0),
......@@ -57,6 +66,18 @@ Surface::Surface(EGLint surfaceType, const egl::Config *config, const AttributeM
mFlexibleSurfaceCompatibilityRequested =
(attributes.get(EGL_FLEXIBLE_SURFACE_COMPATIBILITY_SUPPORTED_ANGLE, EGL_FALSE) == EGL_TRUE);
if (mType == EGL_PBUFFER_BIT)
{
mLargestPbuffer = (attributes.get(EGL_LARGEST_PBUFFER, EGL_FALSE) == EGL_TRUE);
}
mGLColorspace =
static_cast<EGLenum>(attributes.get(EGL_GL_COLORSPACE, EGL_GL_COLORSPACE_LINEAR));
mVGAlphaFormat =
static_cast<EGLenum>(attributes.get(EGL_VG_ALPHA_FORMAT, EGL_VG_ALPHA_FORMAT_NONPRE));
mVGColorspace = static_cast<EGLenum>(attributes.get(EGL_VG_COLORSPACE, EGL_VG_COLORSPACE_sRGB));
mMipmapTexture = (attributes.get(EGL_MIPMAP_TEXTURE, EGL_FALSE) == EGL_TRUE);
mDirectComposition = (attributes.get(EGL_DIRECT_COMPOSITION_ANGLE, EGL_FALSE) == EGL_TRUE);
mFixedSize = (attributes.get(EGL_FIXED_SIZE_ANGLE, EGL_FALSE) == EGL_TRUE);
......@@ -197,6 +218,27 @@ void Surface::setSwapInterval(EGLint interval)
mImplementation->setSwapInterval(interval);
}
void Surface::setMipmapLevel(EGLint level)
{
// Level is set but ignored
UNIMPLEMENTED();
mMipmapLevel = level;
}
void Surface::setMultisampleResolve(EGLenum resolve)
{
// Behaviour is set but ignored
UNIMPLEMENTED();
mMultisampleResolve = resolve;
}
void Surface::setSwapBehavior(EGLenum behavior)
{
// Behaviour is set but ignored
UNIMPLEMENTED();
mSwapBehavior = behavior;
}
const Config *Surface::getConfig() const
{
return mState.config;
......@@ -227,6 +269,51 @@ EGLenum Surface::getTextureTarget() const
return mTextureTarget;
}
bool Surface::getLargestPbuffer() const
{
return mLargestPbuffer;
}
EGLenum Surface::getGLColorspace() const
{
return mGLColorspace;
}
EGLenum Surface::getVGAlphaFormat() const
{
return mVGAlphaFormat;
}
EGLenum Surface::getVGColorspace() const
{
return mVGColorspace;
}
bool Surface::getMipmapTexture() const
{
return mMipmapTexture;
}
EGLint Surface::getMipmapLevel() const
{
return mMipmapLevel;
}
EGLint Surface::getHorizontalResolution() const
{
return mHorizontalResolution;
}
EGLint Surface::getVerticalResolution() const
{
return mVerticalResolution;
}
EGLenum Surface::getMultisampleResolve() const
{
return mMultisampleResolve;
}
EGLint Surface::isFixedSize() const
{
return mFixedSize;
......
......@@ -72,6 +72,10 @@ class Surface : public gl::FramebufferAttachmentObject
Error setIsCurrent(const gl::Context *context, bool isCurrent);
Error onDestroy(const Display *display);
void setMipmapLevel(EGLint level);
void setMultisampleResolve(EGLenum resolve);
void setSwapBehavior(EGLenum behavior);
const Config *getConfig() const;
// width and height can change with client window resizing
......@@ -82,6 +86,15 @@ class Surface : public gl::FramebufferAttachmentObject
EGLenum getSwapBehavior() const;
EGLenum getTextureFormat() const;
EGLenum getTextureTarget() const;
bool getLargestPbuffer() const;
EGLenum getGLColorspace() const;
EGLenum getVGAlphaFormat() const;
EGLenum getVGColorspace() const;
bool getMipmapTexture() const;
EGLint getMipmapLevel() const;
EGLint getHorizontalResolution() const;
EGLint getVerticalResolution() const;
EGLenum getMultisampleResolve() const;
gl::Texture *getBoundTexture() const { return mTexture.get(); }
gl::Framebuffer *getDefaultFramebuffer() { return mState.defaultFramebuffer; }
......@@ -127,6 +140,16 @@ class Surface : public gl::FramebufferAttachmentObject
bool mPostSubBufferRequested;
bool mFlexibleSurfaceCompatibilityRequested;
bool mLargestPbuffer;
EGLenum mGLColorspace;
EGLenum mVGAlphaFormat;
EGLenum mVGColorspace;
bool mMipmapTexture;
EGLint mMipmapLevel;
EGLint mHorizontalResolution;
EGLint mVerticalResolution;
EGLenum mMultisampleResolve;
bool mFixedSize;
size_t mFixedWidth;
size_t mFixedHeight;
......
......@@ -1251,13 +1251,13 @@ void QuerySurfaceAttrib(const Surface *surface, EGLint attribute, EGLint *value)
switch (attribute)
{
case EGL_GL_COLORSPACE:
UNIMPLEMENTED(); // FIXME
*value = surface->getGLColorspace();
break;
case EGL_VG_ALPHA_FORMAT:
UNIMPLEMENTED(); // FIXME
*value = surface->getVGAlphaFormat();
break;
case EGL_VG_COLORSPACE:
UNIMPLEMENTED(); // FIXME
*value = surface->getVGColorspace();
break;
case EGL_CONFIG_ID:
*value = surface->getConfig()->configID;
......@@ -1266,19 +1266,31 @@ void QuerySurfaceAttrib(const Surface *surface, EGLint attribute, EGLint *value)
*value = surface->getHeight();
break;
case EGL_HORIZONTAL_RESOLUTION:
UNIMPLEMENTED(); // FIXME
*value = surface->getHorizontalResolution();
break;
case EGL_LARGEST_PBUFFER:
UNIMPLEMENTED(); // FIXME
// The EGL spec states that value is not written if the surface is not a pbuffer
if (surface->getType() == EGL_PBUFFER_BIT)
{
*value = surface->getLargestPbuffer();
}
break;
case EGL_MIPMAP_TEXTURE:
UNIMPLEMENTED(); // FIXME
// The EGL spec states that value is not written if the surface is not a pbuffer
if (surface->getType() == EGL_PBUFFER_BIT)
{
*value = surface->getMipmapTexture();
}
break;
case EGL_MIPMAP_LEVEL:
UNIMPLEMENTED(); // FIXME
// The EGL spec states that value is not written if the surface is not a pbuffer
if (surface->getType() == EGL_PBUFFER_BIT)
{
*value = surface->getMipmapLevel();
}
break;
case EGL_MULTISAMPLE_RESOLVE:
UNIMPLEMENTED(); // FIXME
*value = surface->getMultisampleResolve();
break;
case EGL_PIXEL_ASPECT_RATIO:
*value = surface->getPixelAspectRatio();
......@@ -1290,13 +1302,21 @@ void QuerySurfaceAttrib(const Surface *surface, EGLint attribute, EGLint *value)
*value = surface->getSwapBehavior();
break;
case EGL_TEXTURE_FORMAT:
*value = surface->getTextureFormat();
// The EGL spec states that value is not written if the surface is not a pbuffer
if (surface->getType() == EGL_PBUFFER_BIT)
{
*value = surface->getTextureFormat();
}
break;
case EGL_TEXTURE_TARGET:
*value = surface->getTextureTarget();
// The EGL spec states that value is not written if the surface is not a pbuffer
if (surface->getType() == EGL_PBUFFER_BIT)
{
*value = surface->getTextureTarget();
}
break;
case EGL_VERTICAL_RESOLUTION:
UNIMPLEMENTED(); // FIXME
*value = surface->getVerticalResolution();
break;
case EGL_WIDTH:
*value = surface->getWidth();
......@@ -1327,13 +1347,13 @@ void SetSurfaceAttrib(Surface *surface, EGLint attribute, EGLint value)
switch (attribute)
{
case EGL_MIPMAP_LEVEL:
UNIMPLEMENTED(); // FIXME
surface->setMipmapLevel(value);
break;
case EGL_MULTISAMPLE_RESOLVE:
UNIMPLEMENTED(); // FIXME
surface->setMultisampleResolve(value);
break;
case EGL_SWAP_BEHAVIOR:
UNIMPLEMENTED(); // FIXME
surface->setSwapBehavior(value);
break;
default:
UNREACHABLE();
......
......@@ -48,10 +48,6 @@
1662 WIN : dEQP-EGL.functional.query_context.get_current_surface.other = FAIL
1662 WIN : dEQP-EGL.functional.query_context.get_current_display.other = FAIL
1662 WIN : dEQP-EGL.functional.query_context.query_context.other = FAIL
1662 WIN : dEQP-EGL.functional.query_surface.simple.window.other = FAIL
1662 WIN : dEQP-EGL.functional.query_surface.simple.pbuffer.other = FAIL
1662 WIN : dEQP-EGL.functional.query_surface.set_attribute.window.other = FAIL
1662 WIN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.other = FAIL
1662 WIN : dEQP-EGL.functional.native_color_mapping.native_window.other_clear = SKIP
1662 WIN : dEQP-EGL.functional.native_color_mapping.native_window.other_render = SKIP
......@@ -62,66 +58,6 @@
////////////////////////////////////////////////////////////////////////////////
// TODO(jmadill): Triage these into permananent and temporary failures.
1340 WIN : dEQP-EGL.functional.query_surface.simple.window.rgb565_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.window.rgb565_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.window.rgb565_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.window.rgb888_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.window.rgb888_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.window.rgb888_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.window.rgba4444_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.window.rgba4444_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.window.rgba4444_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.window.rgba5551_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.window.rgba5551_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.window.rgba5551_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.window.rgba8888_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.window.rgba8888_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.window.rgba8888_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgb565_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgb565_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgb565_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgb888_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgb888_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgb888_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgba4444_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgba4444_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgba4444_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgba5551_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgba5551_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgba5551_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgba8888_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgba8888_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgba8888_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.window.rgb565_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.window.rgb565_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.window.rgb565_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.window.rgb888_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.window.rgb888_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.window.rgb888_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.window.rgba4444_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.window.rgba4444_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.window.rgba4444_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.window.rgba5551_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.window.rgba5551_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.window.rgba5551_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.window.rgba8888_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.window.rgba8888_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.window.rgba8888_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgb565_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgb565_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgb565_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgb888_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgb888_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgb888_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgba4444_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgba4444_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgba4444_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgba5551_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgba5551_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgba5551_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgba8888_no_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgba8888_depth_no_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgba8888_depth_stencil = SKIP
1340 WIN : dEQP-EGL.functional.query_config.get_configs.get_configs_bounds = FAIL
1340 WIN : dEQP-EGL.functional.choose_config.simple.selection_only.buffer_size = FAIL
1340 WIN : dEQP-EGL.functional.choose_config.simple.selection_only.red_size = FAIL
......
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