From 68f404105a46cf9f09b6b5cd30170e883e71be91 Mon Sep 17 00:00:00 2001 From: "ernstm@chromium.org" Date: Thu, 17 Apr 2014 04:45:40 +0000 Subject: [PATCH] cc: Fix clipping of texture rect. The clipping in texture_rect calculation needs to happen before the offset is added. This becomes relevant when tiling rect has an offset. R=enne@chromium.org BUG=362668 Review URL: https://codereview.chromium.org/238023010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264418 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/resources/picture_layer_tiling.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cc/resources/picture_layer_tiling.cc b/cc/resources/picture_layer_tiling.cc index 2a4ad2e5b8d9..d2a732d9eb98 100644 --- a/cc/resources/picture_layer_tiling.cc +++ b/cc/resources/picture_layer_tiling.cc @@ -356,8 +356,10 @@ gfx::RectF PictureLayerTiling::CoverageIterator::texture_rect() const { gfx::RectF texture_rect(current_geometry_rect_); texture_rect.Scale(dest_to_content_scale_, dest_to_content_scale_); - texture_rect.Offset(-tex_origin.OffsetFromOrigin()); texture_rect.Intersect(tiling_->TilingRect()); + if (texture_rect.IsEmpty()) + return texture_rect; + texture_rect.Offset(-tex_origin.OffsetFromOrigin()); return texture_rect; } -- 2.11.4.GIT