Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
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 */
16 #ifndef GONKDISPLAYJB_H
17 #define GONKDISPLAYJB_H
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"
26 namespace mozilla {
28 class GonkDisplayJB : public GonkDisplay {
29 public:
30 GonkDisplayJB();
31 ~GonkDisplayJB();
33 virtual ANativeWindow* GetNativeWindow();
35 virtual void SetEnabled(bool enabled);
37 virtual void OnEnabled(OnEnabledCallbackType callback);
39 virtual void* GetHWCDevice();
41 virtual void* GetFBSurface();
43 virtual bool SwapBuffers(EGLDisplay dpy, EGLSurface sur);
45 virtual ANativeWindowBuffer* DequeueBuffer();
47 virtual bool QueueBuffer(ANativeWindowBuffer* buf);
49 virtual void UpdateFBSurface(EGLDisplay dpy, EGLSurface sur);
51 virtual void SetFBReleaseFd(int fd);
53 virtual int GetPrevFBAcquireFd();
55 bool Post(buffer_handle_t buf, int fence);
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 };
73 }
75 #endif /* GONKDISPLAYJB_H */