[EFL][WebGL] Add error handling to carefully manage Window backing pixmaps.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2013 08:56:42 +0000 (08:56 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2013 08:56:42 +0000 (08:56 +0000)
commit01befa2d94ef072fc71a094071bbb53ff5aee4ef
tree8df9abc080151f32d64a7174d98b0202b4d1dce4
parent114e9631305b630e1e31c30c0d7b220236ab5df7
[EFL][WebGL] Add error handling to carefully manage Window backing pixmaps.
https://bugs.webkit.org/show_bug.cgi?id=106582

Patch by Kondapally Kalyan <kalyan.kondapally@intel.com> on 2013-01-15
Reviewed by Kenneth Rohde Christiansen.

We use XCompositeNameWindowPixmap to create a pixmap that serves as a reference to
the off-screen storage for a Window Handle. We expect the Window to be valid and
the created glx pixmap to be a valid drawable. This may not be true always.
This patch adds support for X Error checks and handles the generated errors.

Covered by existing WebGL layout tests.

* platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp:
(WebCore):
(WebCore::handleXPixmapCreationError):
(ScopedXPixmapCreationErrorHandler):
(WebCore::ScopedXPixmapCreationErrorHandler::ScopedXPixmapCreationErrorHandler):
(WebCore::ScopedXPixmapCreationErrorHandler::~ScopedXPixmapCreationErrorHandler):
(WebCore::ScopedXPixmapCreationErrorHandler::isValidOperation):
Helper Class to catch XErrors.

(WebCore::GraphicsSurfacePrivate::~GraphicsSurfacePrivate):
(WebCore::GraphicsSurfacePrivate::createPixmap): Added support to check and handle generated XErrors.
(WebCore::GraphicsSurfacePrivate::findFBConfigWithAlpha):
(WebCore::GraphicsSurfacePrivate::clear): Destroys GL Resources.
(GraphicsSurfacePrivate):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139725 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp