Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: components/exo/surface.cc

Issue 2032173002: exo: Allow updating cc::Surface viewport and crop state independently. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/exo/surface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « components/exo/surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698