1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/gonk/libdisplay/GonkDisplayJB.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,75 @@ 1.4 +/* Copyright 2013 Mozilla Foundation and Mozilla contributors 1.5 + * 1.6 + * Licensed under the Apache License, Version 2.0 (the "License"); 1.7 + * you may not use this file except in compliance with the License. 1.8 + * You may obtain a copy of the License at 1.9 + * 1.10 + * http://www.apache.org/licenses/LICENSE-2.0 1.11 + * 1.12 + * Unless required by applicable law or agreed to in writing, software 1.13 + * distributed under the License is distributed on an "AS IS" BASIS, 1.14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1.15 + * See the License for the specific language governing permissions and 1.16 + * limitations under the License. 1.17 + */ 1.18 + 1.19 +#ifndef GONKDISPLAYJB_H 1.20 +#define GONKDISPLAYJB_H 1.21 + 1.22 +#include "GonkDisplay.h" 1.23 +#include "FramebufferSurface.h" 1.24 +#include "hardware/hwcomposer.h" 1.25 +#include "hardware/power.h" 1.26 +#include "ui/Fence.h" 1.27 +#include "utils/RefBase.h" 1.28 + 1.29 +namespace mozilla { 1.30 + 1.31 +class GonkDisplayJB : public GonkDisplay { 1.32 +public: 1.33 + GonkDisplayJB(); 1.34 + ~GonkDisplayJB(); 1.35 + 1.36 + virtual ANativeWindow* GetNativeWindow(); 1.37 + 1.38 + virtual void SetEnabled(bool enabled); 1.39 + 1.40 + virtual void OnEnabled(OnEnabledCallbackType callback); 1.41 + 1.42 + virtual void* GetHWCDevice(); 1.43 + 1.44 + virtual void* GetFBSurface(); 1.45 + 1.46 + virtual bool SwapBuffers(EGLDisplay dpy, EGLSurface sur); 1.47 + 1.48 + virtual ANativeWindowBuffer* DequeueBuffer(); 1.49 + 1.50 + virtual bool QueueBuffer(ANativeWindowBuffer* buf); 1.51 + 1.52 + virtual void UpdateFBSurface(EGLDisplay dpy, EGLSurface sur); 1.53 + 1.54 + virtual void SetFBReleaseFd(int fd); 1.55 + 1.56 + virtual int GetPrevFBAcquireFd(); 1.57 + 1.58 + bool Post(buffer_handle_t buf, int fence); 1.59 + 1.60 +private: 1.61 + hw_module_t const* mModule; 1.62 + hw_module_t const* mFBModule; 1.63 + hwc_composer_device_1_t* mHwc; 1.64 + framebuffer_device_t* mFBDevice; 1.65 + power_module_t* mPowerModule; 1.66 + android::sp<android::FramebufferSurface> mFBSurface; 1.67 + android::sp<ANativeWindow> mSTClient; 1.68 + android::sp<android::IGraphicBufferAlloc> mAlloc; 1.69 + android::sp<android::GraphicBuffer> mBootAnimBuffer; 1.70 + hwc_display_contents_1_t* mList; 1.71 + uint32_t mWidth; 1.72 + uint32_t mHeight; 1.73 + OnEnabledCallbackType mEnabledCallback; 1.74 +}; 1.75 + 1.76 +} 1.77 + 1.78 +#endif /* GONKDISPLAYJB_H */