Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
michael@0 | 1 | /* Copyright 2013 Mozilla Foundation and Mozilla contributors |
michael@0 | 2 | * |
michael@0 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
michael@0 | 4 | * you may not use this file except in compliance with the License. |
michael@0 | 5 | * You may obtain a copy of the License at |
michael@0 | 6 | * |
michael@0 | 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
michael@0 | 8 | * |
michael@0 | 9 | * Unless required by applicable law or agreed to in writing, software |
michael@0 | 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
michael@0 | 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
michael@0 | 12 | * See the License for the specific language governing permissions and |
michael@0 | 13 | * limitations under the License. |
michael@0 | 14 | */ |
michael@0 | 15 | |
michael@0 | 16 | #ifndef GONKDISPLAY_H |
michael@0 | 17 | #define GONKDISPLAY_H |
michael@0 | 18 | |
michael@0 | 19 | #include <system/window.h> |
michael@0 | 20 | |
michael@0 | 21 | namespace mozilla { |
michael@0 | 22 | |
michael@0 | 23 | namespace layers { |
michael@0 | 24 | class Layer; |
michael@0 | 25 | } |
michael@0 | 26 | |
michael@0 | 27 | typedef void * EGLDisplay; |
michael@0 | 28 | typedef void * EGLSurface; |
michael@0 | 29 | |
michael@0 | 30 | class GonkDisplay { |
michael@0 | 31 | public: |
michael@0 | 32 | virtual ANativeWindow* GetNativeWindow() = 0; |
michael@0 | 33 | |
michael@0 | 34 | virtual void SetEnabled(bool enabled) = 0; |
michael@0 | 35 | |
michael@0 | 36 | typedef void (*OnEnabledCallbackType)(bool enabled); |
michael@0 | 37 | |
michael@0 | 38 | virtual void OnEnabled(OnEnabledCallbackType callback) = 0; |
michael@0 | 39 | |
michael@0 | 40 | virtual void* GetHWCDevice() = 0; |
michael@0 | 41 | |
michael@0 | 42 | virtual void* GetFBSurface() = 0; |
michael@0 | 43 | |
michael@0 | 44 | virtual bool SwapBuffers(EGLDisplay dpy, EGLSurface sur) = 0; |
michael@0 | 45 | |
michael@0 | 46 | virtual ANativeWindowBuffer* DequeueBuffer() = 0; |
michael@0 | 47 | |
michael@0 | 48 | virtual bool QueueBuffer(ANativeWindowBuffer* buf) = 0; |
michael@0 | 49 | |
michael@0 | 50 | virtual void UpdateFBSurface(EGLDisplay dpy, EGLSurface sur) = 0; |
michael@0 | 51 | |
michael@0 | 52 | /** |
michael@0 | 53 | * Set FramebufferSurface ReleaseFence's file descriptor. |
michael@0 | 54 | * ReleaseFence will be signaled after the HWC has finished reading |
michael@0 | 55 | * from a buffer. |
michael@0 | 56 | */ |
michael@0 | 57 | virtual void SetFBReleaseFd(int fd) = 0; |
michael@0 | 58 | |
michael@0 | 59 | /** |
michael@0 | 60 | * Get FramebufferSurface AcquireFence's file descriptor |
michael@0 | 61 | * AcquireFence will be signaled when a buffer's content is available. |
michael@0 | 62 | */ |
michael@0 | 63 | virtual int GetPrevFBAcquireFd() = 0; |
michael@0 | 64 | |
michael@0 | 65 | float xdpi; |
michael@0 | 66 | uint32_t surfaceformat; |
michael@0 | 67 | }; |
michael@0 | 68 | |
michael@0 | 69 | __attribute__ ((weak)) |
michael@0 | 70 | GonkDisplay* GetGonkDisplay(); |
michael@0 | 71 | |
michael@0 | 72 | } |
michael@0 | 73 | #endif /* GONKDISPLAY_H */ |