Index: components/mus/display_manager.cc |
diff --git a/components/view_manager/display_manager.cc b/components/mus/display_manager.cc |
similarity index 86% |
rename from components/view_manager/display_manager.cc |
rename to components/mus/display_manager.cc |
index b99c9983870767f39ab4d6fa96ec48a47a7a0194..af29f1f6d4128ec12289b1f3ce1d724520a5c6fa 100644 |
--- a/components/view_manager/display_manager.cc |
+++ b/components/mus/display_manager.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "components/view_manager/display_manager.h" |
+#include "components/mus/display_manager.h" |
#include "base/numerics/safe_conversions.h" |
#include "cc/output/compositor_frame.h" |
@@ -10,13 +10,13 @@ |
#include "cc/quads/render_pass.h" |
#include "cc/quads/shared_quad_state.h" |
#include "cc/quads/surface_draw_quad.h" |
-#include "components/view_manager/display_manager_factory.h" |
-#include "components/view_manager/gles2/gpu_state.h" |
-#include "components/view_manager/public/interfaces/gpu.mojom.h" |
-#include "components/view_manager/public/interfaces/quads.mojom.h" |
-#include "components/view_manager/server_view.h" |
-#include "components/view_manager/surfaces/surfaces_state.h" |
-#include "components/view_manager/view_coordinate_conversions.h" |
+#include "components/mus/display_manager_factory.h" |
+#include "components/mus/gles2/gpu_state.h" |
+#include "components/mus/public/interfaces/gpu.mojom.h" |
+#include "components/mus/public/interfaces/quads.mojom.h" |
+#include "components/mus/server_view.h" |
+#include "components/mus/surfaces/surfaces_state.h" |
+#include "components/mus/view_coordinate_conversions.h" |
#include "mojo/application/public/cpp/application_connection.h" |
#include "mojo/application/public/cpp/application_impl.h" |
#include "mojo/converters/geometry/geometry_type_converters.h" |
@@ -59,8 +59,7 @@ void DrawViewTree(cc::RenderPass* pass, |
std::vector<const ServerView*> children(view->GetChildren()); |
const float combined_opacity = opacity * view->opacity(); |
for (std::vector<const ServerView*>::reverse_iterator it = children.rbegin(); |
- it != children.rend(); |
- ++it) { |
+ it != children.rend(); ++it) { |
DrawViewTree(pass, *it, absolute_bounds.OffsetFromOrigin(), |
combined_opacity); |
} |
@@ -71,21 +70,15 @@ void DrawViewTree(cc::RenderPass* pass, |
cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); |
// TODO(fsamuel): These clipping and visible rects are incorrect. They need |
// to be populated from CompositorFrame structs. |
- sqs->SetAll(quad_to_target_transform, |
- bounds_at_origin.size() /* layer_bounds */, |
- bounds_at_origin /* visible_layer_bounds */, |
- bounds_at_origin /* clip_rect */, |
- false /* is_clipped */, |
- view->opacity(), |
- SkXfermode::kSrc_Mode, |
- 0 /* sorting-context_id */); |
- |
- auto surface_quad = |
- pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); |
- surface_quad->SetNew(sqs, |
- bounds_at_origin /* rect */, |
- bounds_at_origin /* visible_rect */, |
- view->surface_id()); |
+ sqs->SetAll( |
+ quad_to_target_transform, bounds_at_origin.size() /* layer_bounds */, |
+ bounds_at_origin /* visible_layer_bounds */, |
+ bounds_at_origin /* clip_rect */, false /* is_clipped */, view->opacity(), |
+ SkXfermode::kSrc_Mode, 0 /* sorting-context_id */); |
+ |
+ auto surface_quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); |
+ surface_quad->SetNew(sqs, bounds_at_origin /* rect */, |
+ bounds_at_origin /* visible_rect */, view->surface_id()); |
} |
float ConvertUIWheelValueToMojoValue(int offset) { |
@@ -212,9 +205,8 @@ void DefaultDisplayManager::Draw() { |
render_pass->damage_rect = dirty_rect_; |
render_pass->output_rect = gfx::Rect(metrics_.size_in_pixels.To<gfx::Size>()); |
- DrawViewTree(render_pass.get(), |
- delegate_->GetRootView(), |
- gfx::Vector2d(), 1.0f); |
+ DrawViewTree(render_pass.get(), delegate_->GetRootView(), gfx::Vector2d(), |
+ 1.0f); |
scoped_ptr<cc::DelegatedFrameData> frame_data(new cc::DelegatedFrameData); |
frame_data->device_scale_factor = 1.f; |
@@ -225,9 +217,8 @@ void DefaultDisplayManager::Draw() { |
frame_pending_ = true; |
if (top_level_display_client_) { |
top_level_display_client_->SubmitCompositorFrame( |
- frame.Pass(), |
- base::Bind(&DefaultDisplayManager::DidDraw, |
- weak_factory_.GetWeakPtr())); |
+ frame.Pass(), base::Bind(&DefaultDisplayManager::DidDraw, |
+ weak_factory_.GetWeakPtr())); |
} |
dirty_rect_ = gfx::Rect(); |
} |
@@ -278,8 +269,7 @@ void DefaultDisplayManager::DispatchEvent(ui::Event* event) { |
if (event->IsMouseWheelEvent()) { |
// Mojo's event type has a different meaning for wheel events. Convert |
// between the two. |
- ui::MouseWheelEvent* wheel_event = |
- static_cast<ui::MouseWheelEvent*>(event); |
+ ui::MouseWheelEvent* wheel_event = static_cast<ui::MouseWheelEvent*>(event); |
DCHECK(mojo_event->pointer_data); |
mojo_event->pointer_data->horizontal_wheel = |
ConvertUIWheelValueToMojoValue(wheel_event->x_offset()); |
@@ -326,8 +316,7 @@ void DefaultDisplayManager::DispatchEvent(ui::Event* event) { |
char_event.SetExtendedKeyEventData( |
make_scoped_ptr(new mojo::MojoExtendedKeyEventData( |
key_press_event->GetLocatedWindowsKeyboardCode(), |
- key_press_event->GetText(), |
- key_press_event->GetUnmodifiedText()))); |
+ key_press_event->GetText(), key_press_event->GetUnmodifiedText()))); |
char_event.set_platform_keycode(key_press_event->platform_keycode()); |
delegate_->OnEvent(mojo::Event::From(char_event)); |
@@ -344,11 +333,9 @@ void DefaultDisplayManager::OnClosed() { |
} |
void DefaultDisplayManager::OnWindowStateChanged( |
- ui::PlatformWindowState new_state) { |
-} |
+ ui::PlatformWindowState new_state) {} |
-void DefaultDisplayManager::OnLostCapture() { |
-} |
+void DefaultDisplayManager::OnLostCapture() {} |
void DefaultDisplayManager::OnAcceleratedWidgetAvailable( |
gfx::AcceleratedWidget widget, |
@@ -360,7 +347,6 @@ void DefaultDisplayManager::OnAcceleratedWidgetAvailable( |
UpdateMetrics(metrics_.size_in_pixels.To<gfx::Size>(), device_pixel_ratio); |
} |
-void DefaultDisplayManager::OnActivationChanged(bool active) { |
-} |
+void DefaultDisplayManager::OnActivationChanged(bool active) {} |
} // namespace view_manager |