Index: components/exo/surface.cc |
diff --git a/components/exo/surface.cc b/components/exo/surface.cc |
index 08b8a187655d5653b73feec064e77f19ba1b565a..8e613846093ab1cfc3f23d648473da5ac738353e 100644 |
--- a/components/exo/surface.cc |
+++ b/components/exo/surface.cc |
@@ -388,13 +388,21 @@ void Surface::PlaceSubSurfaceBelow(Surface* sub_surface, Surface* sibling) { |
void Surface::SetViewport(const gfx::Size& viewport) { |
TRACE_EVENT1("exo", "Surface::SetViewport", "viewport", viewport.ToString()); |
+ if (pending_viewport_ == viewport) |
+ return; |
+ |
pending_viewport_ = viewport; |
+ changed_viewport_or_crop_ = true; |
} |
void Surface::SetCrop(const gfx::RectF& crop) { |
TRACE_EVENT1("exo", "Surface::SetCrop", "crop", crop.ToString()); |
+ if (pending_crop_ == crop) |
+ return; |
+ |
pending_crop_ = crop; |
+ changed_viewport_or_crop_ = true; |
} |
void Surface::SetOnlyVisibleOnSecureOutput(bool only_visible_on_secure_output) { |
@@ -512,10 +520,13 @@ void Surface::CommitLayerContents() { |
void Surface::CommitSurfaceContents() { |
// We update contents if Attach() has been called since last commit. |
if (has_pending_contents_) { |
- has_pending_contents_ = false; |
- |
current_buffer_ = pending_buffer_; |
pending_buffer_.reset(); |
+ } |
+ |
+ if (has_pending_contents_ || changed_viewport_or_crop_) { |
+ has_pending_contents_ = false; |
+ changed_viewport_or_crop_ = false; |
bool secure_output_only = pending_only_visible_on_secure_output_; |
pending_only_visible_on_secure_output_ = false; |