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 | |
Jamie Madill | 3311d47 | 2017-01-02 17:55:02 -0500 | [diff] [blame] | 11 | #include "libANGLE/Display.h" |
Jamie Madill | 870352a | 2014-12-01 11:01:17 -0500 | [diff] [blame] | 12 | #include "libANGLE/Surface.h" |
| 13 | |
| 14 | namespace rx |
| 15 | { |
| 16 | |
Jamie Madill | 3311d47 | 2017-01-02 17:55:02 -0500 | [diff] [blame] | 17 | DisplayImpl::DisplayImpl(const egl::DisplayState &state) |
Shahbaz Youssefi | 996628a | 2018-09-24 16:39:26 -0400 | [diff] [blame] | 18 | : mState(state), mExtensionsInitialized(false), mCapsInitialized(false), mBlobCache(nullptr) |
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 | { |
Jamie Madill | 3311d47 | 2017-01-02 17:55:02 -0500 | [diff] [blame] | 24 | ASSERT(mState.surfaceSet.empty()); |
Jamie Madill | 870352a | 2014-12-01 11:01:17 -0500 | [diff] [blame] | 25 | } |
| 26 | |
Geoff Lang | 1b76545 | 2014-12-11 11:58:39 -0500 | [diff] [blame] | 27 | const egl::DisplayExtensions &DisplayImpl::getExtensions() const |
| 28 | { |
| 29 | if (!mExtensionsInitialized) |
| 30 | { |
| 31 | generateExtensions(&mExtensions); |
| 32 | mExtensionsInitialized = true; |
| 33 | } |
| 34 | |
| 35 | return mExtensions; |
| 36 | } |
| 37 | |
Geoff Lang | 2018c0b | 2015-12-08 11:48:51 -0500 | [diff] [blame] | 38 | egl::Error DisplayImpl::validateClientBuffer(const egl::Config *configuration, |
| 39 | EGLenum buftype, |
| 40 | EGLClientBuffer clientBuffer, |
| 41 | const egl::AttributeMap &attribs) const |
| 42 | { |
| 43 | UNREACHABLE(); |
Yuly Novikov | c4d18aa | 2017-03-09 18:45:02 -0500 | [diff] [blame] | 44 | return egl::EglBadDisplay() << "DisplayImpl::validateClientBuffer unimplemented."; |
Geoff Lang | 2018c0b | 2015-12-08 11:48:51 -0500 | [diff] [blame] | 45 | } |
| 46 | |
Geoff Lang | 5c39f68 | 2015-01-06 15:19:35 -0500 | [diff] [blame] | 47 | const egl::Caps &DisplayImpl::getCaps() const |
| 48 | { |
| 49 | if (!mCapsInitialized) |
| 50 | { |
| 51 | generateCaps(&mCaps); |
| 52 | mCapsInitialized = true; |
| 53 | } |
| 54 | |
| 55 | return mCaps; |
| 56 | } |
| 57 | |
Jamie Madill | 70ee0f6 | 2017-02-06 16:04:20 -0500 | [diff] [blame] | 58 | } // namespace rx |