summaryrefslogtreecommitdiffstats
path: root/cc/playback/display_list_raster_source_unittest.cc
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2015-06-11 12:59:23 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-11 19:59:54 +0000
commit0af09bc72050a35193af6ebee0462b5ecb0a39fc (patch)
tree05ee6770ec67a97ada012e0f3e1b1447a74d4d16 /cc/playback/display_list_raster_source_unittest.cc
parent2636da727ad738de76c5fe55c830347e21cbea27 (diff)
downloadchromium_src-0af09bc72050a35193af6ebee0462b5ecb0a39fc.zip
chromium_src-0af09bc72050a35193af6ebee0462b5ecb0a39fc.tar.gz
chromium_src-0af09bc72050a35193af6ebee0462b5ecb0a39fc.tar.bz2
cc: Only clear edge pixels that fall inside the canvas_playback_rect
When we raster a tile at scale, edge pixels may not be fully covered by the recording, so we clear them to the background color. When partially rastering the tile, though, we only want to clear edge pixels that are inside the dirty rect, since we won't re-raster stuff outside. R=enne, vmpstr BUG=499245 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1182533002 Cr-Commit-Position: refs/heads/master@{#334018}
Diffstat (limited to 'cc/playback/display_list_raster_source_unittest.cc')
-rw-r--r--cc/playback/display_list_raster_source_unittest.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/cc/playback/display_list_raster_source_unittest.cc b/cc/playback/display_list_raster_source_unittest.cc
index e41bc64..1827d71 100644
--- a/cc/playback/display_list_raster_source_unittest.cc
+++ b/cc/playback/display_list_raster_source_unittest.cc
@@ -395,8 +395,9 @@ TEST(DisplayListRasterSourceTest, RasterPartialContents) {
raster = DisplayListRasterSource::CreateFromDisplayListRecordingSource(
recording_source.get(), false);
- // We're going to playback from "everything is black" into a smaller area.
- playback_rect.Inset(1, 2);
+ // We're going to playback from "everything is black" into a smaller area,
+ // that touches the edge pixels of the recording.
+ playback_rect.Inset(1, 2, 0, 1);
raster->PlaybackToCanvas(&canvas, raster_full_rect, playback_rect,
contents_scale);
@@ -405,8 +406,8 @@ TEST(DisplayListRasterSourceTest, RasterPartialContents) {
int num_white = 0;
for (int i = 0; i < bitmap.width(); ++i) {
for (int j = 0; j < bitmap.height(); ++j) {
- SCOPED_TRACE(i);
SCOPED_TRACE(j);
+ SCOPED_TRACE(i);
bool expect_black = playback_rect.Contains(i, j);
if (expect_black) {
EXPECT_EQ(255u, SkColorGetA(pixels[i + j * bitmap.width()]));