| 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/renderer_host/browser_compositor_view_mac.h" | 5 #include "content/browser/renderer_host/browser_compositor_view_mac.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 weak_factory_.GetWeakPtr(), callback); | 263 weak_factory_.GetWeakPtr(), callback); |
| 264 | 264 |
| 265 delegated_frame_host_->CopyFromCompositingSurfaceToVideoFrame( | 265 delegated_frame_host_->CopyFromCompositingSurfaceToVideoFrame( |
| 266 src_subrect, target, callback_with_decrement); | 266 src_subrect, target, callback_with_decrement); |
| 267 } | 267 } |
| 268 | 268 |
| 269 void BrowserCompositorMac::SwapCompositorFrame( | 269 void BrowserCompositorMac::SwapCompositorFrame( |
| 270 uint32_t compositor_frame_sink_id, | 270 uint32_t compositor_frame_sink_id, |
| 271 cc::CompositorFrame frame) { | 271 cc::CompositorFrame frame) { |
| 272 // Compute the frame size based on the root render pass rect size. | 272 // Compute the frame size based on the root render pass rect size. |
| 273 cc::RenderPass* root_pass = | 273 cc::RenderPass* root_pass = frame.render_pass_list.back().get(); |
| 274 frame.delegated_frame_data->render_pass_list.back().get(); | |
| 275 float scale_factor = frame.metadata.device_scale_factor; | 274 float scale_factor = frame.metadata.device_scale_factor; |
| 276 gfx::Size pixel_size = root_pass->output_rect.size(); | 275 gfx::Size pixel_size = root_pass->output_rect.size(); |
| 277 gfx::Size dip_size = gfx::ConvertSizeToDIP(scale_factor, pixel_size); | 276 gfx::Size dip_size = gfx::ConvertSizeToDIP(scale_factor, pixel_size); |
| 278 root_layer_->SetBounds(gfx::Rect(dip_size)); | 277 root_layer_->SetBounds(gfx::Rect(dip_size)); |
| 279 if (recyclable_compositor_) { | 278 if (recyclable_compositor_) { |
| 280 recyclable_compositor_->compositor()->SetScaleAndSize(scale_factor, | 279 recyclable_compositor_->compositor()->SetScaleAndSize(scale_factor, |
| 281 pixel_size); | 280 pixel_size); |
| 282 } | 281 } |
| 283 delegated_frame_host_->SwapDelegatedFrame(compositor_frame_sink_id, | 282 delegated_frame_host_->SwapDelegatedFrame(compositor_frame_sink_id, |
| 284 std::move(frame)); | 283 std::move(frame)); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 466 |
| 468 const cc::BeginFrameArgs& BrowserCompositorMac::LastUsedBeginFrameArgs() const { | 467 const cc::BeginFrameArgs& BrowserCompositorMac::LastUsedBeginFrameArgs() const { |
| 469 return last_begin_frame_args_; | 468 return last_begin_frame_args_; |
| 470 } | 469 } |
| 471 | 470 |
| 472 void BrowserCompositorMac::OnBeginFrameSourcePausedChanged(bool paused) { | 471 void BrowserCompositorMac::OnBeginFrameSourcePausedChanged(bool paused) { |
| 473 // Only used on Android WebView. | 472 // Only used on Android WebView. |
| 474 } | 473 } |
| 475 | 474 |
| 476 } // namespace content | 475 } // namespace content |
| OLD | NEW |