Merge "Initialize ARect fields in default ctor" into lmp-mr1-dev
diff --git a/libs/gui/GLConsumer.cpp b/libs/gui/GLConsumer.cpp
index cc96a92..318c087 100644
--- a/libs/gui/GLConsumer.cpp
+++ b/libs/gui/GLConsumer.cpp
@@ -505,7 +505,7 @@
if (mEglDisplay == EGL_NO_DISPLAY) {
mEglDisplay = dpy;
}
- if (mEglContext == EGL_NO_DISPLAY) {
+ if (mEglContext == EGL_NO_CONTEXT) {
mEglContext = ctx;
}
}
diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
index 57e94ef..76545f3 100644
--- a/services/surfaceflinger/Android.mk
+++ b/services/surfaceflinger/Android.mk
@@ -83,6 +83,12 @@
LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=0
endif
+ifneq ($(MAX_VIRTUAL_DISPLAY_DIMENSION),)
+ LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=$(MAX_VIRTUAL_DISPLAY_DIMENSION)
+else
+ LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=0
+endif
+
LOCAL_CFLAGS += -fvisibility=hidden -Werror=format
LOCAL_CFLAGS += -std=c++11
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 50968e7..17e984a 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1328,7 +1328,22 @@
// etc.) but no internal state (i.e. a DisplayDevice).
if (state.surface != NULL) {
- hwcDisplayId = allocateHwcDisplayId(state.type);
+ int width = 0;
+ int status = state.surface->query(
+ NATIVE_WINDOW_WIDTH, &width);
+ ALOGE_IF(status != NO_ERROR,
+ "Unable to query width (%d)", status);
+ int height = 0;
+ status = state.surface->query(
+ NATIVE_WINDOW_HEIGHT, &height);
+ ALOGE_IF(status != NO_ERROR,
+ "Unable to query height (%d)", status);
+ if (MAX_VIRTUAL_DISPLAY_DIMENSION == 0 ||
+ (width <= MAX_VIRTUAL_DISPLAY_DIMENSION &&
+ height <= MAX_VIRTUAL_DISPLAY_DIMENSION)) {
+ hwcDisplayId = allocateHwcDisplayId(state.type);
+ }
+
sp<VirtualDisplaySurface> vds = new VirtualDisplaySurface(
*mHwc, hwcDisplayId, state.surface,
bqProducer, bqConsumer, state.displayName);