blob: fc2f2c5ce96fd0046985035c900056f648f4003d [file] [log] [blame]
Jamie Madill870352a2014-12-01 11:01:17 -05001//
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
13namespace rx
14{
15
Geoff Lang1b765452014-12-11 11:58:39 -050016DisplayImpl::DisplayImpl()
Geoff Lang5c39f682015-01-06 15:19:35 -050017 : mExtensionsInitialized(false),
18 mCapsInitialized(false)
Geoff Lang1b765452014-12-11 11:58:39 -050019{
20}
21
Jamie Madill870352a2014-12-01 11:01:17 -050022DisplayImpl::~DisplayImpl()
23{
Geoff Lang41ae31c2015-12-08 11:40:54 -050024 ASSERT(mSurfaceSet.empty());
Jamie Madill870352a2014-12-01 11:01:17 -050025}
26
27void DisplayImpl::destroySurface(egl::Surface *surface)
28{
Jamie Madill18fdcbc2015-08-19 18:12:44 +000029 mSurfaceSet.erase(surface);
Corentin Wallez37c39792015-08-20 14:19:46 -040030 surface->onDestroy();
Jamie Madill870352a2014-12-01 11:01:17 -050031}
32
Geoff Lang1b765452014-12-11 11:58:39 -050033const egl::DisplayExtensions &DisplayImpl::getExtensions() const
34{
35 if (!mExtensionsInitialized)
36 {
37 generateExtensions(&mExtensions);
38 mExtensionsInitialized = true;
39 }
40
41 return mExtensions;
42}
43
Geoff Lang2018c0b2015-12-08 11:48:51 -050044egl::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 Lang5c39f682015-01-06 15:19:35 -050053const egl::Caps &DisplayImpl::getCaps() const
54{
55 if (!mCapsInitialized)
56 {
57 generateCaps(&mCaps);
58 mCapsInitialized = true;
59 }
60
61 return mCaps;
62}
63
Jamie Madill870352a2014-12-01 11:01:17 -050064}