summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-08-22 21:44:41 -0700
committerMathias Agopian <mathias@google.com>2011-08-22 21:44:41 -0700
commit7f76a3cf667b95caccb3e6d3f5cf160180717340 (patch)
treedd0413c084d7d69cfd617cdd0b72edbbc3d998de /services/surfaceflinger
parent67403e096e6f59b7cd18a90d0d3f5c3d17c31407 (diff)
downloadframeworks_base-7f76a3cf667b95caccb3e6d3f5cf160180717340.zip
frameworks_base-7f76a3cf667b95caccb3e6d3f5cf160180717340.tar.gz
frameworks_base-7f76a3cf667b95caccb3e6d3f5cf160180717340.tar.bz2
fix "show screen update" debug option.
Change-Id: I7d8b24124768b5f7d59d3bb0b019e9baaa0dfc4f NOTE: from now on, this also disable the h/w composer
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp46
-rw-r--r--services/surfaceflinger/SurfaceFlinger.h1
2 files changed, 27 insertions, 20 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 50afb3d..1f27a70 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -822,7 +822,7 @@ void SurfaceFlinger::handleWorkList()
hwc_layer_t* const cur(hwc.getLayers());
for (size_t i=0 ; cur && i<count ; i++) {
currentLayers[i]->setGeometry(&cur[i]);
- if (mDebugDisableHWC) {
+ if (mDebugDisableHWC || mDebugRegion) {
cur[i].compositionType = HWC_FRAMEBUFFER;
cur[i].flags |= HWC_SKIP_LAYER;
}
@@ -974,6 +974,10 @@ void SurfaceFlinger::debugFlashRegions()
{
const DisplayHardware& hw(graphicPlane(0).displayHardware());
const uint32_t flags = hw.getFlags();
+ const int32_t height = hw.getHeight();
+ if (mInvalidRegion.isEmpty()) {
+ return;
+ }
if (!((flags & DisplayHardware::SWAP_RECTANGLE) ||
(flags & DisplayHardware::BUFFER_PRESERVED))) {
@@ -999,26 +1003,21 @@ void SurfaceFlinger::debugFlashRegions()
while (it != end) {
const Rect& r = *it++;
GLfloat vertices[][2] = {
- { r.left, r.top },
- { r.left, r.bottom },
- { r.right, r.bottom },
- { r.right, r.top }
+ { r.left, height - r.top },
+ { r.left, height - r.bottom },
+ { r.right, height - r.bottom },
+ { r.right, height - r.top }
};
glVertexPointer(2, GL_FLOAT, 0, vertices);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
- if (mInvalidRegion.isEmpty()) {
- mDirtyRegion.dump("mDirtyRegion");
- mInvalidRegion.dump("mInvalidRegion");
- }
hw.flip(mInvalidRegion);
if (mDebugRegion > 1)
usleep(mDebugRegion * 1000);
glEnable(GL_SCISSOR_TEST);
- //mDirtyRegion.dump("mDirtyRegion");
}
void SurfaceFlinger::drawWormhole() const
@@ -1581,7 +1580,7 @@ status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args)
HWComposer& hwc(hw.getHwComposer());
snprintf(buffer, SIZE, " h/w composer %s and %s\n",
hwc.initCheck()==NO_ERROR ? "present" : "not present",
- mDebugDisableHWC ? "disabled" : "enabled");
+ (mDebugDisableHWC || mDebugRegion) ? "disabled" : "enabled");
result.append(buffer);
hwc.dump(result, buffer, SIZE);
@@ -1660,21 +1659,15 @@ status_t SurfaceFlinger::onTransact(
case 1002: // SHOW_UPDATES
n = data.readInt32();
mDebugRegion = n ? n : (mDebugRegion ? 0 : 1);
+ invalidateHwcGeometry();
+ repaintEverything();
return NO_ERROR;
case 1003: // SHOW_BACKGROUND
n = data.readInt32();
mDebugBackground = n ? 1 : 0;
return NO_ERROR;
- case 1008: // toggle use of hw composer
- n = data.readInt32();
- mDebugDisableHWC = n ? 1 : 0;
- invalidateHwcGeometry();
- // fall-through...
case 1004:{ // repaint everything
- Mutex::Autolock _l(mStateLock);
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- mDirtyRegion.set(hw.bounds()); // careful that's not thread-safe
- signalEvent();
+ repaintEverything();
return NO_ERROR;
}
case 1005:{ // force transaction
@@ -1690,6 +1683,12 @@ status_t SurfaceFlinger::onTransact(
mFreezeCount = data.readInt32();
mFreezeDisplayTime = 0;
return NO_ERROR;
+ case 1008: // toggle use of hw composer
+ n = data.readInt32();
+ mDebugDisableHWC = n ? 1 : 0;
+ invalidateHwcGeometry();
+ repaintEverything();
+ return NO_ERROR;
case 1010: // interrogate.
reply->writeInt32(0);
reply->writeInt32(0);
@@ -1707,6 +1706,13 @@ status_t SurfaceFlinger::onTransact(
return err;
}
+void SurfaceFlinger::repaintEverything() {
+ Mutex::Autolock _l(mStateLock);
+ const DisplayHardware& hw(graphicPlane(0).displayHardware());
+ mDirtyRegion.set(hw.bounds()); // careful that's not thread-safe
+ signalEvent();
+}
+
// ---------------------------------------------------------------------------
status_t SurfaceFlinger::renderScreenToTextureLocked(DisplayID dpy,
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 1738238..d68e484 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -278,6 +278,7 @@ private:
void handleRepaint();
void postFramebuffer();
void composeSurfaces(const Region& dirty);
+ void repaintEverything();
ssize_t addClientLayer(const sp<Client>& client,