• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 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/Display.h"
12 #include "libANGLE/Surface.h"
13 
14 namespace rx
15 {
16 
DisplayImpl(const egl::DisplayState & state)17 DisplayImpl::DisplayImpl(const egl::DisplayState &state)
18     : mState(state), mExtensionsInitialized(false), mCapsInitialized(false), mBlobCache(nullptr)
19 {}
20 
~DisplayImpl()21 DisplayImpl::~DisplayImpl()
22 {
23     ASSERT(mState.surfaceSet.empty());
24 }
25 
getExtensions() const26 const egl::DisplayExtensions &DisplayImpl::getExtensions() const
27 {
28     if (!mExtensionsInitialized)
29     {
30         generateExtensions(&mExtensions);
31         mExtensionsInitialized = true;
32     }
33 
34     return mExtensions;
35 }
36 
validateClientBuffer(const egl::Config * configuration,EGLenum buftype,EGLClientBuffer clientBuffer,const egl::AttributeMap & attribs) const37 egl::Error DisplayImpl::validateClientBuffer(const egl::Config *configuration,
38                                              EGLenum buftype,
39                                              EGLClientBuffer clientBuffer,
40                                              const egl::AttributeMap &attribs) const
41 {
42     UNREACHABLE();
43     return egl::EglBadDisplay() << "DisplayImpl::validateClientBuffer unimplemented.";
44 }
45 
validateImageClientBuffer(const gl::Context * context,EGLenum target,EGLClientBuffer clientBuffer,const egl::AttributeMap & attribs) const46 egl::Error DisplayImpl::validateImageClientBuffer(const gl::Context *context,
47                                                   EGLenum target,
48                                                   EGLClientBuffer clientBuffer,
49                                                   const egl::AttributeMap &attribs) const
50 {
51     UNREACHABLE();
52     return egl::EglBadDisplay() << "DisplayImpl::validateImageClientBuffer unimplemented.";
53 }
54 
getCaps() const55 const egl::Caps &DisplayImpl::getCaps() const
56 {
57     if (!mCapsInitialized)
58     {
59         generateCaps(&mCaps);
60         mCapsInitialized = true;
61     }
62 
63     return mCaps;
64 }
65 
66 }  // namespace rx
67