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

Side by Side Diff: ui/aura/mus/window_port_mus.cc

Issue 2831763002: Fix SurfaceIds in mus with surface sync off. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ui/aura/mus/window_port_mus.h" 5 #include "ui/aura/mus/window_port_mus.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "ui/aura/client/aura_constants.h" 8 #include "ui/aura/client/aura_constants.h"
9 #include "ui/aura/client/transient_window_client.h" 9 #include "ui/aura/client/transient_window_client.h"
10 #include "ui/aura/mus/client_surface_embedder.h" 10 #include "ui/aura/mus/client_surface_embedder.h"
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 // we ever have a case where changing a property cascades into changing the 517 // we ever have a case where changing a property cascades into changing the
518 // same property? 518 // same property?
519 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) 519 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data))
520 window_tree_client_->OnWindowMusPropertyChanged(this, key, old_value, 520 window_tree_client_->OnWindowMusPropertyChanged(this, key, old_value,
521 std::move(data)); 521 std::move(data));
522 } 522 }
523 523
524 void WindowPortMus::UpdatePrimarySurfaceInfo() { 524 void WindowPortMus::UpdatePrimarySurfaceInfo() {
525 bool embeds_surface = window_mus_type() == WindowMusType::TOP_LEVEL_IN_WM || 525 bool embeds_surface = window_mus_type() == WindowMusType::TOP_LEVEL_IN_WM ||
526 window_mus_type() == WindowMusType::EMBED_IN_OWNER; 526 window_mus_type() == WindowMusType::EMBED_IN_OWNER;
527 if (!embeds_surface) 527 if (!embeds_surface || !window_tree_client_->enable_surface_synchronization_)
528 return; 528 return;
529 529
530 if (!frame_sink_id_.is_valid() || !local_surface_id_.is_valid()) 530 if (!frame_sink_id_.is_valid() || !local_surface_id_.is_valid())
531 return; 531 return;
532 532
533 SetPrimarySurfaceInfo( 533 SetPrimarySurfaceInfo(
534 cc::SurfaceInfo(cc::SurfaceId(frame_sink_id_, local_surface_id_), 534 cc::SurfaceInfo(cc::SurfaceId(frame_sink_id_, local_surface_id_),
535 ScaleFactorForDisplay(window_), last_surface_size_)); 535 ScaleFactorForDisplay(window_), last_surface_size_));
536 } 536 }
537 537
538 void WindowPortMus::UpdateClientSurfaceEmbedder() { 538 void WindowPortMus::UpdateClientSurfaceEmbedder() {
539 bool embeds_surface = window_mus_type() == WindowMusType::TOP_LEVEL_IN_WM || 539 bool embeds_surface = window_mus_type() == WindowMusType::TOP_LEVEL_IN_WM ||
540 window_mus_type() == WindowMusType::EMBED_IN_OWNER; 540 window_mus_type() == WindowMusType::EMBED_IN_OWNER;
541 if (!embeds_surface) 541 if (!embeds_surface)
542 return; 542 return;
543 543
544 if (!client_surface_embedder_) { 544 if (!client_surface_embedder_) {
545 client_surface_embedder_ = base::MakeUnique<ClientSurfaceEmbedder>( 545 client_surface_embedder_ = base::MakeUnique<ClientSurfaceEmbedder>(
546 window_, window_tree_client_->normal_client_area_insets_); 546 window_, window_tree_client_->normal_client_area_insets_);
547 } 547 }
548 548
549 client_surface_embedder_->SetPrimarySurfaceInfo(primary_surface_info_); 549 client_surface_embedder_->SetPrimarySurfaceInfo(primary_surface_info_);
550 client_surface_embedder_->SetFallbackSurfaceInfo(fallback_surface_info_); 550 client_surface_embedder_->SetFallbackSurfaceInfo(fallback_surface_info_);
551 } 551 }
552 552
553 } // namespace aura 553 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698