SurfaceFlinger: add a crop to the layer state
This change adds a crop rectangle specified in window coordinates to the layer
state. The all window pixels outside this crop rectangle are treated as though
they were fully transparent. This change also adds the plumbing necessary for
WindowManager to set that crop.
Change-Id: I582bc445dc8c97d4c943d4db8d582a6ef5a66081
diff --git a/include/gui/ISurfaceComposer.h b/include/gui/ISurfaceComposer.h
index f3c0ecb..7320e4d 100644
--- a/include/gui/ISurfaceComposer.h
+++ b/include/gui/ISurfaceComposer.h
@@ -67,6 +67,7 @@
eTransparentRegionChanged = 0x00000020,
eVisibilityChanged = 0x00000040,
eFreezeTintChanged = 0x00000080,
+ eCropChanged = 0x00000100,
};
enum {
diff --git a/include/gui/Surface.h b/include/gui/Surface.h
index 1f90c59..50bdf71 100644
--- a/include/gui/Surface.h
+++ b/include/gui/Surface.h
@@ -72,6 +72,7 @@
status_t setAlpha(float alpha=1.0f);
status_t setMatrix(float dsdx, float dtdx, float dsdy, float dtdy);
status_t setFreezeTint(uint32_t tint);
+ status_t setCrop(const Rect& crop);
static status_t writeSurfaceToParcel(
const sp<SurfaceControl>& control, Parcel* parcel);
diff --git a/include/gui/SurfaceComposerClient.h b/include/gui/SurfaceComposerClient.h
index d971031..3bd10de 100644
--- a/include/gui/SurfaceComposerClient.h
+++ b/include/gui/SurfaceComposerClient.h
@@ -127,6 +127,7 @@
status_t setMatrix(SurfaceID id, float dsdx, float dtdx, float dsdy, float dtdy);
status_t setPosition(SurfaceID id, float x, float y);
status_t setSize(SurfaceID id, uint32_t w, uint32_t h);
+ status_t setCrop(SurfaceID id, const Rect& crop);
status_t destroySurface(SurfaceID sid);
private: