cleanups in preparation of bigger changes
- fix typo drawForSreenshot misspelled
- get rid of DisplayDeviceBase
- removed unused or unneeded code
- always pass a DisplayDevice to Layer methods that are called
on a per-display basis (to make it clear that this could be
called more than once per composition).
Change-Id: Id948b7e09fe5c06db0e42d40d6ed75dd095c7f44
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp
index 70ce2d9..b09b77c 100644
--- a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -34,7 +34,6 @@
#include <hardware/gralloc.h>
#include "DisplayHardware/FramebufferSurface.h"
-#include "DisplayHardware/DisplayDeviceBase.h"
#include "DisplayHardware/HWComposer.h"
#include "DisplayDevice.h"
@@ -103,13 +102,23 @@
int display,
const sp<SurfaceTextureClient>& surface,
EGLConfig config)
- : DisplayDeviceBase(display),
- mFlinger(flinger),
- mDisplayId(display),
- mNativeWindow(surface),
- mFlags(0),
- mSecureLayerVisible(false),
- mLayerStack(0)
+ : mFlinger(flinger),
+ mDisplayId(display),
+ mNativeWindow(surface),
+ mDisplay(EGL_NO_DISPLAY),
+ mSurface(EGL_NO_SURFACE),
+ mContext(EGL_NO_CONTEXT),
+ mDpiX(), mDpiY(),
+ mRefreshRate(),
+ mDensity(),
+ mDisplayWidth(), mDisplayHeight(), mFormat(),
+ mFlags(),
+ mPageFlipCount(),
+ mRefreshPeriod(),
+ mSecureLayerVisible(false),
+ mScreenAcquired(false),
+ mOrientation(),
+ mLayerStack(0)
{
init(config);
}
@@ -248,15 +257,6 @@
return mPageFlipCount;
}
-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.
- Mutex::Autolock _l(mLock);
- nsecs_t now = systemTime(CLOCK_MONOTONIC);
- return now - ((now - mLastHwVSync) % mRefreshPeriod);
-}
-
nsecs_t DisplayDevice::getRefreshPeriod() const {
return mRefreshPeriod;
}
@@ -268,11 +268,6 @@
return mFramebufferSurface->compositionComplete();
}
-void DisplayDevice::onVSyncReceived(nsecs_t timestamp) {
- Mutex::Autolock _l(mLock);
- mLastHwVSync = timestamp;
-}
-
void DisplayDevice::flip(const Region& dirty) const
{
checkGLErrors();
@@ -340,6 +335,24 @@
// ----------------------------------------------------------------------------
+bool DisplayDevice::canDraw() const {
+ return mScreenAcquired;
+}
+
+void DisplayDevice::releaseScreen() const {
+ mScreenAcquired = false;
+}
+
+void DisplayDevice::acquireScreen() const {
+ mScreenAcquired = true;
+}
+
+bool DisplayDevice::isScreenAcquired() const {
+ return mScreenAcquired;
+}
+
+// ----------------------------------------------------------------------------
+
status_t DisplayDevice::orientationToTransfrom(
int orientation, int w, int h, Transform* tr)
{