widget/gonk/libdisplay/GonkDisplay.h

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

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 GONKDISPLAY_H
    17 #define GONKDISPLAY_H
    19 #include <system/window.h>
    21 namespace mozilla {
    23 namespace layers {
    24 class Layer;
    25 }
    27 typedef void * EGLDisplay;
    28 typedef void * EGLSurface;
    30 class GonkDisplay {
    31 public:
    32     virtual ANativeWindow* GetNativeWindow() = 0;
    34     virtual void SetEnabled(bool enabled) = 0;
    36     typedef void (*OnEnabledCallbackType)(bool enabled);
    38     virtual void OnEnabled(OnEnabledCallbackType callback) = 0;
    40     virtual void* GetHWCDevice() = 0;
    42     virtual void* GetFBSurface() = 0;
    44     virtual bool SwapBuffers(EGLDisplay dpy, EGLSurface sur) = 0;
    46     virtual ANativeWindowBuffer* DequeueBuffer() = 0;
    48     virtual bool QueueBuffer(ANativeWindowBuffer* buf) = 0;
    50     virtual void UpdateFBSurface(EGLDisplay dpy, EGLSurface sur) = 0;
    52     /**
    53      * Set FramebufferSurface ReleaseFence's file descriptor.
    54      * ReleaseFence will be signaled after the HWC has finished reading
    55      * from a buffer.
    56      */
    57     virtual void SetFBReleaseFd(int fd) = 0;
    59     /**
    60      * Get FramebufferSurface AcquireFence's file descriptor
    61      * AcquireFence will be signaled when a buffer's content is available.
    62      */
    63     virtual int GetPrevFBAcquireFd() = 0;
    65     float xdpi;
    66     uint32_t surfaceformat;
    67 };
    69 __attribute__ ((weak))
    70 GonkDisplay* GetGonkDisplay();
    72 }
    73 #endif /* GONKDISPLAY_H */

mercurial