2 * Copyright (C) 2012 Intel Corporation. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
27 #include "GLPlatformSurface.h"
29 #if USE(ACCELERATED_COMPOSITING)
32 #include "GLXSurface.h"
36 #include "EGLSurface.h"
39 #include "NotImplemented.h"
43 PassOwnPtr<GLPlatformSurface> GLPlatformSurface::createOffScreenSurface(SurfaceAttributes attributes)
46 OwnPtr<GLPlatformSurface> surface = adoptPtr(new GLXOffScreenSurface(attributes));
48 if (surface->drawable())
49 return surface.release();
51 UNUSED_PARAM(attributes);
57 PassOwnPtr<GLPlatformSurface> GLPlatformSurface::createTransportSurface(SurfaceAttributes attributes)
60 OwnPtr<GLPlatformSurface> surface = adoptPtr(new GLXTransportSurface(attributes));
62 OwnPtr<GLPlatformSurface> surface = adoptPtr(new EGLWindowTransportSurface(attributes));
65 if (surface && surface->handle() && surface->drawable())
66 return surface.release();
71 GLPlatformSurface::GLPlatformSurface(SurfaceAttributes)
78 GLPlatformSurface::~GLPlatformSurface()
82 PlatformBufferHandle GLPlatformSurface::handle() const
84 return m_bufferHandle;
87 PlatformDrawable GLPlatformSurface::drawable() const
92 const IntRect& GLPlatformSurface::geometry() const
97 PlatformDisplay GLPlatformSurface::sharedDisplay() const
99 return m_sharedDisplay;
102 PlatformSurfaceConfig GLPlatformSurface::configuration()
107 void GLPlatformSurface::swapBuffers()
112 void GLPlatformSurface::updateContents(const uint32_t)
116 void GLPlatformSurface::setGeometry(const IntRect&)
120 void GLPlatformSurface::destroy()
124 GLPlatformSurface::SurfaceAttributes GLPlatformSurface::attributes() const
126 return GLPlatformSurface::Default;