summaryrefslogtreecommitdiffstats
path: root/libs/hwui/StatefulBaseRenderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/StatefulBaseRenderer.cpp')
-rw-r--r--libs/hwui/StatefulBaseRenderer.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/libs/hwui/StatefulBaseRenderer.cpp b/libs/hwui/StatefulBaseRenderer.cpp
index 05f6cf8..7d299f0 100644
--- a/libs/hwui/StatefulBaseRenderer.cpp
+++ b/libs/hwui/StatefulBaseRenderer.cpp
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#define LOG_TAG "OpenGLRenderer"
+
#include <SkCanvas.h>
#include "StatefulBaseRenderer.h"
@@ -38,9 +40,7 @@ void StatefulBaseRenderer::initializeSaveStack(float clipLeft, float clipTop,
void StatefulBaseRenderer::initializeViewport(int width, int height) {
mWidth = width;
mHeight = height;
-
- mFirstSnapshot->height = height;
- mFirstSnapshot->viewport.set(0, 0, width, height);
+ mFirstSnapshot->initializeViewport(width, height);
}
///////////////////////////////////////////////////////////////////////////////
@@ -182,6 +182,10 @@ bool StatefulBaseRenderer::clipRegion(const SkRegion* region, SkRegion::Op op) {
return !mSnapshot->clipRect->isEmpty();
}
+void StatefulBaseRenderer::setClippingOutline(LinearAllocator& allocator, const Outline* outline) {
+ mSnapshot->setClippingOutline(allocator, outline);
+}
+
///////////////////////////////////////////////////////////////////////////////
// Quick Rejection
///////////////////////////////////////////////////////////////////////////////
@@ -197,7 +201,9 @@ bool StatefulBaseRenderer::clipRegion(const SkRegion* region, SkRegion::Op op) {
* See Rect::snapGeometryToPixelBoundaries()
*/
bool StatefulBaseRenderer::calculateQuickRejectForScissor(float left, float top,
- float right, float bottom, bool* clipRequired, bool snapOut) const {
+ float right, float bottom,
+ bool* clipRequired, bool* roundRectClipRequired,
+ bool snapOut) const {
if (mSnapshot->isIgnored() || bottom <= top || right <= left) {
return true;
}
@@ -212,7 +218,15 @@ bool StatefulBaseRenderer::calculateQuickRejectForScissor(float left, float top,
if (!clipRect.intersects(r)) return true;
// clip is required if geometry intersects clip rect
- if (clipRequired) *clipRequired = !clipRect.contains(r);
+ if (clipRequired) {
+ *clipRequired = !clipRect.contains(r);
+ }
+
+ // round rect clip is required if RR clip exists, and geometry intersects its corners
+ if (roundRectClipRequired) {
+ *roundRectClipRequired = mSnapshot->roundRectClipState != NULL
+ && mSnapshot->roundRectClipState->areaRequiresRoundRectClip(r);
+ }
return false;
}