Initialize MergingDrawBatch clip with viewport bounds
This allows merged, clipped operations to behave correctly within a
savelayer, even if the base viewport has a large offset.
Additionally, disregard opaqueness when within a
complexclip/savelayer, as the coverage can't be trusted.
Change-Id: Ic908b82a4bb410bc7fac1b4295f4874ed166efc5
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index 548501d..aa0f9fc 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -360,6 +360,9 @@
return mSnapshot->clipRegion->isEmpty();
}
+ int getViewportWidth() { return getSnapshot()->viewport.getWidth(); }
+ int getViewportHeight() { return getSnapshot()->viewport.getHeight(); }
+
/**
* Scales the alpha on the current snapshot. This alpha value will be modulated
* with other alpha values when drawing primitives.