Jamie Madill | 870352a | 2014-12-01 11:01:17 -0500 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2014 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
| 7 | // DisplayImpl.cpp: Implementation methods of egl::Display |
| 8 | |
| 9 | #include "libANGLE/renderer/DisplayImpl.h" |
| 10 | |
| 11 | #include "libANGLE/Surface.h" |
| 12 | |
| 13 | namespace rx |
| 14 | { |
| 15 | |
Geoff Lang | 1b76545 | 2014-12-11 11:58:39 -0500 | [diff] [blame] | 16 | DisplayImpl::DisplayImpl() |
Geoff Lang | 5c39f68 | 2015-01-06 15:19:35 -0500 | [diff] [blame] | 17 | : mExtensionsInitialized(false), |
| 18 | mCapsInitialized(false) |
Geoff Lang | 1b76545 | 2014-12-11 11:58:39 -0500 | [diff] [blame] | 19 | { |
| 20 | } |
| 21 | |
Jamie Madill | 870352a | 2014-12-01 11:01:17 -0500 | [diff] [blame] | 22 | DisplayImpl::~DisplayImpl() |
| 23 | { |
Geoff Lang | 41ae31c | 2015-12-08 11:40:54 -0500 | [diff] [blame] | 24 | ASSERT(mSurfaceSet.empty()); |
Jamie Madill | 870352a | 2014-12-01 11:01:17 -0500 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | void DisplayImpl::destroySurface(egl::Surface *surface) |
| 28 | { |
Jamie Madill | 18fdcbc | 2015-08-19 18:12:44 +0000 | [diff] [blame] | 29 | mSurfaceSet.erase(surface); |
Corentin Wallez | 37c3979 | 2015-08-20 14:19:46 -0400 | [diff] [blame] | 30 | surface->onDestroy(); |
Jamie Madill | 870352a | 2014-12-01 11:01:17 -0500 | [diff] [blame] | 31 | } |
| 32 | |
Geoff Lang | 1b76545 | 2014-12-11 11:58:39 -0500 | [diff] [blame] | 33 | const egl::DisplayExtensions &DisplayImpl::getExtensions() const |
| 34 | { |
| 35 | if (!mExtensionsInitialized) |
| 36 | { |
| 37 | generateExtensions(&mExtensions); |
| 38 | mExtensionsInitialized = true; |
| 39 | } |
| 40 | |
| 41 | return mExtensions; |
| 42 | } |
| 43 | |
Geoff Lang | 2018c0b | 2015-12-08 11:48:51 -0500 | [diff] [blame^] | 44 | egl::Error DisplayImpl::validateClientBuffer(const egl::Config *configuration, |
| 45 | EGLenum buftype, |
| 46 | EGLClientBuffer clientBuffer, |
| 47 | const egl::AttributeMap &attribs) const |
| 48 | { |
| 49 | UNREACHABLE(); |
| 50 | return egl::Error(EGL_BAD_DISPLAY, "DisplayImpl::validateClientBuffer unimplemented."); |
| 51 | } |
| 52 | |
Geoff Lang | 5c39f68 | 2015-01-06 15:19:35 -0500 | [diff] [blame] | 53 | const egl::Caps &DisplayImpl::getCaps() const |
| 54 | { |
| 55 | if (!mCapsInitialized) |
| 56 | { |
| 57 | generateCaps(&mCaps); |
| 58 | mCapsInitialized = true; |
| 59 | } |
| 60 | |
| 61 | return mCaps; |
| 62 | } |
| 63 | |
Jamie Madill | 870352a | 2014-12-01 11:01:17 -0500 | [diff] [blame] | 64 | } |