blob: 8061189f0a767e3470b0c67a6a35e1de28f46422 [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 Lang5c39f682015-01-06 15:19:35 -050044const egl::Caps &DisplayImpl::getCaps() const
45{
46 if (!mCapsInitialized)
47 {
48 generateCaps(&mCaps);
49 mCapsInitialized = true;
50 }
51
52 return mCaps;
53}
54
Jamie Madill870352a2014-12-01 11:01:17 -050055}