OLD | NEW |
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 "content/browser/frame_host/render_widget_host_view_child_frame.h" | 5 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 MockCrossProcessFrameConnector* test_frame_connector_; | 120 MockCrossProcessFrameConnector* test_frame_connector_; |
121 | 121 |
122 private: | 122 private: |
123 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrameTest); | 123 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrameTest); |
124 }; | 124 }; |
125 | 125 |
126 std::unique_ptr<cc::CompositorFrame> CreateDelegatedFrame( | 126 std::unique_ptr<cc::CompositorFrame> CreateDelegatedFrame( |
127 float scale_factor, | 127 float scale_factor, |
128 gfx::Size size, | 128 gfx::Size size, |
129 const gfx::Rect& damage) { | 129 const gfx::Rect& damage) { |
130 std::unique_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); | 130 std::unique_ptr<cc::CompositorFrame> frame(cc::CompositorFrame::Create()); |
131 frame->metadata.device_scale_factor = scale_factor; | 131 frame->metadata.device_scale_factor = scale_factor; |
132 frame->delegated_frame_data.reset(new cc::DelegatedFrameData); | 132 frame->delegated_frame_data.reset(new cc::DelegatedFrameData); |
133 | 133 |
134 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create(); | 134 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create(); |
135 pass->SetNew(cc::RenderPassId(1, 1), gfx::Rect(size), damage, | 135 pass->SetNew(cc::RenderPassId(1, 1), gfx::Rect(size), damage, |
136 gfx::Transform()); | 136 gfx::Transform()); |
137 frame->delegated_frame_data->render_pass_list.push_back(std::move(pass)); | 137 frame->delegated_frame_data->render_pass_list.push_back(std::move(pass)); |
138 return frame; | 138 return frame; |
139 } | 139 } |
140 | 140 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 // Surface ID should have been passed to CrossProcessFrameConnector to | 173 // Surface ID should have been passed to CrossProcessFrameConnector to |
174 // be sent to the embedding renderer. | 174 // be sent to the embedding renderer. |
175 EXPECT_EQ(id, test_frame_connector_->last_surface_id_received_); | 175 EXPECT_EQ(id, test_frame_connector_->last_surface_id_received_); |
176 EXPECT_EQ(view_size, test_frame_connector_->last_frame_size_received_); | 176 EXPECT_EQ(view_size, test_frame_connector_->last_frame_size_received_); |
177 EXPECT_EQ(scale_factor, test_frame_connector_->last_scale_factor_received_); | 177 EXPECT_EQ(scale_factor, test_frame_connector_->last_scale_factor_received_); |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
181 } // namespace content | 181 } // namespace content |
OLD | NEW |