blob: 1e358b9e41b7a26abb11c31c2241b9105780dccc [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()
17 : mExtensionsInitialized(false)
18{
19}
20
Jamie Madill870352a2014-12-01 11:01:17 -050021DisplayImpl::~DisplayImpl()
22{
23 while (!mSurfaceSet.empty())
24 {
25 destroySurface(*mSurfaceSet.begin());
26 }
27}
28
29void DisplayImpl::destroySurface(egl::Surface *surface)
30{
31 mSurfaceSet.erase(surface);
32 SafeDelete(surface);
33}
34
Geoff Lang1b765452014-12-11 11:58:39 -050035const egl::DisplayExtensions &DisplayImpl::getExtensions() const
36{
37 if (!mExtensionsInitialized)
38 {
39 generateExtensions(&mExtensions);
40 mExtensionsInitialized = true;
41 }
42
43 return mExtensions;
44}
45
Jamie Madill870352a2014-12-01 11:01:17 -050046}