| OLD | NEW |
| 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 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 void RenderWidgetCompositor::DidCommit() { | 1063 void RenderWidgetCompositor::DidCommit() { |
| 1064 delegate_->DidCommitCompositorFrame(); | 1064 delegate_->DidCommitCompositorFrame(); |
| 1065 compositor_deps_->GetRendererScheduler()->DidCommitFrameToCompositor(); | 1065 compositor_deps_->GetRendererScheduler()->DidCommitFrameToCompositor(); |
| 1066 } | 1066 } |
| 1067 | 1067 |
| 1068 void RenderWidgetCompositor::DidCommitAndDrawFrame() { | 1068 void RenderWidgetCompositor::DidCommitAndDrawFrame() { |
| 1069 delegate_->DidCommitAndDrawCompositorFrame(); | 1069 delegate_->DidCommitAndDrawCompositorFrame(); |
| 1070 } | 1070 } |
| 1071 | 1071 |
| 1072 void RenderWidgetCompositor::DidReceiveCompositorFrameAck() { | 1072 void RenderWidgetCompositor::DidReceiveCompositorFrameAck() { |
| 1073 delegate_->DidCompleteSwapBuffers(); | 1073 delegate_->DidReceiveCompositorFrameAck(); |
| 1074 if (!threaded_) | |
| 1075 delegate_->OnSwapBuffersComplete(); | |
| 1076 } | 1074 } |
| 1077 | 1075 |
| 1078 void RenderWidgetCompositor::DidCompletePageScaleAnimation() { | 1076 void RenderWidgetCompositor::DidCompletePageScaleAnimation() { |
| 1079 delegate_->DidCompletePageScaleAnimation(); | 1077 delegate_->DidCompletePageScaleAnimation(); |
| 1080 } | 1078 } |
| 1081 | 1079 |
| 1082 void RenderWidgetCompositor::RequestScheduleAnimation() { | 1080 void RenderWidgetCompositor::RequestScheduleAnimation() { |
| 1083 delegate_->RequestScheduleAnimation(); | 1081 delegate_->RequestScheduleAnimation(); |
| 1084 } | 1082 } |
| 1085 | 1083 |
| 1086 void RenderWidgetCompositor::DidPostSwapBuffers() { | 1084 void RenderWidgetCompositor::DidSubmitCompositorFrame() {} |
| 1087 delegate_->OnSwapBuffersPosted(); | |
| 1088 } | |
| 1089 | 1085 |
| 1090 void RenderWidgetCompositor::DidAbortSwapBuffers() { | 1086 void RenderWidgetCompositor::DidLoseCompositorFrameSink() { |
| 1091 delegate_->OnSwapBuffersAborted(); | 1087 // The CompositorFrameSink is not lost in layout tests (single thread mode). |
| 1088 NOTREACHED(); |
| 1092 } | 1089 } |
| 1093 | 1090 |
| 1094 void RenderWidgetCompositor::SetProtoReceiver(ProtoReceiver* receiver) { | 1091 void RenderWidgetCompositor::SetProtoReceiver(ProtoReceiver* receiver) { |
| 1095 remote_proto_channel_receiver_ = receiver; | 1092 remote_proto_channel_receiver_ = receiver; |
| 1096 } | 1093 } |
| 1097 | 1094 |
| 1098 void RenderWidgetCompositor::SendCompositorProto( | 1095 void RenderWidgetCompositor::SendCompositorProto( |
| 1099 const cc::proto::CompositorMessage& proto) { | 1096 const cc::proto::CompositorMessage& proto) { |
| 1100 int signed_size = proto.ByteSize(); | 1097 int signed_size = proto.ByteSize(); |
| 1101 size_t unsigned_size = base::checked_cast<size_t>(signed_size); | 1098 size_t unsigned_size = base::checked_cast<size_t>(signed_size); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1128 float device_scale) { | 1125 float device_scale) { |
| 1129 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale); | 1126 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale); |
| 1130 } | 1127 } |
| 1131 | 1128 |
| 1132 void RenderWidgetCompositor::SetDeviceColorSpace( | 1129 void RenderWidgetCompositor::SetDeviceColorSpace( |
| 1133 const gfx::ColorSpace& color_space) { | 1130 const gfx::ColorSpace& color_space) { |
| 1134 layer_tree_host_->GetLayerTree()->SetDeviceColorSpace(color_space); | 1131 layer_tree_host_->GetLayerTree()->SetDeviceColorSpace(color_space); |
| 1135 } | 1132 } |
| 1136 | 1133 |
| 1137 } // namespace content | 1134 } // namespace content |
| OLD | NEW |