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 | c3ee7ec | 2018-09-21 16:15:03 -0400 | [diff] [blame^] | 47 | egl::Error DisplayImpl::validateImageClientBuffer(const gl::Context *context, |
| 48 | EGLenum target, |
| 49 | EGLClientBuffer clientBuffer, |
| 50 | const egl::AttributeMap &attribs) const |
| 51 | { |
| 52 | UNREACHABLE(); |
| 53 | return egl::EglBadDisplay() << "DisplayImpl::validateImageClientBuffer unimplemented."; |
| 54 | } |
| 55 | |
Geoff Lang | 5c39f68 | 2015-01-06 15:19:35 -0500 | [diff] [blame] | 56 | const egl::Caps &DisplayImpl::getCaps() const |
| 57 | { |
| 58 | if (!mCapsInitialized) |
| 59 | { |
| 60 | generateCaps(&mCaps); |
| 61 | mCapsInitialized = true; |
| 62 | } |
| 63 | |
| 64 | return mCaps; |
| 65 | } |
| 66 | |
Jamie Madill | 70ee0f6 | 2017-02-06 16:04:20 -0500 | [diff] [blame] | 67 | } // namespace rx |