Commit ac3cbdf5 authored by Vladimir Levin's avatar Vladimir Levin Committed by Commit Bot

OOP: Ensure to clear tiles when needed even if no display items.

This patch ensures that we don't early out under requires_clear when
doing OOP raster. If we early out, and we were doing a partial raster,
then we might end up with previous content on the texture.

R=enne@chromium.org, piman@chromium.org

Bug: 901897
Change-Id: I9e74e7f5b04d14385b733df50b08e027f5e6d1d3
Reviewed-on: https://chromium-review.googlesource.com/c/1335662
Commit-Queue: vmpstr <vmpstr@chromium.org>
Reviewed-by: default avatarenne <enne@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608391}
parent 582d3964
...@@ -1209,8 +1209,11 @@ TEST_F(OopPixelTest, ClearingTransparentInternalTile) { ...@@ -1209,8 +1209,11 @@ TEST_F(OopPixelTest, ClearingTransparentInternalTile) {
options.preclear = true; options.preclear = true;
options.preclear_color = SK_ColorRED; options.preclear_color = SK_ColorRED;
// Make a non-empty but noop display list to avoid early outs. // Note that clearing of the tile should supersede any early outs due to an
auto display_item_list = MakeNoopDisplayItemList(); // empty display list. This is due to the fact that partial raster may in fact
// result in no items being generated, in which case a clear should still
// happen. See crbug.com/901897.
auto display_item_list = base::MakeRefCounted<DisplayItemList>();
auto oop_result = Raster(display_item_list, options); auto oop_result = Raster(display_item_list, options);
auto gpu_result = RasterExpectedBitmap(display_item_list, options); auto gpu_result = RasterExpectedBitmap(display_item_list, options);
......
...@@ -1263,7 +1263,11 @@ void RasterImplementation::RasterCHROMIUM(const cc::DisplayItemList* list, ...@@ -1263,7 +1263,11 @@ void RasterImplementation::RasterCHROMIUM(const cc::DisplayItemList* list,
gfx::Rect query_rect = gfx::Rect query_rect =
gfx::ScaleToEnclosingRect(playback_rect, 1.f / post_scale); gfx::ScaleToEnclosingRect(playback_rect, 1.f / post_scale);
list->rtree_.Search(query_rect, &temp_raster_offsets_); list->rtree_.Search(query_rect, &temp_raster_offsets_);
if (temp_raster_offsets_.empty()) // We can early out if we have nothing to draw and we don't need a clear. Note
// that if there is nothing to draw, but a clear is required, then those
// commands would be serialized in the preamble and it's important to play
// those back.
if (temp_raster_offsets_.empty() && !requires_clear)
return; return;
// TODO(enne): Tune these numbers // TODO(enne): Tune these numbers
......
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