Chromium Code Reviews| Index: cc/trees/layer_tree_host_pixeltest_tiles.cc |
| diff --git a/cc/trees/layer_tree_host_pixeltest_tiles.cc b/cc/trees/layer_tree_host_pixeltest_tiles.cc |
| index b569208f018825fa9a39eac55878ddd0ea154437..17b5625f2323cbedab410e1038a0e5b5fc363a85 100644 |
| --- a/cc/trees/layer_tree_host_pixeltest_tiles.cc |
| +++ b/cc/trees/layer_tree_host_pixeltest_tiles.cc |
| @@ -11,6 +11,7 @@ |
| #include "cc/playback/display_item_list_settings.h" |
| #include "cc/playback/drawing_display_item.h" |
| #include "cc/test/layer_tree_pixel_test.h" |
| +#include "cc/test/test_compositor_frame_sink.h" |
| #include "third_party/skia/include/core/SkCanvas.h" |
| #include "third_party/skia/include/core/SkPictureRecorder.h" |
| @@ -160,11 +161,18 @@ class LayerTreeHostTilesTestPartialInvalidation |
| void DidCommitAndDrawFrame() override { |
| switch (layer_tree_host()->SourceFrameNumber()) { |
| case 1: |
| - // We have done one frame, so the layer's content has been rastered. |
| - // Now we change the picture behind it to record something completely |
| - // different, but we give a smaller invalidation rect. The layer should |
| - // only re-raster the stuff in the rect. If it doesn't do partial raster |
| - // it would re-raster the whole thing instead. |
| + // We have done one frame, but the resource may not be available for |
| + // partial raster yet. Force a seocnd frame. |
| + picture_layer_->SetNeedsDisplayRect(gfx::Rect(50, 50, 100, 100)); |
|
ericrk
2017/01/04 18:10:48
Updated the partial raster test - we now give it t
|
| + break; |
| + |
| + case 2: |
| + // We have done two frames, so the layer's content has been rastered |
| + // twice and the first frame's resource is available for partial |
| + // raster. Now we change the picture behind it to record something |
| + // completely different, but we give a smaller invalidation rect. The |
| + // layer should only re-raster the stuff in the rect. If it doesn't do |
| + // partial raster it would re-raster the whole thing instead. |
| client_.set_blue_top(false); |
| Finish(); |
| picture_layer_->SetNeedsDisplayRect(gfx::Rect(50, 50, 100, 100)); |