michael@0: /* Copyright 2013 Mozilla Foundation and Mozilla contributors michael@0: * michael@0: * Licensed under the Apache License, Version 2.0 (the "License"); michael@0: * you may not use this file except in compliance with the License. michael@0: * You may obtain a copy of the License at michael@0: * michael@0: * http://www.apache.org/licenses/LICENSE-2.0 michael@0: * michael@0: * Unless required by applicable law or agreed to in writing, software michael@0: * distributed under the License is distributed on an "AS IS" BASIS, michael@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. michael@0: * See the License for the specific language governing permissions and michael@0: * limitations under the License. michael@0: */ michael@0: michael@0: #ifndef GONKDISPLAYJB_H michael@0: #define GONKDISPLAYJB_H michael@0: michael@0: #include "GonkDisplay.h" michael@0: #include "FramebufferSurface.h" michael@0: #include "hardware/hwcomposer.h" michael@0: #include "hardware/power.h" michael@0: #include "ui/Fence.h" michael@0: #include "utils/RefBase.h" michael@0: michael@0: namespace mozilla { michael@0: michael@0: class GonkDisplayJB : public GonkDisplay { michael@0: public: michael@0: GonkDisplayJB(); michael@0: ~GonkDisplayJB(); michael@0: michael@0: virtual ANativeWindow* GetNativeWindow(); michael@0: michael@0: virtual void SetEnabled(bool enabled); michael@0: michael@0: virtual void OnEnabled(OnEnabledCallbackType callback); michael@0: michael@0: virtual void* GetHWCDevice(); michael@0: michael@0: virtual void* GetFBSurface(); michael@0: michael@0: virtual bool SwapBuffers(EGLDisplay dpy, EGLSurface sur); michael@0: michael@0: virtual ANativeWindowBuffer* DequeueBuffer(); michael@0: michael@0: virtual bool QueueBuffer(ANativeWindowBuffer* buf); michael@0: michael@0: virtual void UpdateFBSurface(EGLDisplay dpy, EGLSurface sur); michael@0: michael@0: virtual void SetFBReleaseFd(int fd); michael@0: michael@0: virtual int GetPrevFBAcquireFd(); michael@0: michael@0: bool Post(buffer_handle_t buf, int fence); michael@0: michael@0: private: michael@0: hw_module_t const* mModule; michael@0: hw_module_t const* mFBModule; michael@0: hwc_composer_device_1_t* mHwc; michael@0: framebuffer_device_t* mFBDevice; michael@0: power_module_t* mPowerModule; michael@0: android::sp mFBSurface; michael@0: android::sp mSTClient; michael@0: android::sp mAlloc; michael@0: android::sp mBootAnimBuffer; michael@0: hwc_display_contents_1_t* mList; michael@0: uint32_t mWidth; michael@0: uint32_t mHeight; michael@0: OnEnabledCallbackType mEnabledCallback; michael@0: }; michael@0: michael@0: } michael@0: michael@0: #endif /* GONKDISPLAYJB_H */