Commit efe523e2 authored by hendrikw's avatar hendrikw Committed by Commit bot

cc: Full solid layers not at origin painted incorrectly

Old code used a size, we now use a rect, and I didn't update the
quad clipping to use the origin offset.

We now correctly clip the quads, and I've updated the unit test
to use a visible rect that doesn't sit on (0,0), and will fail
without this change.

Though I wasn't able to reproduce it, it may also fix:
https://code.google.com/p/chromium/issues/detail?id=427467

BUG=18132446 (internal)

Review URL: https://codereview.chromium.org/678193002

Cr-Commit-Position: refs/heads/master@{#301519}
parent 34688b71
...@@ -1447,7 +1447,7 @@ TEST_F(PictureLayerImplTest, SolidColorLayerHasVisibleFullCoverage) { ...@@ -1447,7 +1447,7 @@ TEST_F(PictureLayerImplTest, SolidColorLayerHasVisibleFullCoverage) {
gfx::Size tile_size(1000, 1000); gfx::Size tile_size(1000, 1000);
gfx::Size layer_bounds(1500, 1500); gfx::Size layer_bounds(1500, 1500);
gfx::Rect visible_rect(1000, 1000); gfx::Rect visible_rect(250, 250, 1000, 1000);
scoped_refptr<FakePicturePileImpl> pending_pile = scoped_refptr<FakePicturePileImpl> pending_pile =
FakePicturePileImpl::CreateEmptyPile(tile_size, layer_bounds); FakePicturePileImpl::CreateEmptyPile(tile_size, layer_bounds);
......
...@@ -36,16 +36,16 @@ void SolidColorLayerImpl::AppendSolidQuads( ...@@ -36,16 +36,16 @@ void SolidColorLayerImpl::AppendSolidQuads(
AppendQuadsData* append_quads_data) { AppendQuadsData* append_quads_data) {
// We create a series of smaller quads instead of just one large one so that // We create a series of smaller quads instead of just one large one so that
// the culler can reduce the total pixels drawn. // the culler can reduce the total pixels drawn.
int width = visible_content_rect.width(); int right = visible_content_rect.right();
int height = visible_content_rect.height(); int bottom = visible_content_rect.bottom();
for (int x = visible_content_rect.x(); x < visible_content_rect.right(); for (int x = visible_content_rect.x(); x < visible_content_rect.right();
x += kSolidQuadTileSize) { x += kSolidQuadTileSize) {
for (int y = visible_content_rect.y(); y < visible_content_rect.bottom(); for (int y = visible_content_rect.y(); y < visible_content_rect.bottom();
y += kSolidQuadTileSize) { y += kSolidQuadTileSize) {
gfx::Rect quad_rect(x, gfx::Rect quad_rect(x,
y, y,
std::min(width - x, kSolidQuadTileSize), std::min(right - x, kSolidQuadTileSize),
std::min(height - y, kSolidQuadTileSize)); std::min(bottom - y, kSolidQuadTileSize));
gfx::Rect visible_quad_rect = gfx::Rect visible_quad_rect =
occlusion_in_content_space.GetUnoccludedContentRect(quad_rect); occlusion_in_content_space.GetUnoccludedContentRect(quad_rect);
if (visible_quad_rect.IsEmpty()) if (visible_quad_rect.IsEmpty())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment