summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-08-23 21:38:59 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-23 21:38:59 -0700
commitf33bc2dfb5fc6e51ff3c90b9468ef3fe9e0d10a9 (patch)
treebb0b861ced39090b32eb9cac765d037a3714b791 /services/surfaceflinger
parent006efb24706378293a2faa137c7c7ca34a2e15cd (diff)
parentbecc91d6b0b5fc59f3231ba7f1584eb9e2f3a313 (diff)
downloadframeworks_base-f33bc2dfb5fc6e51ff3c90b9468ef3fe9e0d10a9.zip
frameworks_base-f33bc2dfb5fc6e51ff3c90b9468ef3fe9e0d10a9.tar.gz
frameworks_base-f33bc2dfb5fc6e51ff3c90b9468ef3fe9e0d10a9.tar.bz2
Merge changes I14e03939,I9aafe6f2
* changes: Fix an issue where Surface::lock() would never update the output region Add a debug option to turn the "transformation hint" off
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r--services/surfaceflinger/Layer.cpp15
-rw-r--r--services/surfaceflinger/Layer.h1
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp7
-rw-r--r--services/surfaceflinger/SurfaceFlinger.h1
-rw-r--r--services/surfaceflinger/SurfaceTextureLayer.cpp8
5 files changed, 23 insertions, 9 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 6f6a9bf..8b2485a 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -538,9 +538,9 @@ void Layer::dump(String8& result, char* buffer, size_t SIZE) const
snprintf(buffer, SIZE,
" "
"format=%2d, activeBuffer=[%4ux%4u:%4u,%3X],"
- " freezeLock=%p, queued-frames=%d\n",
+ " freezeLock=%p, transform-hint=0x%02x, queued-frames=%d\n",
mFormat, w0, h0, s0,f0,
- getFreezeLock().get(), mQueuedFrames);
+ getFreezeLock().get(), getTransformHint(), mQueuedFrames);
result.append(buffer);
@@ -559,6 +559,17 @@ uint32_t Layer::getEffectiveUsage(uint32_t usage) const
return usage;
}
+uint32_t Layer::getTransformHint() const {
+ uint32_t orientation = 0;
+ if (!mFlinger->mDebugDisableTransformHint) {
+ orientation = getOrientation();
+ if (orientation & Transform::ROT_INVALID) {
+ orientation = 0;
+ }
+ }
+ return orientation;
+}
+
// ---------------------------------------------------------------------------
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 5f0be80..d06a35f 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -89,6 +89,7 @@ private:
void onFrameQueued();
virtual sp<ISurface> createSurface();
uint32_t getEffectiveUsage(uint32_t usage) const;
+ uint32_t getTransformHint() const;
bool isCropped() const;
static bool getOpacityForFormat(uint32_t format);
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 1f27a70..0080202 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -93,6 +93,7 @@ SurfaceFlinger::SurfaceFlinger()
mDebugBackground(0),
mDebugDDMS(0),
mDebugDisableHWC(0),
+ mDebugDisableTransformHint(0),
mDebugInSwapBuffers(0),
mLastSwapBufferTime(0),
mDebugInTransaction(0),
@@ -1689,6 +1690,12 @@ status_t SurfaceFlinger::onTransact(
invalidateHwcGeometry();
repaintEverything();
return NO_ERROR;
+ case 1009: // toggle use of transform hint
+ n = data.readInt32();
+ mDebugDisableTransformHint = n ? 1 : 0;
+ invalidateHwcGeometry();
+ repaintEverything();
+ return NO_ERROR;
case 1010: // interrogate.
reply->writeInt32(0);
reply->writeInt32(0);
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index d68e484..5f8eb08 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -374,6 +374,7 @@ private:
int mDebugBackground;
int mDebugDDMS;
int mDebugDisableHWC;
+ int mDebugDisableTransformHint;
volatile nsecs_t mDebugInSwapBuffers;
nsecs_t mLastSwapBufferTime;
volatile nsecs_t mDebugInTransaction;
diff --git a/services/surfaceflinger/SurfaceTextureLayer.cpp b/services/surfaceflinger/SurfaceTextureLayer.cpp
index 79cd0c3..4390ca1 100644
--- a/services/surfaceflinger/SurfaceTextureLayer.cpp
+++ b/services/surfaceflinger/SurfaceTextureLayer.cpp
@@ -57,16 +57,10 @@ status_t SurfaceTextureLayer::queueBuffer(int buf, int64_t timestamp,
status_t res = SurfaceTexture::queueBuffer(buf, timestamp,
outWidth, outHeight, outTransform);
-
sp<Layer> layer(mLayer.promote());
if (layer != NULL) {
- uint32_t orientation = layer->getOrientation();
- if (orientation & Transform::ROT_INVALID) {
- orientation = 0;
- }
- *outTransform = orientation;
+ *outTransform = layer->getTransformHint();
}
-
return res;
}