diff options
author | chrishtr <chrishtr@chromium.org> | 2016-03-18 08:44:29 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-18 15:46:06 +0000 |
commit | c41aca7b408e13fdee88a3b39db1a93813bd9fc1 (patch) | |
tree | 87d30dbf4c15fac5f2d4c3cfd231ef2b14aaac45 /cc/playback | |
parent | c374755600bbe9135a3c3db738ce3b0f3fdc8fdd (diff) | |
download | chromium_src-c41aca7b408e13fdee88a3b39db1a93813bd9fc1.zip chromium_src-c41aca7b408e13fdee88a3b39db1a93813bd9fc1.tar.gz chromium_src-c41aca7b408e13fdee88a3b39db1a93813bd9fc1.tar.bz2 |
Store recording invalidations in DisplayListRecordingSource, save them via Update.
This fixes the referenced bug, as well as cleaning up the interaction between
PictureLayer and DisplayListRecordingSource a little bit. This way both the
invalidation and picture come from DisplayListRecordingSource, rather than one
coming from PictureLayer and the other from DisplayListRecordingSource, with the
latter modifying the invalidation during Update.
Also renamed LayerImpl::GetInvalidationRegion() to
LayerImpl::GetInvalidationRegionForDebugging() to make clear it's only used for
that purpose.
BUG=591561
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1812733003
Cr-Commit-Position: refs/heads/master@{#381977}
Diffstat (limited to 'cc/playback')
-rw-r--r-- | cc/playback/display_list_recording_source.cc | 14 | ||||
-rw-r--r-- | cc/playback/display_list_recording_source.h | 5 |
2 files changed, 19 insertions, 0 deletions
diff --git a/cc/playback/display_list_recording_source.cc b/cc/playback/display_list_recording_source.cc index 52c8277..a6f5584 100644 --- a/cc/playback/display_list_recording_source.cc +++ b/cc/playback/display_list_recording_source.cc @@ -117,6 +117,14 @@ void DisplayListRecordingSource::FinishDisplayItemListUpdate() { display_list_->GenerateDiscardableImagesMetadata(); } +void DisplayListRecordingSource::SetNeedsDisplayRect( + const gfx::Rect& layer_rect) { + if (!layer_rect.IsEmpty()) { + // Clamp invalidation to the layer bounds. + invalidation_.Union(gfx::IntersectRects(layer_rect, gfx::Rect(size_))); + } +} + bool DisplayListRecordingSource::UpdateAndExpandInvalidation( ContentLayerClient* painter, Region* invalidation, @@ -133,6 +141,9 @@ bool DisplayListRecordingSource::UpdateAndExpandInvalidation( updated = true; } + invalidation_.Swap(invalidation); + invalidation_.Clear(); + gfx::Rect new_recorded_viewport = painter->PaintableRegion(); if (new_recorded_viewport != recorded_viewport_) { UpdateInvalidationForNewViewport(recorded_viewport_, new_recorded_viewport, @@ -150,6 +161,9 @@ bool DisplayListRecordingSource::UpdateAndExpandInvalidation( if (!updated && !invalidation->Intersects(recorded_viewport_)) return false; + if (invalidation->IsEmpty()) + return false; + ContentLayerClient::PaintingControlSetting painting_control = ContentLayerClient::PAINTING_BEHAVIOR_NORMAL; diff --git a/cc/playback/display_list_recording_source.h b/cc/playback/display_list_recording_source.h index c69c114..754cec9 100644 --- a/cc/playback/display_list_recording_source.h +++ b/cc/playback/display_list_recording_source.h @@ -11,6 +11,7 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "cc/base/cc_export.h" +#include "cc/base/invalidation_region.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" @@ -63,6 +64,8 @@ class CC_EXPORT DisplayListRecordingSource { void SetBackgroundColor(SkColor background_color); void SetRequiresClear(bool requires_clear); + void SetNeedsDisplayRect(const gfx::Rect& layer_rect); + // These functions are virtual for testing. virtual scoped_refptr<DisplayListRasterSource> CreateRasterSource( bool can_use_lcd_text) const; @@ -96,6 +99,8 @@ class CC_EXPORT DisplayListRecordingSource { void DetermineIfSolidColor(); + InvalidationRegion invalidation_; + DISALLOW_COPY_AND_ASSIGN(DisplayListRecordingSource); }; |