summaryrefslogtreecommitdiffstats
path: root/cc/trees/layer_tree_host_common.cc
diff options
context:
space:
mode:
authorxjz <xjz@chromium.org>2015-11-06 13:48:44 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-06 21:50:13 +0000
commite19f7640d2611e7c7da0c00786a96ee29e3ecd0d (patch)
tree0772bbe36bf71964ad9d22bc9042bc65ec7b0043 /cc/trees/layer_tree_host_common.cc
parent78fd1cde9784a3498770465e1c203fb46c25a427 (diff)
downloadchromium_src-e19f7640d2611e7c7da0c00786a96ee29e3ecd0d.zip
chromium_src-e19f7640d2611e7c7da0c00786a96ee29e3ecd0d.tar.gz
chromium_src-e19f7640d2611e7c7da0c00786a96ee29e3ecd0d.tar.bz2
Fixed the bug that window capture clipped the content when the window
is not fully contained in the desktop. This CL is based on the patch set 2 on issue 1398633003: https://codereview.chromium.org/1398633003/#ps40001 BUG=541634, 511841 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1412273006 Cr-Commit-Position: refs/heads/master@{#358414}
Diffstat (limited to 'cc/trees/layer_tree_host_common.cc')
-rw-r--r--cc/trees/layer_tree_host_common.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 4d14ff7..649f6c2 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -489,6 +489,10 @@ static gfx::Rect CalculateVisibleLayerRect(
layer->drawable_content_rect().IsEmpty())
return gfx::Rect();
+ // The layer is fully visible if it has copy requests.
+ if (layer->HasCopyRequest())
+ return gfx::Rect(layer->bounds());
+
// Compute visible bounds in target surface space.
gfx::Rect visible_rect_in_target_surface_space =
layer->drawable_content_rect();
@@ -2050,8 +2054,8 @@ static void CalculateDrawPropertiesInternal(
gfx::Rect clipped_content_rect = local_drawable_content_rect_of_subtree;
// Don't clip if the layer is reflected as the reflection shouldn't be
- // clipped.
- if (!layer->replica_layer()) {
+ // clipped. Also, don't clip if the layer has copy requests.
+ if (!layer->replica_layer() && !layer->HasCopyRequest()) {
// Note, it is correct to use data_from_ancestor.ancestor_clips_subtree
// here, because we are looking at this layer's render_surface, not the
// layer itself.
@@ -2596,7 +2600,8 @@ void CalculateRenderSurfaceLayerListInternal(
if (layer->DrawsContent())
surface_content_rect.Union(layer->drawable_content_rect());
- if (!layer->replica_layer() && layer->render_surface()->is_clipped()) {
+ if (!layer->replica_layer() && !layer->HasCopyRequest() &&
+ layer->render_surface()->is_clipped()) {
// Here, we clip the render surface's content rect with its clip rect.
// As the clip rect of render surface is in the surface's target
// space, we first map the content rect into the target space,