Bug 974152 - Use FrameBuffer's Acquire Fence as Layer buffer's ReleaseFence on gonk...
[gecko.git] / widget / gonk / libdisplay / GonkDisplay.h
blob1bbb7b9de70de71a403d18fe33b2185e3f549336
1 /* Copyright 2013 Mozilla Foundation and Mozilla contributors
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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #ifndef GONKDISPLAY_H
17 #define GONKDISPLAY_H
19 #include <system/window.h>
21 namespace mozilla {
23 namespace layers {
24 class Layer;
27 typedef void * EGLDisplay;
28 typedef void * EGLSurface;
30 class GonkDisplay {
31 public:
32 virtual ANativeWindow* GetNativeWindow() = 0;
34 virtual void SetEnabled(bool enabled) = 0;
36 typedef void (*OnEnabledCallbackType)(bool enabled);
38 virtual void OnEnabled(OnEnabledCallbackType callback) = 0;
40 virtual void* GetHWCDevice() = 0;
42 virtual void* GetFBSurface() = 0;
44 virtual bool SwapBuffers(EGLDisplay dpy, EGLSurface sur) = 0;
46 virtual ANativeWindowBuffer* DequeueBuffer() = 0;
48 virtual bool QueueBuffer(ANativeWindowBuffer* buf) = 0;
50 virtual void UpdateFBSurface(EGLDisplay dpy, EGLSurface sur) = 0;
52 virtual void SetFBReleaseFd(int fd) = 0;
54 virtual int GetPrevFBAcquireFd() = 0;
56 float xdpi;
57 uint32_t surfaceformat;
60 __attribute__ ((weak))
61 GonkDisplay* GetGonkDisplay();
64 #endif /* GONKDISPLAY_H */