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 \
#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"
*
*/
-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),
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();
return NO_ERROR;
}
-void DisplayHardware::init(EGLConfig config)
+void DisplayDevice::init(EGLConfig config)
{
ANativeWindow* const window = mNativeWindow.get();
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.
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();
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();
// ----------------------------------------------------------------------------
-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++) {
}
}
-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;
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;
#include "Transform.h"
-#include "DisplayHardware/DisplayHardwareBase.h"
+#include "DisplayHardware/DisplayDeviceBase.h"
namespace android {
class SurfaceFlinger;
class SurfaceTextureClient;
-class DisplayHardware : public DisplayHardwareBase
+class DisplayDevice : public DisplayDeviceBase
{
public:
// region in layer-stack space
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.
}
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);
#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;
}
namespace android {
-class DisplayHardwareBase {
+class DisplayDeviceBase {
public:
- DisplayHardwareBase(uint32_t displayIndex);
- ~DisplayHardwareBase();
+ DisplayDeviceBase(uint32_t displayIndex);
+ ~DisplayDeviceBase();
// console management
void releaseScreen() const;
#include <utils/String8.h>
#include <utils/Trace.h>
-#include "DisplayHardware.h"
#include "EventThread.h"
#include "SurfaceFlinger.h"
#include <utils/threads.h>
#include <utils/SortedVector.h>
-#include "DisplayHardware.h"
#include "DisplayHardware/PowerHAL.h"
// ---------------------------------------------------------------------------
#include <gui/Surface.h>
#include "clz.h"
-#include "DisplayHardware.h"
+#include "DisplayDevice.h"
#include "GLExtensions.h"
#include "Layer.h"
#include "SurfaceFlinger.h"
}
if (mFrameLatencyNeeded) {
- // we need a DisplayHardware for debugging only right now
- // XXX: should this be called per DisplayHardware?
- const DisplayHardware& hw(mFlinger->getDefaultDisplayHardware());
+ // we need a DisplayDevice for debugging only right now
+ // XXX: should this be called per DisplayDevice?
+ const DisplayDevice& hw(mFlinger->getDefaultDisplayDevice());
mFrameStats[mFrameLatencyOffset].timestamp = mSurfaceTexture->getTimestamp();
mFrameStats[mFrameLatencyOffset].set = systemTime();
mFrameStats[mFrameLatencyOffset].vsync = hw.getRefreshTimestamp();
}
void Layer::setGeometry(
- const DisplayHardware& hw,
+ const DisplayDevice& hw,
HWComposer::HWCLayerInterface& layer)
{
LayerBaseClient::setGeometry(hw, layer);
layer.setAcquireFenceFd(fenceFd);
}
-void Layer::onDraw(const DisplayHardware& hw, const Region& clip) const
+void Layer::onDraw(const DisplayDevice& hw, const Region& clip) const
{
ATRACE_CALL();
{
LayerBaseClient::dumpStats(result, buffer, SIZE);
const size_t o = mFrameLatencyOffset;
- const DisplayHardware& hw(mFlinger->getDefaultDisplayHardware());
+ const DisplayDevice& hw(mFlinger->getDefaultDisplayDevice());
const nsecs_t period = hw.getRefreshPeriod();
result.appendFormat("%lld\n", period);
for (size_t i=0 ; i<128 ; i++) {
// apply to all displays.
// This is why we use the default display here. This is not an
// oversight.
- const DisplayHardware& hw(mFlinger->getDefaultDisplayHardware());
+ const DisplayDevice& hw(mFlinger->getDefaultDisplayDevice());
const Transform& planeTransform(hw.getTransform());
orientation = planeTransform.getOrientation();
if (orientation & Transform::ROT_INVALID) {
bool isFixedSize() const;
// LayerBase interface
- virtual void setGeometry(const DisplayHardware& hw,
+ virtual void setGeometry(const DisplayDevice& hw,
HWComposer::HWCLayerInterface& layer);
virtual void setPerFrameData(HWComposer::HWCLayerInterface& layer);
virtual void setAcquireFence(HWComposer::HWCLayerInterface& layer);
- virtual void onDraw(const DisplayHardware& hw, const Region& clip) const;
+ virtual void onDraw(const DisplayDevice& hw, const Region& clip) const;
virtual uint32_t doTransaction(uint32_t transactionFlags);
virtual Region latchBuffer(bool& recomputeVisibleRegions);
virtual bool isOpaque() const;
#include "LayerBase.h"
#include "Layer.h"
#include "SurfaceFlinger.h"
-#include "DisplayHardware.h"
+#include "DisplayDevice.h"
namespace android {
return flags;
}
-void LayerBase::computeGeometry(const DisplayHardware& hw, LayerMesh* mesh) const
+void LayerBase::computeGeometry(const DisplayDevice& hw, LayerMesh* mesh) const
{
const Layer::State& s(drawingState());
const Transform tr(hw.getTransform() * s.transform);
}
void LayerBase::setGeometry(
- const DisplayHardware& hw,
+ const DisplayDevice& hw,
HWComposer::HWCLayerInterface& layer)
{
layer.setDefaultState();
return mFiltering;
}
-void LayerBase::draw(const DisplayHardware& hw, const Region& clip) const
+void LayerBase::draw(const DisplayDevice& hw, const Region& clip) const
{
onDraw(hw, clip);
}
-void LayerBase::drawForSreenShot(const DisplayHardware& hw)
+void LayerBase::drawForSreenShot(const DisplayDevice& hw)
{
setFiltering(true);
onDraw( hw, Region(hw.bounds()) );
setFiltering(false);
}
-void LayerBase::clearWithOpenGL(const DisplayHardware& hw, const Region& clip,
+void LayerBase::clearWithOpenGL(const DisplayDevice& hw, const Region& clip,
GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) const
{
const uint32_t fbHeight = hw.getHeight();
glDrawArrays(GL_TRIANGLE_FAN, 0, mesh.getVertexCount());
}
-void LayerBase::clearWithOpenGL(const DisplayHardware& hw, const Region& clip) const
+void LayerBase::clearWithOpenGL(const DisplayDevice& hw, const Region& clip) const
{
clearWithOpenGL(hw, clip, 0,0,0,0);
}
-void LayerBase::drawWithOpenGL(const DisplayHardware& hw, const Region& clip) const
+void LayerBase::drawWithOpenGL(const DisplayDevice& hw, const Region& clip) const
{
const uint32_t fbHeight = hw.getHeight();
const State& s(drawingState());
#include <private/gui/LayerState.h>
-#include "DisplayHardware.h"
#include "Transform.h"
#include "DisplayHardware/HWComposer.h"
// ---------------------------------------------------------------------------
class Client;
-class DisplayHardware;
+class DisplayDevice;
class GraphicBuffer;
class Layer;
class LayerBaseClient;
uint32_t getTransactionFlags(uint32_t flags);
uint32_t setTransactionFlags(uint32_t flags);
- void computeGeometry(const DisplayHardware& hw, LayerMesh* mesh) const;
+ void computeGeometry(const DisplayDevice& hw, LayerMesh* mesh) const;
Rect computeBounds() const;
virtual const char* getTypeId() const { return "LayerBase"; }
- virtual void setGeometry(const DisplayHardware& hw,
+ virtual void setGeometry(const DisplayDevice& hw,
HWComposer::HWCLayerInterface& layer);
virtual void setPerFrameData(HWComposer::HWCLayerInterface& layer);
virtual void setAcquireFence(HWComposer::HWCLayerInterface& layer);
* Typically this method is not overridden, instead implement onDraw()
* to perform the actual drawing.
*/
- virtual void draw(const DisplayHardware& hw, const Region& clip) const;
- virtual void drawForSreenShot(const DisplayHardware& hw);
+ virtual void draw(const DisplayDevice& hw, const Region& clip) const;
+ virtual void drawForSreenShot(const DisplayDevice& hw);
/**
* onDraw - draws the surface.
*/
- virtual void onDraw(const DisplayHardware& hw, const Region& clip) const = 0;
+ virtual void onDraw(const DisplayDevice& hw, const Region& clip) const = 0;
/**
* initStates - called just after construction
inline const State& currentState() const { return mCurrentState; }
inline State& currentState() { return mCurrentState; }
- void clearWithOpenGL(const DisplayHardware& hw, const Region& clip) const;
+ void clearWithOpenGL(const DisplayDevice& hw, const Region& clip) const;
protected:
- void clearWithOpenGL(const DisplayHardware& hw, const Region& clip,
+ void clearWithOpenGL(const DisplayDevice& hw, const Region& clip,
GLclampf r, GLclampf g, GLclampf b, GLclampf alpha) const;
- void drawWithOpenGL(const DisplayHardware& hw, const Region& clip) const;
+ void drawWithOpenGL(const DisplayDevice& hw, const Region& clip) const;
void setFiltering(bool filtering);
bool getFiltering() const;
#include "LayerDim.h"
#include "SurfaceFlinger.h"
-#include "DisplayHardware.h"
+#include "DisplayDevice.h"
namespace android {
// ---------------------------------------------------------------------------
{
}
-void LayerDim::onDraw(const DisplayHardware& hw, const Region& clip) const
+void LayerDim::onDraw(const DisplayDevice& hw, const Region& clip) const
{
const State& s(drawingState());
if (s.alpha>0) {
const sp<Client>& client);
virtual ~LayerDim();
- virtual void onDraw(const DisplayHardware& hw, const Region& clip) const;
+ virtual void onDraw(const DisplayDevice& hw, const Region& clip) const;
virtual bool isOpaque() const { return false; }
virtual bool isSecure() const { return false; }
virtual bool isProtectedByApp() const { return false; }
#include "LayerScreenshot.h"
#include "SurfaceFlinger.h"
-#include "DisplayHardware.h"
+#include "DisplayDevice.h"
namespace android {
return LayerBaseClient::doTransaction(flags);
}
-void LayerScreenshot::onDraw(const DisplayHardware& hw, const Region& clip) const
+void LayerScreenshot::onDraw(const DisplayDevice& hw, const Region& clip) const
{
const State& s(drawingState());
if (s.alpha>0) {
virtual void initStates(uint32_t w, uint32_t h, uint32_t flags);
virtual uint32_t doTransaction(uint32_t flags);
- virtual void onDraw(const DisplayHardware& hw, const Region& clip) const;
+ virtual void onDraw(const DisplayDevice& hw, const Region& clip) const;
virtual bool isOpaque() const { return false; }
virtual bool isSecure() const { return false; }
virtual bool isProtectedByApp() const { return false; }
#include "clz.h"
#include "DdmConnection.h"
-#include "DisplayHardware.h"
+#include "DisplayDevice.h"
#include "Client.h"
#include "EventThread.h"
#include "GLExtensions.h"
mEGLContext = createGLContext(mEGLDisplay, mEGLConfig);
// initialize our main display hardware
- DisplayHardware* const hw = new DisplayHardware(this, 0, anw, mEGLConfig);
- mDisplayHardwares[0] = hw;
+ DisplayDevice* const hw = new DisplayDevice(this, 0, anw, mEGLConfig);
+ mDisplayDevices[0] = hw;
// initialize OpenGL ES
EGLSurface surface = hw->getEGLSurface();
if (uint32_t(dpy) >= 2) {
return BAD_INDEX;
}
- const DisplayHardware& hw(getDefaultDisplayHardware());
+ const DisplayDevice& hw(getDefaultDisplayDevice());
return hw.getInfo(info);
}
}
void SurfaceFlinger::connectDisplay(const sp<ISurfaceTexture> display) {
- const DisplayHardware& hw(getDefaultDisplayHardware());
+ const DisplayDevice& hw(getDefaultDisplayDevice());
EGLSurface result = EGL_NO_SURFACE;
EGLSurface old_surface = EGL_NO_SURFACE;
sp<SurfaceTextureClient> stc;
}
void SurfaceFlinger::onVSyncReceived(int dpy, nsecs_t timestamp) {
- DisplayHardware& hw(const_cast<DisplayHardware&>(getDisplayHardware(dpy)));
+ DisplayDevice& hw(const_cast<DisplayDevice&>(getDisplayDevice(dpy)));
hw.onVSyncReceived(timestamp);
mEventThread->onVSyncReceived(dpy, timestamp);
}
const LayerVector& currentLayers(mDrawingState.layersSortedByZ);
for (int dpy=0 ; dpy<1 ; dpy++) { // TODO: iterate through all displays
- DisplayHardware& hw(const_cast<DisplayHardware&>(getDisplayHardware(dpy)));
+ DisplayDevice& hw(const_cast<DisplayDevice&>(getDisplayDevice(dpy)));
Region opaqueRegion;
Region dirtyRegion;
const bool workListsDirty = mHwWorkListDirty;
mHwWorkListDirty = false;
for (int dpy=0 ; dpy<1 ; dpy++) { // TODO: iterate through all displays
- DisplayHardware& hw(const_cast<DisplayHardware&>(getDisplayHardware(dpy)));
+ DisplayDevice& hw(const_cast<DisplayDevice&>(getDisplayDevice(dpy)));
const Vector< sp<LayerBase> >& currentLayers(hw.getVisibleLayersSortedByZ());
const size_t count = currentLayers.size();
const bool repaintEverything = android_atomic_and(0, &mRepaintEverything);
for (int dpy=0 ; dpy<1 ; dpy++) { // TODO: iterate through all displays
- DisplayHardware& hw(const_cast<DisplayHardware&>(getDisplayHardware(dpy)));
+ DisplayDevice& hw(const_cast<DisplayDevice&>(getDisplayDevice(dpy)));
// transform the dirty region into this screen's coordinate space
const Transform& planeTransform(hw.getTransform());
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- DisplayHardware& hw(const_cast<DisplayDevice&>(getDisplayHardware(0)));
+ DisplayDevice& hw(const_cast<DisplayDevice&>(getDisplayDevice(0)));
const Vector< sp<LayerBase> >& layers( hw.getVisibleLayersSortedByZ() );
const size_t count = layers.size();
for (size_t i=0 ; i<count ; ++i) {
HWComposer& hwc(getHwComposer());
for (int dpy=0 ; dpy<1 ; dpy++) { // TODO: iterate through all displays
- DisplayHardware& hw(const_cast<DisplayHardware&>(getDisplayHardware(dpy)));
+ DisplayDevice& hw(const_cast<DisplayDevice&>(getDisplayDevice(dpy)));
if (hwc.initCheck() == NO_ERROR) {
const Vector< sp<LayerBase> >& currentLayers(hw.getVisibleLayersSortedByZ());
const size_t count = currentLayers.size();
if (hwc.initCheck() == NO_ERROR) {
// FIXME: eventually commit() won't take arguments
- hwc.commit(mEGLDisplay, getDefaultDisplayHardware().getEGLSurface());
+ hwc.commit(mEGLDisplay, getDefaultDisplayDevice().getEGLSurface());
}
for (int dpy=0 ; dpy<1 ; dpy++) { // TODO: iterate through all displays
- DisplayHardware& hw(const_cast<DisplayHardware&>(getDisplayHardware(dpy)));
+ DisplayDevice& hw(const_cast<DisplayDevice&>(getDisplayDevice(dpy)));
const Vector< sp<LayerBase> >& currentLayers(hw.getVisibleLayersSortedByZ());
const size_t count = currentLayers.size();
if (hwc.initCheck() == NO_ERROR) {
// and invalidate everything.
const int dpy = 0; // FIXME: should be a parameter
- DisplayHardware& hw(const_cast<DisplayHardware&>(getDisplayHardware(dpy)));
+ DisplayDevice& hw(const_cast<DisplayDevice&>(getDisplayDevice(dpy)));
hw.setOrientation(mCurrentState.orientation);
hw.dirtyRegion.set(hw.bounds());
const Region& dirty) {
// FIXME: update the dirty region of all displays
// presenting this layer's layer stack.
- DisplayHardware& hw(const_cast<DisplayHardware&>(getDisplayHardware(0)));
+ DisplayDevice& hw(const_cast<DisplayDevice&>(getDisplayDevice(0)));
hw.dirtyRegion.orSelf(dirty);
}
}
}
-void SurfaceFlinger::handleRepaint(const DisplayHardware& hw,
+void SurfaceFlinger::handleRepaint(const DisplayDevice& hw,
const Region& inDirtyRegion)
{
ATRACE_CALL();
}
uint32_t flags = hw.getFlags();
- if (flags & DisplayHardware::SWAP_RECTANGLE) {
+ if (flags & DisplayDevice::SWAP_RECTANGLE) {
// we can redraw only what's dirty, but since SWAP_RECTANGLE only
// takes a rectangle, we must make sure to update that whole
// rectangle in that case
dirtyRegion.set(hw.swapRegion.bounds());
} else {
- if (flags & DisplayHardware::PARTIAL_UPDATES) {
+ if (flags & DisplayDevice::PARTIAL_UPDATES) {
// We need to redraw the rectangle that will be updated
// (pushed to the framebuffer).
// This is needed because PARTIAL_UPDATES only takes one
- // rectangle instead of a region (see DisplayHardware::flip())
+ // rectangle instead of a region (see DisplayDevice::flip())
dirtyRegion.set(hw.swapRegion.bounds());
} else {
// we need to redraw everything (the whole screen)
hw.swapRegion.orSelf(dirtyRegion);
}
-void SurfaceFlinger::composeSurfaces(const DisplayHardware& hw, const Region& dirty)
+void SurfaceFlinger::composeSurfaces(const DisplayDevice& hw, const Region& dirty)
{
HWComposer& hwc(getHwComposer());
HWComposer::LayerListIterator cur = hwc.begin();
const size_t fbLayerCount = hwc.getLayerCount(HWC_FRAMEBUFFER); // FIXME: this should be per display
if (cur==end || fbLayerCount) {
- DisplayHardware::makeCurrent(hw, mEGLContext);
+ DisplayDevice::makeCurrent(hw, mEGLContext);
// set the frame buffer
glMatrixMode(GL_MODELVIEW);
}
}
-void SurfaceFlinger::debugFlashRegions(const DisplayHardware& hw,
+void SurfaceFlinger::debugFlashRegions(const DisplayDevice& hw,
const Region& dirtyRegion)
{
const uint32_t flags = hw.getFlags();
return;
}
- if (!(flags & DisplayHardware::SWAP_RECTANGLE)) {
- const Region repaint((flags & DisplayHardware::PARTIAL_UPDATES) ?
+ if (!(flags & DisplayDevice::SWAP_RECTANGLE)) {
+ const Region repaint((flags & DisplayDevice::PARTIAL_UPDATES) ?
dirtyRegion.bounds() : hw.bounds());
composeSurfaces(hw, repaint);
}
void SurfaceFlinger::onScreenAcquired() {
ALOGD("Screen about to return, flinger = %p", this);
- const DisplayHardware& hw(getDefaultDisplayHardware()); // XXX: this should be per DisplayHardware
+ const DisplayDevice& hw(getDefaultDisplayDevice()); // XXX: this should be per DisplayDevice
getHwComposer().acquire();
hw.acquireScreen();
mEventThread->onScreenAcquired();
void SurfaceFlinger::onScreenReleased() {
ALOGD("About to give-up screen, flinger = %p", this);
- const DisplayHardware& hw(getDefaultDisplayHardware()); // XXX: this should be per DisplayHardware
+ const DisplayDevice& hw(getDefaultDisplayDevice()); // XXX: this should be per DisplayDevice
if (hw.isScreenAcquired()) {
mEventThread->onScreenReleased();
hw.releaseScreen();
snprintf(buffer, SIZE, "SurfaceFlinger global state:\n");
result.append(buffer);
- const DisplayHardware& hw(getDefaultDisplayHardware());
+ const DisplayDevice& hw(getDefaultDisplayDevice());
const GLExtensions& extensions(GLExtensions::getInstance());
snprintf(buffer, SIZE, "GLES: %s, %s, %s\n",
extensions.getVendor(),
return NO_ERROR;
case 1013: {
Mutex::Autolock _l(mStateLock);
- const DisplayHardware& hw(getDefaultDisplayHardware());
+ const DisplayDevice& hw(getDefaultDisplayDevice());
reply->writeInt32(hw.getPageFlipCount());
}
return NO_ERROR;
return INVALID_OPERATION;
// get screen geometry
- const DisplayHardware& hw(getDisplayHardware(dpy));
+ const DisplayDevice& hw(getDisplayDevice(dpy));
const uint32_t hw_w = hw.getWidth();
const uint32_t hw_h = hw.getHeight();
GLfloat u = 1;
status_t SurfaceFlinger::electronBeamOffAnimationImplLocked()
{
// get screen geometry
- const DisplayHardware& hw(getDefaultDisplayHardware());
+ const DisplayDevice& hw(getDefaultDisplayDevice());
const uint32_t hw_w = hw.getWidth();
const uint32_t hw_h = hw.getHeight();
const Region screenBounds(hw.getBounds());
// get screen geometry
- const DisplayHardware& hw(getDefaultDisplayHardware());
+ const DisplayDevice& hw(getDefaultDisplayDevice());
const uint32_t hw_w = hw.getWidth();
const uint32_t hw_h = hw.getHeight();
const Region screenBounds(hw.bounds());
{
ATRACE_CALL();
- DisplayHardware& hw(const_cast<DisplayHardware&>(getDefaultDisplayHardware()));
+ DisplayDevice& hw(const_cast<DisplayDevice&>(getDefaultDisplayDevice()));
if (!hw.canDraw()) {
// we're already off
return NO_ERROR;
status_t SurfaceFlinger::turnElectronBeamOnImplLocked(int32_t mode)
{
- DisplayHardware& hw(const_cast<DisplayHardware&>(getDefaultDisplayHardware()));
+ DisplayDevice& hw(const_cast<DisplayDevice&>(getDefaultDisplayDevice()));
if (hw.canDraw()) {
// we're already on
return NO_ERROR;
}
// get screen geometry
- const DisplayHardware& hw(getDisplayHardware(dpy));
+ const DisplayDevice& hw(getDisplayDevice(dpy));
const uint32_t hw_w = hw.getWidth();
const uint32_t hw_h = hw.getHeight();
class Client;
class DisplayEventConnection;
-class DisplayHardware;
+class DisplayDevice;
class EventThread;
class Layer;
class LayerBase;
GLfloat* uOut, GLfloat* vOut);
// returns the default Display
- const DisplayHardware& getDefaultDisplayHardware() const {
- return getDisplayHardware(0);
+ const DisplayDevice& getDefaultDisplayDevice() const {
+ return getDisplayDevice(0);
}
// utility function to delete a texture on the main thread
void handlePageFlip();
void handleRefresh();
- void handleRepaint(const DisplayHardware& hw, const Region& dirtyRegion);
+ void handleRepaint(const DisplayDevice& hw, const Region& dirtyRegion);
/* ------------------------------------------------------------------------
* Transactions
/* ------------------------------------------------------------------------
* Display and layer stack management
*/
- const DisplayHardware& getDisplayHardware(DisplayID dpy) const {
- return *mDisplayHardwares[dpy];
+ const DisplayDevice& getDisplayDevice(DisplayID dpy) const {
+ return *mDisplayDevices[dpy];
}
// mark a region of a layer stack dirty. this updates the dirty
uint32_t layerStack,
Region& dirtyRegion, Region& opaqueRegion);
void postFramebuffer();
- void composeSurfaces(const DisplayHardware& hw, const Region& dirty);
+ void composeSurfaces(const DisplayDevice& hw, const Region& dirty);
void drawWormhole(const Region& region) const;
GLuint getProtectedTexName() const {
return mProtectedTexName;
/* ------------------------------------------------------------------------
* Debugging & dumpsys
*/
- void debugFlashRegions(const DisplayHardware& hw, const Region& dirtyReg);
+ void debugFlashRegions(const DisplayDevice& hw, const Region& dirtyReg);
void listLayersLocked(const Vector<String16>& args, size_t& index,
String8& result, char* buffer, size_t SIZE) const;
void dumpStatsLocked(const Vector<String16>& args, size_t& index,
Vector<sp<LayerBase> > mLayersPendingRemoval;
// protected by mStateLock (but we could use another lock)
- DisplayHardware* mDisplayHardwares[1];
+ DisplayDevice* mDisplayDevices[1];
bool mLayersRemoved;
// access must be protected by mInvalidateLock