Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: cc/trees/draw_property_utils.cc

Issue 2147283002: cc : Fix occlusion tracking bug for contributing surface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/trees/draw_property_utils.cc
diff --git a/cc/trees/draw_property_utils.cc b/cc/trees/draw_property_utils.cc
index 694bf45f272a36c628b21b201db7edd86683b36d..253911692cd450a07c927cd46da11177b180dcfd 100644
--- a/cc/trees/draw_property_utils.cc
+++ b/cc/trees/draw_property_utils.cc
@@ -54,21 +54,6 @@ static void ValidateRenderSurfaceForLayer(LayerImpl* layer) {
DCHECK(effect_node->background_filters.IsEmpty());
}
-#endif
-
-static void ApplySublayerScale(const int effect_node_id,
- const EffectTree& effect_tree,
- gfx::Transform* transform) {
- const EffectNode* effect_node = effect_tree.Node(effect_node_id);
- const EffectNode* target_effect_node =
- effect_node->has_render_surface
- ? effect_node
- : effect_tree.Node(effect_node->target_id);
- transform->matrix().postScale(target_effect_node->sublayer_scale.x(),
- target_effect_node->sublayer_scale.y(), 1.f);
-}
-
-#if DCHECK_IS_ON()
void VerifySublayerScalesMatch(const int effect_node_id,
const int target_transform_id,
const EffectTree& effect_tree,
@@ -715,6 +700,28 @@ static void ResetIfHasNanCoordinate(gfx::RectF* rect) {
*rect = gfx::RectF();
}
+void ApplySublayerScale(const int effect_node_id,
+ const EffectTree& effect_tree,
+ gfx::Transform* transform) {
+ const EffectNode* effect_node = effect_tree.Node(effect_node_id);
+ const EffectNode* target_effect_node =
+ effect_node->has_render_surface
+ ? effect_node
+ : effect_tree.Node(effect_node->target_id);
+ transform->matrix().postScale(target_effect_node->sublayer_scale.x(),
+ target_effect_node->sublayer_scale.y(), 1.f);
+}
+
+void RemoveSublayerScale(const int effect_node_id,
+ const EffectTree& effect_tree,
+ gfx::Transform* transform) {
+ const EffectNode* effect_node = effect_tree.Node(effect_node_id);
+ if (effect_node->sublayer_scale.x() != 0.0 &&
+ effect_node->sublayer_scale.y() != 0.0)
+ transform->Scale(1.0 / effect_node->sublayer_scale.x(),
+ 1.0 / effect_node->sublayer_scale.y());
+}
+
void ComputeClips(ClipTree* clip_tree,
const TransformTree& transform_tree,
const EffectTree& effect_tree,

Powered by Google App Engine
This is Rietveld 408576698