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

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

Issue 2934523002: Revert of Implement aura::WindowPortMus::CreateCompositorFrameSink() (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/mus/window_port_mus.h ('k') | ui/aura/mus/window_tree_client.cc » ('j') | 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 03acb08f04c2d3fea7c7cfef540c0e239ae5a5a4..f47ba8a4d07ea25f1a776da97c3c339e06d71e8a 100644
--- a/ui/aura/mus/window_port_mus.cc
+++ b/ui/aura/mus/window_port_mus.cc
@@ -8,7 +8,6 @@
#include "components/viz/client/local_surface_id_provider.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"
@@ -96,7 +95,7 @@
window_tree_client_->Embed(window_, std::move(client), flags, callback);
}
-std::unique_ptr<viz::ClientCompositorFrameSink>
+std::unique_ptr<cc::CompositorFrameSink>
WindowPortMus::RequestCompositorFrameSink(
scoped_refptr<cc::ContextProvider> context_provider,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) {
@@ -116,7 +115,7 @@
enable_surface_synchronization);
window_tree_client_->AttachCompositorFrameSink(
server_id(), std::move(sink_request), std::move(client));
- return compositor_frame_sink;
+ return std::move(compositor_frame_sink);
}
WindowPortMus::ServerChangeIdType WindowPortMus::ScheduleChange(
@@ -307,25 +306,18 @@
if (frame_sink_id_.is_valid())
UpdatePrimarySurfaceInfo();
- if (local_compositor_frame_sink_)
- local_compositor_frame_sink_->SetLocalSurfaceId(local_surface_id_);
-
return local_surface_id_;
+}
+
+void WindowPortMus::SetPrimarySurfaceInfo(const cc::SurfaceInfo& surface_info) {
+ primary_surface_info_ = surface_info;
+ UpdateClientSurfaceEmbedder();
+ if (window_->delegate())
+ window_->delegate()->OnWindowSurfaceChanged(surface_info);
}
void WindowPortMus::SetFallbackSurfaceInfo(
const cc::SurfaceInfo& surface_info) {
- if (!frame_sink_id_.is_valid()) {
- // |primary_surface_info_| shold not be valid, since we didn't know the
- // |frame_sink_id_|.
- DCHECK(!primary_surface_info_.is_valid());
- frame_sink_id_ = surface_info.id().frame_sink_id();
- UpdatePrimarySurfaceInfo();
- }
-
- // The frame sink id should never be changed.
- DCHECK_EQ(surface_info.id().frame_sink_id(), frame_sink_id_);
-
fallback_surface_info_ = surface_info;
UpdateClientSurfaceEmbedder();
}
@@ -434,10 +426,6 @@
observer.OnEmbeddedAppDisconnected(window_);
}
-bool WindowPortMus::HasLocalCompositorFrameSink() {
- return !!local_compositor_frame_sink_;
-}
-
void WindowPortMus::OnPreInit(Window* window) {
window_ = window;
window_tree_client_->OnWindowMusCreated(this);
@@ -533,46 +521,38 @@
std::unique_ptr<cc::CompositorFrameSink>
WindowPortMus::CreateCompositorFrameSink() {
- DCHECK_EQ(window_mus_type(), WindowMusType::LOCAL);
- DCHECK(!local_compositor_frame_sink_);
- auto frame_sink = RequestCompositorFrameSink(
- nullptr,
- aura::Env::GetInstance()->context_factory()->GetGpuMemoryBufferManager());
- local_compositor_frame_sink_ = frame_sink->GetWeakPtr();
- return frame_sink;
+ // TODO(penghuang): Implement it for Mus.
+ return nullptr;
}
cc::SurfaceId WindowPortMus::GetSurfaceId() const {
- // This is only used by WindowPortLocal in unit tests.
+ // TODO(penghuang): Implement it for Mus.
return cc::SurfaceId();
}
void WindowPortMus::UpdatePrimarySurfaceInfo() {
- if (window_mus_type() != WindowMusType::TOP_LEVEL_IN_WM &&
- window_mus_type() != WindowMusType::EMBED_IN_OWNER &&
- window_mus_type() != WindowMusType::DISPLAY_MANUALLY_CREATED &&
- window_mus_type() != WindowMusType::LOCAL) {
+ bool embeds_surface =
+ window_mus_type() == WindowMusType::TOP_LEVEL_IN_WM ||
+ window_mus_type() == WindowMusType::EMBED_IN_OWNER ||
+ window_mus_type() == WindowMusType::DISPLAY_MANUALLY_CREATED;
+ if (!embeds_surface)
return;
- }
if (!frame_sink_id_.is_valid() || !local_surface_id_.is_valid())
return;
- primary_surface_info_ = cc::SurfaceInfo(
+ SetPrimarySurfaceInfo(cc::SurfaceInfo(
cc::SurfaceId(frame_sink_id_, local_surface_id_),
- ScaleFactorForDisplay(window_), last_surface_size_in_pixels_);
- UpdateClientSurfaceEmbedder();
- if (window_->delegate())
- window_->delegate()->OnWindowSurfaceChanged(primary_surface_info_);
+ ScaleFactorForDisplay(window_), last_surface_size_in_pixels_));
}
void WindowPortMus::UpdateClientSurfaceEmbedder() {
- if (window_mus_type() != WindowMusType::TOP_LEVEL_IN_WM &&
- window_mus_type() != WindowMusType::EMBED_IN_OWNER &&
- window_mus_type() != WindowMusType::DISPLAY_MANUALLY_CREATED &&
- window_mus_type() != WindowMusType::LOCAL) {
+ bool embeds_surface =
+ window_mus_type() == WindowMusType::TOP_LEVEL_IN_WM ||
+ window_mus_type() == WindowMusType::EMBED_IN_OWNER ||
+ window_mus_type() == WindowMusType::DISPLAY_MANUALLY_CREATED;
+ if (!embeds_surface)
return;
- }
if (!client_surface_embedder_) {
client_surface_embedder_ = base::MakeUnique<ClientSurfaceEmbedder>(
« no previous file with comments | « ui/aura/mus/window_port_mus.h ('k') | ui/aura/mus/window_tree_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698