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

Unified Diff: ui/aura/mus/window_port_mus.cc

Issue 2875753002: Implement aura::WindowPortMus::CreateCompositorFrameSink() (Closed)
Patch Set: WIP Created 3 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
« services/ui/ws/window_tree.cc ('K') | « services/ui/ws/window_tree.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_port_mus.cc
diff --git a/ui/aura/mus/window_port_mus.cc b/ui/aura/mus/window_port_mus.cc
index b946380ee01b382faa7ee45716b51182c7f698b6..f77e54dc9d53e34c4e2702cc97276a89355434f1 100644
--- a/ui/aura/mus/window_port_mus.cc
+++ b/ui/aura/mus/window_port_mus.cc
@@ -7,6 +7,7 @@
#include "base/memory/ptr_util.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/transient_window_client.h"
+#include "ui/aura/env.h"
#include "ui/aura/mus/client_surface_embedder.h"
#include "ui/aura/mus/property_converter.h"
#include "ui/aura/mus/window_tree_client.h"
@@ -496,12 +497,28 @@ void WindowPortMus::OnPropertyChanged(const void* key,
std::unique_ptr<cc::CompositorFrameSink>
WindowPortMus::CreateCompositorFrameSink() {
Fady Samuel 2017/05/18 20:02:02 This is super confusing. We have a RequestComposit
Peng 2017/05/18 20:51:00 Done
- // TODO(penghuang): Implement it for Mus.
- return nullptr;
+ // We only allow creating a compositor frame sink for a local window.
+ if (window_mus_type() != WindowMusType::LOCAL)
+ return nullptr;
+
+ ui::ContextFactory* context_factory =
+ aura::Env::GetInstance()->context_factory();
+ std::unique_ptr<ui::ClientCompositorFrameSinkBinding> frame_sink_binding;
+ // The compositor frame sink is for a local window, so we don't need surface
+ // synchronization.
+ const bool enable_surface_synchronization = false;
Fady Samuel 2017/05/18 20:02:02 Surface synchronization is actually a requirement
Peng 2017/05/18 20:50:59 As my understanding, when the the CompositorFrameS
Fady Samuel 2017/05/18 20:56:22 Without surface synchronization, there is no guara
Peng 2017/05/23 18:00:42 Done.
+ std::unique_ptr<ui::ClientCompositorFrameSink> frame_sink =
+ ui::ClientCompositorFrameSink::Create(
+ nullptr /* context_provider */,
+ context_factory->GetGpuMemoryBufferManager(), &frame_sink_binding,
+ enable_surface_synchronization);
+ AttachCompositorFrameSink(std::move(frame_sink_binding));
+ return std::move(frame_sink);
}
cc::SurfaceId WindowPortMus::GetSurfaceId() const {
- // TODO(penghuang): Implement it for Mus.
+ // This method is only used by exo unittests which are not running against
+ // mus, so don't implement it now.
return cc::SurfaceId();
}
@@ -520,11 +537,6 @@ void WindowPortMus::UpdatePrimarySurfaceInfo() {
}
void WindowPortMus::UpdateClientSurfaceEmbedder() {
- bool embeds_surface = window_mus_type() == WindowMusType::TOP_LEVEL_IN_WM ||
- window_mus_type() == WindowMusType::EMBED_IN_OWNER;
- if (!embeds_surface)
- return;
-
if (!client_surface_embedder_) {
client_surface_embedder_ = base::MakeUnique<ClientSurfaceEmbedder>(
window_, window_tree_client_->normal_client_area_insets_);
« services/ui/ws/window_tree.cc ('K') | « services/ui/ws/window_tree.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698