| 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 // Compute the frame size based on the root render pass rect size. | 275 // Compute the frame size based on the root render pass rect size. |
| 276 cc::RenderPass* root_pass = frame.render_pass_list.back().get(); | 276 cc::RenderPass* root_pass = frame.render_pass_list.back().get(); |
| 277 float scale_factor = frame.metadata.device_scale_factor; | 277 float scale_factor = frame.metadata.device_scale_factor; |
| 278 gfx::Size pixel_size = root_pass->output_rect.size(); | 278 gfx::Size pixel_size = root_pass->output_rect.size(); |
| 279 gfx::Size dip_size = gfx::ConvertSizeToDIP(scale_factor, pixel_size); | 279 gfx::Size dip_size = gfx::ConvertSizeToDIP(scale_factor, pixel_size); |
| 280 root_layer_->SetBounds(gfx::Rect(dip_size)); | 280 root_layer_->SetBounds(gfx::Rect(dip_size)); |
| 281 if (recyclable_compositor_) { | 281 if (recyclable_compositor_) { |
| 282 recyclable_compositor_->compositor()->SetScaleAndSize(scale_factor, | 282 recyclable_compositor_->compositor()->SetScaleAndSize(scale_factor, |
| 283 pixel_size); | 283 pixel_size); |
| 284 } | 284 } |
| 285 cc::BeginFrameAck ack(frame.metadata.begin_frame_ack); |
| 285 delegated_frame_host_->SwapDelegatedFrame(compositor_frame_sink_id, | 286 delegated_frame_host_->SwapDelegatedFrame(compositor_frame_sink_id, |
| 286 local_surface_id, std::move(frame)); | 287 local_surface_id, std::move(frame)); |
| 288 if (begin_frame_source_) |
| 289 begin_frame_source_->DidFinishFrame(this, ack); |
| 290 } |
| 291 |
| 292 void BrowserCompositorMac::OnBeginFrameDidNotSwap( |
| 293 const cc::BeginFrameAck& ack) { |
| 294 if (begin_frame_source_) |
| 295 begin_frame_source_->DidFinishFrame(this, ack); |
| 287 } | 296 } |
| 288 | 297 |
| 289 void BrowserCompositorMac::SetHasTransparentBackground(bool transparent) { | 298 void BrowserCompositorMac::SetHasTransparentBackground(bool transparent) { |
| 290 has_transparent_background_ = transparent; | 299 has_transparent_background_ = transparent; |
| 291 if (recyclable_compositor_) { | 300 if (recyclable_compositor_) { |
| 292 recyclable_compositor_->compositor()->SetHostHasTransparentBackground( | 301 recyclable_compositor_->compositor()->SetHostHasTransparentBackground( |
| 293 has_transparent_background_); | 302 has_transparent_background_); |
| 294 } | 303 } |
| 295 } | 304 } |
| 296 | 305 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 | 478 |
| 470 const cc::BeginFrameArgs& BrowserCompositorMac::LastUsedBeginFrameArgs() const { | 479 const cc::BeginFrameArgs& BrowserCompositorMac::LastUsedBeginFrameArgs() const { |
| 471 return last_begin_frame_args_; | 480 return last_begin_frame_args_; |
| 472 } | 481 } |
| 473 | 482 |
| 474 void BrowserCompositorMac::OnBeginFrameSourcePausedChanged(bool paused) { | 483 void BrowserCompositorMac::OnBeginFrameSourcePausedChanged(bool paused) { |
| 475 // Only used on Android WebView. | 484 // Only used on Android WebView. |
| 476 } | 485 } |
| 477 | 486 |
| 478 } // namespace content | 487 } // namespace content |
| OLD | NEW |