Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f2f5ff7 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

rename DisplayHardware to DisplayDevice

Change-Id: I3f7250cd914e0da4f9ec2c9403587bbe12f3cc62
parent be246f86
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3,13 +3,13 @@ include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
    Client.cpp                              \
    DisplayHardware.cpp     				\
    DisplayDevice.cpp                       \
    EventThread.cpp                         \
    Layer.cpp                               \
    LayerBase.cpp                           \
    LayerDim.cpp                            \
    LayerScreenshot.cpp                     \
    DisplayHardware/DisplayHardwareBase.cpp \
    DisplayHardware/DisplayDeviceBase.cpp   \
    DisplayHardware/FramebufferSurface.cpp  \
    DisplayHardware/HWComposer.cpp          \
    DisplayHardware/PowerHAL.cpp            \
+31 −31
Original line number Diff line number Diff line
@@ -34,10 +34,10 @@
#include <hardware/gralloc.h>

#include "DisplayHardware/FramebufferSurface.h"
#include "DisplayHardware/DisplayHardwareBase.h"
#include "DisplayHardware/DisplayDeviceBase.h"
#include "DisplayHardware/HWComposer.h"

#include "DisplayHardware.h"
#include "DisplayDevice.h"
#include "GLExtensions.h"
#include "SurfaceFlinger.h"
#include "LayerBase.h"
@@ -98,12 +98,12 @@ void checkEGLErrors(const char* token)
 *
 */

