Merge "SurfaceFlinger: remove all GLES scissor calls." into jb-dev
diff --git a/build/tablet-7in-hdpi-1024-dalvik-heap.mk b/build/tablet-7in-hdpi-1024-dalvik-heap.mk
new file mode 100644
index 0000000..115f177
--- /dev/null
+++ b/build/tablet-7in-hdpi-1024-dalvik-heap.mk
@@ -0,0 +1,23 @@
+#
+# Copyright (C) 2010 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Provides overrides to configure the Dalvik heap for a standard tablet device.
+
+PRODUCT_PROPERTY_OVERRIDES += \
+    dalvik.vm.heapstartsize=8m \
+    dalvik.vm.heapgrowthlimit=64m \
+    dalvik.vm.heapsize=512m
+    
\ No newline at end of file
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 5e17d07..593f178 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -428,8 +428,8 @@
     const Layer::State& front(drawingState());
     const Layer::State& temp(currentState());
 
-    const bool sizeChanged = (temp.requested.w != front.active.w) ||
-                             (temp.requested.h != front.active.h);
+    const bool sizeChanged = (temp.requested.w != front.requested.w) ||
+                             (temp.requested.h != front.requested.h);
 
     if (sizeChanged) {
         // the size changed, we need to ask our client to request a new buffer
@@ -516,7 +516,6 @@
             mPostedDirtyRegion.clear();
             return;
         }
-        mRefreshPending = true;
 
         // Capture the old state of the layer for comparisons later
         const bool oldOpacity = isOpaque();
@@ -601,6 +600,7 @@
                 if (!isFixedSize) {
                     if (front.active.w != bufWidth ||
                         front.active.h != bufHeight) {
+                        // reject this buffer
                         return true;
                     }
                 }
@@ -624,6 +624,7 @@
             return;
         }
 
+        mRefreshPending = true;
         mFrameLatencyNeeded = true;
         if (oldActiveBuffer == NULL) {
              // the first time we receive a buffer, we need to trigger a