435ad8bcf06654244747add03eb4a473673478f4
2 * Copyright (C) 2013 libhybris
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef FBDEV_WINDOW_H
18 #define FBDEV_WINDOW_H
20 #include "nativewindowbase.h"
22 #include <android/hardware/gralloc.h>
27 class FbDevNativeWindowBuffer
: public BaseNativeWindowBuffer
{
28 friend class FbDevNativeWindow
;
31 FbDevNativeWindowBuffer(alloc_device_t
* alloc
,
36 virtual ~FbDevNativeWindowBuffer() ;
41 alloc_device_t
* m_alloc
;
45 class FbDevNativeWindow
: public BaseNativeWindow
{
47 FbDevNativeWindow(gralloc_module_t
* gralloc
, alloc_device_t
* alloc
,
48 framebuffer_device_t
* fbDev
);
52 // overloads from BaseNativeWindow
53 virtual int setSwapInterval(int interval
);
55 virtual int dequeueBuffer(BaseNativeWindowBuffer
** buffer
, int* fenceFd
);
56 virtual int queueBuffer(BaseNativeWindowBuffer
* buffer
, int fenceFd
);
57 virtual int cancelBuffer(BaseNativeWindowBuffer
* buffer
, int fenceFd
);
58 virtual int lockBuffer(BaseNativeWindowBuffer
* buffer
);
60 virtual unsigned int type() const;
61 virtual unsigned int width() const;
62 virtual unsigned int height() const;
63 virtual unsigned int format() const;
64 virtual unsigned int defaultWidth() const;
65 virtual unsigned int defaultHeight() const;
66 virtual unsigned int queueLength() const;
67 virtual unsigned int transformHint() const;
69 virtual int setUsage(int usage
);
70 virtual int setBuffersFormat(int format
);
71 virtual int setBuffersDimensions(int width
, int height
);
72 virtual int setBufferCount(int cnt
);
75 void destroyBuffers();
78 framebuffer_device_t
* m_fbDev
;
79 alloc_device_t
* m_alloc
;
81 unsigned int m_bufFormat
;
83 std::list
<FbDevNativeWindowBuffer
*> m_bufList
;
84 FbDevNativeWindowBuffer
* m_frontBuf
;
88 // vim: noai:ts=4:sw=4:ss=4:expandtab