DisplayHardware::DisplayHardware(
DisplayDevice::DisplayDevice(
        const sp<SurfaceFlinger>& flinger,
        int display,
        const sp<SurfaceTextureClient>& surface,
        EGLConfig config)
    : DisplayHardwareBase(display),
    : DisplayDeviceBase(display),
      mFlinger(flinger),
      mDisplayId(display),
      mNativeWindow(surface),
@@ -114,42 +114,42 @@ DisplayHardware::DisplayHardware(
    init(config);
}

DisplayHardware::~DisplayHardware() {
DisplayDevice::~DisplayDevice() {
}

float DisplayHardware::getDpiX() const {
float DisplayDevice::getDpiX() const {
    return mDpiX;
}

float DisplayHardware::getDpiY() const {
float DisplayDevice::getDpiY() const {
    return mDpiY;
}

float DisplayHardware::getDensity() const {
float DisplayDevice::getDensity() const {
    return mDensity;
}

float DisplayHardware::getRefreshRate() const {
float DisplayDevice::getRefreshRate() const {
    return mRefreshRate;
}

int DisplayHardware::getWidth() const {
int DisplayDevice::getWidth() const {
    return mDisplayWidth;
}

int DisplayHardware::getHeight() const {
int DisplayDevice::getHeight() const {
    return mDisplayHeight;
}

PixelFormat DisplayHardware::getFormat() const {
PixelFormat DisplayDevice::getFormat() const {
    return mFormat;
}

EGLSurface DisplayHardware::getEGLSurface() const {
EGLSurface DisplayDevice::getEGLSurface() const {
    return mSurface;
}

status_t DisplayHardware::getInfo(DisplayInfo* info) const {
status_t DisplayDevice::getInfo(DisplayInfo* info) const {
    info->w = getWidth();
    info->h = getHeight();
    info->xdpi = getDpiX();
@@ -162,7 +162,7 @@ status_t DisplayHardware::getInfo(DisplayInfo* info) const {
    return NO_ERROR;
}

void DisplayHardware::init(EGLConfig config)
void DisplayDevice::init(EGLConfig config)
{
    ANativeWindow* const window = mNativeWindow.get();

@@ -241,14 +241,14 @@ void DisplayHardware::init(EGLConfig config)
    mPageFlipCount = 0;

    // initialize the display orientation transform.
    DisplayHardware::setOrientation(ISurfaceComposer::eOrientationDefault);
    DisplayDevice::setOrientation(ISurfaceComposer::eOrientationDefault);
}

uint32_t DisplayHardware::getPageFlipCount() const {
uint32_t DisplayDevice::getPageFlipCount() const {
    return mPageFlipCount;
}

nsecs_t DisplayHardware::getRefreshTimestamp() const {
nsecs_t DisplayDevice::getRefreshTimestamp() const {
    // this returns the last refresh timestamp.
    // if the last one is not available, we estimate it based on
    // the refresh period and whatever closest timestamp we have.
@@ -257,23 +257,23 @@ nsecs_t DisplayHardware::getRefreshTimestamp() const {
    return now - ((now - mLastHwVSync) %  mRefreshPeriod);
}

nsecs_t DisplayHardware::getRefreshPeriod() const {
nsecs_t DisplayDevice::getRefreshPeriod() const {
    return mRefreshPeriod;
}

status_t DisplayHardware::compositionComplete() const {
status_t DisplayDevice::compositionComplete() const {
    if (mFramebufferSurface == NULL) {
        return NO_ERROR;
    }
    return mFramebufferSurface->compositionComplete();
}

void DisplayHardware::onVSyncReceived(nsecs_t timestamp) {
void DisplayDevice::onVSyncReceived(nsecs_t timestamp) {
    Mutex::Autolock _l(mLock);
    mLastHwVSync = timestamp;
}

void DisplayHardware::flip(const Region& dirty) const
void DisplayDevice::flip(const Region& dirty) const
{
    checkGLErrors();

@@ -298,19 +298,19 @@ void DisplayHardware::flip(const Region& dirty) const
    mPageFlipCount++;
}

uint32_t DisplayHardware::getFlags() const
uint32_t DisplayDevice::getFlags() const
{
    return mFlags;
}

void DisplayHardware::dump(String8& res) const
void DisplayDevice::dump(String8& res) const
{
    if (mFramebufferSurface != NULL) {
        mFramebufferSurface->dump(res);
    }
}

void DisplayHardware::makeCurrent(const DisplayHardware& hw, EGLContext ctx) {
void DisplayDevice::makeCurrent(const DisplayDevice& hw, EGLContext ctx) {
    EGLSurface sur = eglGetCurrentSurface(EGL_DRAW);
    if (sur != hw.mSurface) {
        EGLDisplay dpy = eglGetCurrentDisplay();
@@ -320,7 +320,7 @@ void DisplayHardware::makeCurrent(const DisplayHardware& hw, EGLContext ctx) {

// ----------------------------------------------------------------------------

void DisplayHardware::setVisibleLayersSortedByZ(const Vector< sp<LayerBase> >& layers) {
void DisplayDevice::setVisibleLayersSortedByZ(const Vector< sp<LayerBase> >& layers) {
    mVisibleLayersSortedByZ = layers;
    size_t count = layers.size();
    for (size_t i=0 ; i<count ; i++) {
@@ -330,17 +330,17 @@ void DisplayHardware::setVisibleLayersSortedByZ(const Vector< sp<LayerBase> >& l
    }
}

Vector< sp<LayerBase> > DisplayHardware::getVisibleLayersSortedByZ() const {
Vector< sp<LayerBase> > DisplayDevice::getVisibleLayersSortedByZ() const {
    return mVisibleLayersSortedByZ;
}

bool DisplayHardware::getSecureLayerVisible() const {
bool DisplayDevice::getSecureLayerVisible() const {
    return mSecureLayerVisible;
}

// ----------------------------------------------------------------------------

status_t DisplayHardware::orientationToTransfrom(
status_t DisplayDevice::orientationToTransfrom(
        int orientation, int w, int h, Transform* tr)
{
    uint32_t flags = 0;
@@ -364,11 +364,11 @@ status_t DisplayHardware::orientationToTransfrom(
    return NO_ERROR;
}

status_t DisplayHardware::setOrientation(int orientation) {
status_t DisplayDevice::setOrientation(int orientation) {
    int w = mDisplayWidth;
    int h = mDisplayHeight;

    DisplayHardware::orientationToTransfrom(
    DisplayDevice::orientationToTransfrom(
            orientation, w, h, &mGlobalTransform);
    if (orientation & ISurfaceComposer::eOrientationSwapMask) {
        int tmp = w;
+5 −5
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@

#include "Transform.h"

#include "DisplayHardware/DisplayHardwareBase.h"
#include "DisplayHardware/DisplayDeviceBase.h"

namespace android {

@@ -42,7 +42,7 @@ class LayerBase;
class SurfaceFlinger;
class SurfaceTextureClient;

class DisplayHardware : public DisplayHardwareBase
class DisplayDevice : public DisplayDeviceBase
{
public:
    // region in layer-stack space
@@ -57,13 +57,13 @@ public:
        SWAP_RECTANGLE  = 0x00080000,
    };

    DisplayHardware(
    DisplayDevice(
            const sp<SurfaceFlinger>& flinger,
            int dpy,
            const sp<SurfaceTextureClient>& surface,
            EGLConfig config);

    virtual ~DisplayHardware();
    virtual ~DisplayDevice();

    // Flip the front and back buffers if the back buffer is "dirty".  Might
    // be instantaneous, might involve copying the frame buffer around.
@@ -107,7 +107,7 @@ public:
    }
    inline Rect bounds() const { return getBounds(); }

    static void makeCurrent(const DisplayHardware& hw, EGLContext ctx);
    static void makeCurrent(const DisplayDevice& hw, EGLContext ctx);

private:
    void init(EGLConfig config);
+7 −7
Original line number Diff line number Diff line
@@ -17,31 +17,31 @@
#include <stdint.h>
#include <sys/types.h>

#include "DisplayHardware/DisplayHardwareBase.h"
#include "DisplayHardware/DisplayDeviceBase.h"

// ----------------------------------------------------------------------------
namespace android {

DisplayHardwareBase::DisplayHardwareBase(uint32_t displayIndex) {
DisplayDeviceBase::DisplayDeviceBase(uint32_t displayIndex) {
    mScreenAcquired = true;
}

DisplayHardwareBase::~DisplayHardwareBase() {
DisplayDeviceBase::~DisplayDeviceBase() {
}

bool DisplayHardwareBase::canDraw() const {
bool DisplayDeviceBase::canDraw() const {
    return mScreenAcquired;
}

void DisplayHardwareBase::releaseScreen() const {
void DisplayDeviceBase::releaseScreen() const {
    mScreenAcquired = false;
}

void DisplayHardwareBase::acquireScreen() const {
void DisplayDeviceBase::acquireScreen() const {
    mScreenAcquired = true;
}

bool DisplayHardwareBase::isScreenAcquired() const {
bool DisplayDeviceBase::isScreenAcquired() const {
    return mScreenAcquired;
}

+3 −3
Original line number Diff line number Diff line
@@ -21,10 +21,10 @@

namespace android {

class DisplayHardwareBase {
class DisplayDeviceBase {
public:
    DisplayHardwareBase(uint32_t displayIndex);
    ~DisplayHardwareBase();
    DisplayDeviceBase(uint32_t displayIndex);
    ~DisplayDeviceBase();

    // console management
    void releaseScreen() const;
Loading