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

Side by Side Diff: components/exo/shell_surface.cc

Issue 2041193006: exo: Only create new SurfaceLayer if layer properties change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/exo/shell_surface.h" 5 #include "components/exo/shell_surface.h"
6 6
7 #include "ash/aura/wm_window_aura.h" 7 #include "ash/aura/wm_window_aura.h"
8 #include "ash/common/shell_window_ids.h" 8 #include "ash/common/shell_window_ids.h"
9 #include "ash/common/wm/window_resizer.h" 9 #include "ash/common/wm/window_resizer.h"
10 #include "ash/common/wm/window_state.h" 10 #include "ash/common/wm/window_state.h"
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 new base::trace_event::TracedValue()); 390 new base::trace_event::TracedValue());
391 value->SetString("title", base::UTF16ToUTF8(title_)); 391 value->SetString("title", base::UTF16ToUTF8(title_));
392 value->SetString("application_id", application_id_); 392 value->SetString("application_id", application_id_);
393 return value; 393 return value;
394 } 394 }
395 395
396 //////////////////////////////////////////////////////////////////////////////// 396 ////////////////////////////////////////////////////////////////////////////////
397 // SurfaceDelegate overrides: 397 // SurfaceDelegate overrides:
398 398
399 void ShellSurface::OnSurfaceCommit() { 399 void ShellSurface::OnSurfaceCommit() {
400 surface_->CheckForCommittingToNewSurface();
400 surface_->CommitSurfaceHierarchy(); 401 surface_->CommitSurfaceHierarchy();
401 402
402 if (enabled() && !widget_) 403 if (enabled() && !widget_)
403 CreateShellSurfaceWidget(ui::SHOW_STATE_NORMAL); 404 CreateShellSurfaceWidget(ui::SHOW_STATE_NORMAL);
404 405
405 // Apply the accumulated pending origin offset to reflect acknowledged 406 // Apply the accumulated pending origin offset to reflect acknowledged
406 // configure requests. 407 // configure requests.
407 origin_ += pending_origin_offset_; 408 origin_ += pending_origin_offset_;
408 pending_origin_offset_ = gfx::Vector2d(); 409 pending_origin_offset_ = gfx::Vector2d();
409 410
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 DCHECK(!ignore_window_bounds_changes_); 964 DCHECK(!ignore_window_bounds_changes_);
964 ignore_window_bounds_changes_ = true; 965 ignore_window_bounds_changes_ = true;
965 widget_->SetBounds(new_widget_bounds); 966 widget_->SetBounds(new_widget_bounds);
966 ignore_window_bounds_changes_ = false; 967 ignore_window_bounds_changes_ = false;
967 968
968 // A change to the widget size requires surface bounds to be re-adjusted. 969 // A change to the widget size requires surface bounds to be re-adjusted.
969 surface_->SetBounds(gfx::Rect(GetSurfaceOrigin(), surface_->layer()->size())); 970 surface_->SetBounds(gfx::Rect(GetSurfaceOrigin(), surface_->layer()->size()));
970 } 971 }
971 972
972 } // namespace exo 973 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698