|
1 /* Copyright 2013 Mozilla Foundation and Mozilla contributors |
|
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 |
|
16 #ifndef GONKDISPLAYJB_H |
|
17 #define GONKDISPLAYJB_H |
|
18 |
|
19 #include "GonkDisplay.h" |
|
20 #include "FramebufferSurface.h" |
|
21 #include "hardware/hwcomposer.h" |
|
22 #include "hardware/power.h" |
|
23 #include "ui/Fence.h" |
|
24 #include "utils/RefBase.h" |
|
25 |
|
26 namespace mozilla { |
|
27 |
|
28 class GonkDisplayJB : public GonkDisplay { |
|
29 public: |
|
30 GonkDisplayJB(); |
|
31 ~GonkDisplayJB(); |
|
32 |
|
33 virtual ANativeWindow* GetNativeWindow(); |
|
34 |
|
35 virtual void SetEnabled(bool enabled); |
|
36 |
|
37 virtual void OnEnabled(OnEnabledCallbackType callback); |
|
38 |
|
39 virtual void* GetHWCDevice(); |
|
40 |
|
41 virtual void* GetFBSurface(); |
|
42 |
|
43 virtual bool SwapBuffers(EGLDisplay dpy, EGLSurface sur); |
|
44 |
|
45 virtual ANativeWindowBuffer* DequeueBuffer(); |
|
46 |
|
47 virtual bool QueueBuffer(ANativeWindowBuffer* buf); |
|
48 |
|
49 virtual void UpdateFBSurface(EGLDisplay dpy, EGLSurface sur); |
|
50 |
|
51 virtual void SetFBReleaseFd(int fd); |
|
52 |
|
53 virtual int GetPrevFBAcquireFd(); |
|
54 |
|
55 bool Post(buffer_handle_t buf, int fence); |
|
56 |
|
57 private: |
|
58 hw_module_t const* mModule; |
|
59 hw_module_t const* mFBModule; |
|
60 hwc_composer_device_1_t* mHwc; |
|
61 framebuffer_device_t* mFBDevice; |
|
62 power_module_t* mPowerModule; |
|
63 android::sp<android::FramebufferSurface> mFBSurface; |
|
64 android::sp<ANativeWindow> mSTClient; |
|
65 android::sp<android::IGraphicBufferAlloc> mAlloc; |
|
66 android::sp<android::GraphicBuffer> mBootAnimBuffer; |
|
67 hwc_display_contents_1_t* mList; |
|
68 uint32_t mWidth; |
|
69 uint32_t mHeight; |
|
70 OnEnabledCallbackType mEnabledCallback; |
|
71 }; |
|
72 |
|
73 } |
|
74 |
|
75 #endif /* GONKDISPLAYJB_H */ |