| 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 = frame.render_pass_list.back().get(); | 273 cc::RenderPass* root_pass = |
| 274 frame.delegated_frame_data->render_pass_list.back().get(); |
| 274 float scale_factor = frame.metadata.device_scale_factor; | 275 float scale_factor = frame.metadata.device_scale_factor; |
| 275 gfx::Size pixel_size = root_pass->output_rect.size(); | 276 gfx::Size pixel_size = root_pass->output_rect.size(); |
| 276 gfx::Size dip_size = gfx::ConvertSizeToDIP(scale_factor, pixel_size); | 277 gfx::Size dip_size = gfx::ConvertSizeToDIP(scale_factor, pixel_size); |
| 277 root_layer_->SetBounds(gfx::Rect(dip_size)); | 278 root_layer_->SetBounds(gfx::Rect(dip_size)); |
| 278 if (recyclable_compositor_) { | 279 if (recyclable_compositor_) { |
| 279 recyclable_compositor_->compositor()->SetScaleAndSize(scale_factor, | 280 recyclable_compositor_->compositor()->SetScaleAndSize(scale_factor, |
| 280 pixel_size); | 281 pixel_size); |
| 281 } | 282 } |
| 282 delegated_frame_host_->SwapDelegatedFrame(compositor_frame_sink_id, | 283 delegated_frame_host_->SwapDelegatedFrame(compositor_frame_sink_id, |
| 283 std::move(frame)); | 284 std::move(frame)); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 | 467 |
| 467 const cc::BeginFrameArgs& BrowserCompositorMac::LastUsedBeginFrameArgs() const { | 468 const cc::BeginFrameArgs& BrowserCompositorMac::LastUsedBeginFrameArgs() const { |
| 468 return last_begin_frame_args_; | 469 return last_begin_frame_args_; |
| 469 } | 470 } |
| 470 | 471 |
| 471 void BrowserCompositorMac::OnBeginFrameSourcePausedChanged(bool paused) { | 472 void BrowserCompositorMac::OnBeginFrameSourcePausedChanged(bool paused) { |
| 472 // Only used on Android WebView. | 473 // Only used on Android WebView. |
| 473 } | 474 } |
| 474 | 475 |
| 475 } // namespace content | 476 } // namespace content |
| OLD | NEW |