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 GONKDISPLAYICS_H michael@0: #define GONKDISPLAYICS_H michael@0: michael@0: #include michael@0: michael@0: #include "GonkDisplay.h" michael@0: #include "ui/FramebufferNativeWindow.h" michael@0: #include "hardware/hwcomposer.h" michael@0: #include "utils/RefBase.h" michael@0: michael@0: namespace mozilla { michael@0: michael@0: class GonkDisplayICS : public GonkDisplay { michael@0: public: michael@0: GonkDisplayICS(); michael@0: ~GonkDisplayICS(); 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* handle); 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: return -1; michael@0: } michael@0: michael@0: private: michael@0: hw_module_t const* mModule; michael@0: hwc_composer_device_t* mHwc; michael@0: android::sp mFBSurface; michael@0: }; michael@0: michael@0: } michael@0: michael@0: #endif /* GONKDISPLAYICS_H */