summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2014-06-17 10:34:02 -0700
committerJohn Reck <jreck@google.com>2014-06-17 10:56:00 -0700
commit293e868bfc1b07aad2cb2ebeee5b07424852c510 (patch)
treee69fa95ca66fae973e1d5ea8c668788abbd3d221 /libs/hwui
parent29956069637f456df23d391a59bc77e545b02e05 (diff)
downloadframeworks_base-293e868bfc1b07aad2cb2ebeee5b07424852c510.zip
frameworks_base-293e868bfc1b07aad2cb2ebeee5b07424852c510.tar.gz
frameworks_base-293e868bfc1b07aad2cb2ebeee5b07424852c510.tar.bz2
Handle Z in DA
Bug: 15671775 Change-Id: I33c7a70e78ef523ffd03165fb6c39d8e04d04f1f
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/DamageAccumulator.cpp2
-rw-r--r--libs/hwui/RenderNode.cpp2
-rw-r--r--libs/hwui/RenderProperties.h10
3 files changed, 12 insertions, 2 deletions
diff --git a/libs/hwui/DamageAccumulator.cpp b/libs/hwui/DamageAccumulator.cpp
index 1cb87f2..8277a9a 100644
--- a/libs/hwui/DamageAccumulator.cpp
+++ b/libs/hwui/DamageAccumulator.cpp
@@ -168,7 +168,7 @@ void DamageAccumulator::applyRenderNodeTransform(DirtyStack* frame) {
const RenderProperties& props = frame->renderNode->properties();
// Perform clipping
- if (props.getClipToBounds() && !frame->pendingDirty.isEmpty()) {
+ if (props.getClipDamageToBounds() && !frame->pendingDirty.isEmpty()) {
if (!frame->pendingDirty.intersect(0, 0, props.getWidth(), props.getHeight())) {
frame->pendingDirty.setEmpty();
}
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index 378183a..fc51170 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -118,7 +118,7 @@ void RenderNode::prepareTree(TreeInfo& info) {
void RenderNode::damageSelf(TreeInfo& info) {
if (isRenderable() && properties().getAlpha() > 0) {
- if (properties().getClipToBounds()) {
+ if (properties().getClipDamageToBounds()) {
info.damageAccumulator->dirty(0, 0, properties().getWidth(), properties().getHeight());
} else {
// Hope this is big enough?
diff --git a/libs/hwui/RenderProperties.h b/libs/hwui/RenderProperties.h
index 8c6cc9e..eab929b 100644
--- a/libs/hwui/RenderProperties.h
+++ b/libs/hwui/RenderProperties.h
@@ -30,6 +30,7 @@
#include "Rect.h"
#include "RevealClip.h"
#include "Outline.h"
+#include "utils/MathUtils.h"
class SkBitmap;
class SkColorFilter;
@@ -526,6 +527,15 @@ public:
return mLayerProperties;
}
+ // Returns true if damage calculations should be clipped to bounds
+ // TODO: Figure out something better for getZ(), as children should still be
+ // clipped to this RP's bounds. But as we will damage -INT_MAX to INT_MAX
+ // for this RP's getZ() anyway, this can be optimized when we have a
+ // Z damage estimate instead of INT_MAX
+ bool getClipDamageToBounds() const {
+ return getClipToBounds() && (getZ() <= 0 || getOutline().isEmpty());
+ }
+
private:
// Rendering properties