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

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

Issue 2644653003: Make OffscreenCanvas animation in sync with its placeholder canvas's parent frame rate (Closed)
Patch Set: fix based on both reviewers 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 (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 8
9 #include <cmath> 9 #include <cmath>
10 #include <limits> 10 #include <limits>
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 proto.SerializeToArray(serialized.data(), signed_size); 1111 proto.SerializeToArray(serialized.data(), signed_size);
1112 delegate_->ForwardCompositorProto(serialized); 1112 delegate_->ForwardCompositorProto(serialized);
1113 } 1113 }
1114 1114
1115 void RenderWidgetCompositor::SetFrameSinkId( 1115 void RenderWidgetCompositor::SetFrameSinkId(
1116 const cc::FrameSinkId& frame_sink_id) { 1116 const cc::FrameSinkId& frame_sink_id) {
1117 frame_sink_id_ = frame_sink_id; 1117 frame_sink_id_ = frame_sink_id;
1118 layer_tree_host_->SetFrameSinkId(frame_sink_id); 1118 layer_tree_host_->SetFrameSinkId(frame_sink_id);
1119 } 1119 }
1120 1120
1121 cc::FrameSinkId RenderWidgetCompositor::getFrameSinkId() {
1122 return frame_sink_id_;
dcheng 2017/01/20 08:44:12 Nit: function definitions should be ordered by ord
xlai (Olivia) 2017/01/20 16:36:21 Done.
1123 }
1124
1121 void RenderWidgetCompositor::OnHandleCompositorProto( 1125 void RenderWidgetCompositor::OnHandleCompositorProto(
1122 const std::vector<uint8_t>& proto) { 1126 const std::vector<uint8_t>& proto) {
1123 DCHECK(remote_proto_channel_receiver_); 1127 DCHECK(remote_proto_channel_receiver_);
1124 1128
1125 std::unique_ptr<cc::proto::CompositorMessage> deserialized( 1129 std::unique_ptr<cc::proto::CompositorMessage> deserialized(
1126 new cc::proto::CompositorMessage); 1130 new cc::proto::CompositorMessage);
1127 int signed_size = base::checked_cast<int>(proto.size()); 1131 int signed_size = base::checked_cast<int>(proto.size());
1128 if (!deserialized->ParseFromArray(proto.data(), signed_size)) { 1132 if (!deserialized->ParseFromArray(proto.data(), signed_size)) {
1129 LOG(ERROR) << "Unable to parse compositor proto."; 1133 LOG(ERROR) << "Unable to parse compositor proto.";
1130 return; 1134 return;
1131 } 1135 }
1132 1136
1133 remote_proto_channel_receiver_->OnProtoReceived(std::move(deserialized)); 1137 remote_proto_channel_receiver_->OnProtoReceived(std::move(deserialized));
1134 } 1138 }
1135 1139
1136 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( 1140 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor(
1137 float device_scale) { 1141 float device_scale) {
1138 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale); 1142 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale);
1139 } 1143 }
1140 1144
1141 void RenderWidgetCompositor::SetDeviceColorSpace( 1145 void RenderWidgetCompositor::SetDeviceColorSpace(
1142 const gfx::ColorSpace& color_space) { 1146 const gfx::ColorSpace& color_space) {
1143 layer_tree_host_->GetLayerTree()->SetDeviceColorSpace(color_space); 1147 layer_tree_host_->GetLayerTree()->SetDeviceColorSpace(color_space);
1144 } 1148 }
1145 1149
1146 } // namespace content 1150 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698