SurfaceFlinger: fix a couple NULL fence checks

This change replaces checks for a NULL fence pointer with calls to
Fence::isValid.  There should no longer be NULL fences.

Change-Id: If17c9c132fcb1801531bf7588f8ba53476c57dad
merge in jb-mr2-release history after reset to jb-mr2-dev
merge in jb-mr2-release history after reset to jb-mr2-dev
merge in jb-mr2-release history after reset to jb-mr2-dev
Revert "Change SurfaceControl setPosition to take floats"

Temporary, to fix weekend build, until we get Nvidia code drop.

This reverts commit 9a867a8798fa6ea21f6341db31e38ea64fde6c83

DO NOT MERGE

Change-Id: I7b5dbc4db46ef3d97dc8598057d5487d6971178b
merge in jb-mr2-release history after reset to jb-mr2-dev
merge in jb-mr2-release history after reset to jb-mr2-dev
merge in jb-mr2-release history after reset to jb-mr2-dev
merge in jb-mr2-release history after reset to jb-mr2-dev
Defer destroying surfaces until not current

Bug: 8320762
Change-Id: I1320cf87923bcc5b795a86a13193363a49e29653
When disconnecting a surface, cancel don't queue the buffer

This isn't really right either, but avoids having an extra buffer that
the consumer has to drain which it might not be expecting.

To be correct, disconnecting a surface from a context should retain
the current buffer and continue using it when reconnected. The buffer
should only be canceled when the surface is destroyed. That will wait
for a later change.

Bug: 8320762
Change-Id: I5efa39c741193ca4f5612ea9de001ccbb683b345
merge in jb-mr2-release history after reset to jb-mr2-dev
merge in jb-mr2-release history after reset to jb-mr2-dev
merge in jb-mr2-release history after reset to jb-mr2-dev
size IMemoryHeap properly for screenshots

since we're using glReadPixels(), we only need to use
the width (as opposed to the stride) of the source
screenshot.

Bug: 8374664
Change-Id: I145c80f4fff5444df7c77c4f52e70a7203caddbd
merge in jb-mr2-release history after reset to jb-mr2-dev
am 7212ff29: am 20e154f1: Merge "Second try at adding a compatibility symbol for the MemoryBase constructor."

* commit '7212ff29c6f4e4cd192fee6f072e80b36d8a728b':
  Second try at adding a compatibility symbol for the MemoryBase constructor.
merge in jb-mr2-release history after reset to jb-mr2-dev
merge in jb-mr2-release history after reset to jb-mr2-dev
merge in jb-mr2-release history after reset to jb-mr2-dev