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

Side by Side Diff: services/ui/public/cpp/window_tree_client.cc

Issue 2610723002: Unify SurfaceInfo (Closed)
Patch Set: Cleanup offscreen canvas Created 3 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "services/ui/public/cpp/window_tree_client.h" 5 #include "services/ui/public/cpp/window_tree_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 1133
1134 InFlightPredefinedCursorChange new_change(window, cursor); 1134 InFlightPredefinedCursorChange new_change(window, cursor);
1135 if (ApplyServerChangeToExistingInFlightChange(new_change)) 1135 if (ApplyServerChangeToExistingInFlightChange(new_change))
1136 return; 1136 return;
1137 1137
1138 WindowPrivate(window).LocalSetPredefinedCursor(cursor); 1138 WindowPrivate(window).LocalSetPredefinedCursor(cursor);
1139 } 1139 }
1140 1140
1141 void WindowTreeClient::OnWindowSurfaceChanged( 1141 void WindowTreeClient::OnWindowSurfaceChanged(
1142 Id window_id, 1142 Id window_id,
1143 const cc::SurfaceId& surface_id, 1143 const cc::SurfaceInfo& surface_info) {
1144 const gfx::Size& frame_size,
1145 float device_scale_factor) {
1146 Window* window = GetWindowByServerId(window_id); 1144 Window* window = GetWindowByServerId(window_id);
1147 if (!window) 1145 if (!window)
1148 return; 1146 return;
1149 std::unique_ptr<SurfaceInfo> surface_info(base::MakeUnique<SurfaceInfo>()); 1147 WindowPrivate(window).LocalSetSurfaceInfo(surface_info);
1150 surface_info->surface_id = surface_id;
1151 surface_info->frame_size = frame_size;
1152 surface_info->device_scale_factor = device_scale_factor;
1153 WindowPrivate(window).LocalSetSurfaceId(std::move(surface_info));
1154 } 1148 }
1155 1149
1156 void WindowTreeClient::OnDragDropStart( 1150 void WindowTreeClient::OnDragDropStart(
1157 const std::unordered_map<std::string, std::vector<uint8_t>>& mime_data) { 1151 const std::unordered_map<std::string, std::vector<uint8_t>>& mime_data) {
1158 mime_drag_data_ = mojo::UnorderedMapToMap(mime_data); 1152 mime_drag_data_ = mojo::UnorderedMapToMap(mime_data);
1159 } 1153 }
1160 1154
1161 void WindowTreeClient::OnDragEnter(Id window_id, 1155 void WindowTreeClient::OnDragEnter(Id window_id,
1162 uint32_t key_state, 1156 uint32_t key_state,
1163 const gfx::Point& position, 1157 const gfx::Point& position,
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 // TODO(riajiang): Figure out if |offset| needs to be converted. 1471 // TODO(riajiang): Figure out if |offset| needs to be converted.
1478 // (http://crbugs.com/646932) 1472 // (http://crbugs.com/646932)
1479 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( 1473 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea(
1480 server_id(window), offset.x(), offset.y(), 1474 server_id(window), offset.x(), offset.y(),
1481 gfx::ConvertInsetsToDIP(ScaleFactorForDisplay(window->display_id()), 1475 gfx::ConvertInsetsToDIP(ScaleFactorForDisplay(window->display_id()),
1482 hit_area)); 1476 hit_area));
1483 } 1477 }
1484 } 1478 }
1485 1479
1486 } // namespace ui 1480 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/public/cpp/window_tree_client.h ('k') | services/ui/public/interfaces/window_tree.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698