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

Side by Side Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 2144733005: [WIP] cc: Plumb SurfaceId from clients Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ensure only SurfaceFactoy and tests can update hierarchy Created 4 years, 5 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 | « content/renderer/gpu/render_widget_compositor.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/renderer/gpu/render_widget_compositor.h" 5 #include "content/renderer/gpu/render_widget_compositor.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 1118
1119 void RenderWidgetCompositor::SendCompositorProto( 1119 void RenderWidgetCompositor::SendCompositorProto(
1120 const cc::proto::CompositorMessage& proto) { 1120 const cc::proto::CompositorMessage& proto) {
1121 int signed_size = proto.ByteSize(); 1121 int signed_size = proto.ByteSize();
1122 size_t unsigned_size = base::checked_cast<size_t>(signed_size); 1122 size_t unsigned_size = base::checked_cast<size_t>(signed_size);
1123 std::vector<uint8_t> serialized(unsigned_size); 1123 std::vector<uint8_t> serialized(unsigned_size);
1124 proto.SerializeToArray(serialized.data(), signed_size); 1124 proto.SerializeToArray(serialized.data(), signed_size);
1125 delegate_->ForwardCompositorProto(serialized); 1125 delegate_->ForwardCompositorProto(serialized);
1126 } 1126 }
1127 1127
1128 uint32_t RenderWidgetCompositor::GetSurfaceClientId() const {
1129 return layer_tree_host_->surface_client_id();
1130 }
1131
1128 void RenderWidgetCompositor::SetSurfaceClientId(uint32_t surface_client_id) { 1132 void RenderWidgetCompositor::SetSurfaceClientId(uint32_t surface_client_id) {
1129 layer_tree_host_->set_surface_client_id(surface_client_id); 1133 layer_tree_host_->set_surface_client_id(surface_client_id);
1130 } 1134 }
1131 1135
1132 void RenderWidgetCompositor::OnHandleCompositorProto( 1136 void RenderWidgetCompositor::OnHandleCompositorProto(
1133 const std::vector<uint8_t>& proto) { 1137 const std::vector<uint8_t>& proto) {
1134 DCHECK(remote_proto_channel_receiver_); 1138 DCHECK(remote_proto_channel_receiver_);
1135 1139
1136 std::unique_ptr<cc::proto::CompositorMessage> deserialized( 1140 std::unique_ptr<cc::proto::CompositorMessage> deserialized(
1137 new cc::proto::CompositorMessage); 1141 new cc::proto::CompositorMessage);
1138 int signed_size = base::checked_cast<int>(proto.size()); 1142 int signed_size = base::checked_cast<int>(proto.size());
1139 if (!deserialized->ParseFromArray(proto.data(), signed_size)) { 1143 if (!deserialized->ParseFromArray(proto.data(), signed_size)) {
1140 LOG(ERROR) << "Unable to parse compositor proto."; 1144 LOG(ERROR) << "Unable to parse compositor proto.";
1141 return; 1145 return;
1142 } 1146 }
1143 1147
1144 remote_proto_channel_receiver_->OnProtoReceived(std::move(deserialized)); 1148 remote_proto_channel_receiver_->OnProtoReceived(std::move(deserialized));
1145 } 1149 }
1146 1150
1147 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( 1151 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor(
1148 float device_scale) { 1152 float device_scale) {
1149 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); 1153 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale);
1150 } 1154 }
1151 1155
1152 } // namespace content 1156 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698