Don't increment the paint's generation ID when drawing bitmaps

When the renderer draws a bitmap as part of a display list with an
alpha < 1.0f, the paint is temporarily modified to alter the opacity
of the bitmap. This has the side effect of increasing the paint's
generation ID counter which can break paint caching.

Change-Id: I5055d059ad1639829fa50af3d946e296c4dab877
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 34d1c98..9df0c58 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -2942,8 +2942,14 @@
     mDrawModifiers.mPaintFilterSetBits = setBits & SkPaint::kAllFlags;
 }
 
-SkPaint* OpenGLRenderer::filterPaint(SkPaint* paint) {
-    if (CC_LIKELY(!mDrawModifiers.mHasDrawFilter || !paint)) return paint;
+SkPaint* OpenGLRenderer::filterPaint(SkPaint* paint, bool alwaysCopy) {
+    if (CC_LIKELY(!mDrawModifiers.mHasDrawFilter || !paint)) {
+        if (CC_UNLIKELY(alwaysCopy)) {
+            mFilteredPaint = *paint;
+            return &mFilteredPaint;
+        }
+        return paint;
+    }
 
     uint32_t flags = paint->getFlags();