• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2020 The SwiftShader Authors. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //    http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #include "Main/FrameBuffer.hpp"
16 
17 #include "Main/FrameBufferOzone.hpp"
18 
19 #if defined(SWIFTSHADER_USE_X11)
20 #include "libX11.hpp"
21 #include "Main/FrameBufferX11.hpp"
22 #endif
23 
createFrameBuffer(void * display,intptr_t window,int width,int height)24 NO_SANITIZE_FUNCTION sw::FrameBuffer *createFrameBuffer(void *display, intptr_t window, int width, int height)
25 {
26 #if defined(SWIFTSHADER_USE_X11)
27 	if(reinterpret_cast<::Display *>(display))
28 	{
29 		return new sw::FrameBufferX11((::Display *)display, window, width, height);
30 	}
31 #endif
32 	return new sw::FrameBufferOzone((intptr_t)display, window, width, height);
33 }
34