Invalidate unloaded textures to unloaded

When invalidateTexture() is told to continue drawing the
current texture until a replacement is found (STATE_STALE),
but the texture was not there in the first place since it
hadn't loaded yet, later attempts to draw the texture based
on the assumption of its being there (by virtue of being in
STATE_STALE or STATE_UPDATING) would result in rendering
problems due to trying to bind a nonexistent texture. The
fix is to make invalidateTexture() only set STATE_STALE if
a valid texture had been there in the first place.

As an added precautionary measure, this change also has a
stopgap solution that will draw the placeholder image if
the state machine indicates the texture is valid but it is
not actually valid. This case should never be encountered.

Bug: 3356101
Change-Id: Ia87e9e651f8ac3138faced3cf0f6199c58ee51e0
1 file changed
tree: 106ac0ca03ff582c46d3d8730f69f21dd786f334
  1. carousel/
  2. common/
  3. CleanSpec.mk