Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: content/browser/renderer_host/browser_compositor_view_mac.mm

Issue 2728183002: RendererCompositorFrameSink should handle local surface id allocation (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
263 auto callback_with_decrement = 263 auto callback_with_decrement =
264 base::Bind(&BrowserCompositorMac::CopyToVideoFrameCompleted, 264 base::Bind(&BrowserCompositorMac::CopyToVideoFrameCompleted,
265 weak_factory_.GetWeakPtr(), callback); 265 weak_factory_.GetWeakPtr(), callback);
266 266
267 delegated_frame_host_->CopyFromCompositingSurfaceToVideoFrame( 267 delegated_frame_host_->CopyFromCompositingSurfaceToVideoFrame(
268 src_subrect, std::move(target), callback_with_decrement); 268 src_subrect, std::move(target), callback_with_decrement);
269 } 269 }
270 270
271 void BrowserCompositorMac::SwapCompositorFrame( 271 void BrowserCompositorMac::SwapCompositorFrame(
272 uint32_t compositor_frame_sink_id, 272 uint32_t compositor_frame_sink_id,
273 cc::LocalSurfaceId local_surface_id,
Fady Samuel 2017/03/15 12:05:47 const cc::LocalSurfaceId&
Saman Sami 2017/03/16 18:33:07 Done.
273 cc::CompositorFrame frame) { 274 cc::CompositorFrame frame) {
274 // 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.
275 cc::RenderPass* root_pass = frame.render_pass_list.back().get(); 276 cc::RenderPass* root_pass = frame.render_pass_list.back().get();
276 float scale_factor = frame.metadata.device_scale_factor; 277 float scale_factor = frame.metadata.device_scale_factor;
277 gfx::Size pixel_size = root_pass->output_rect.size(); 278 gfx::Size pixel_size = root_pass->output_rect.size();
278 gfx::Size dip_size = gfx::ConvertSizeToDIP(scale_factor, pixel_size); 279 gfx::Size dip_size = gfx::ConvertSizeToDIP(scale_factor, pixel_size);
279 root_layer_->SetBounds(gfx::Rect(dip_size)); 280 root_layer_->SetBounds(gfx::Rect(dip_size));
280 if (recyclable_compositor_) { 281 if (recyclable_compositor_) {
281 recyclable_compositor_->compositor()->SetScaleAndSize(scale_factor, 282 recyclable_compositor_->compositor()->SetScaleAndSize(scale_factor,
282 pixel_size); 283 pixel_size);
283 } 284 }
284 delegated_frame_host_->SwapDelegatedFrame(compositor_frame_sink_id, 285 delegated_frame_host_->SwapDelegatedFrame(compositor_frame_sink_id,
285 std::move(frame)); 286 local_surface_id, std::move(frame));
286 } 287 }
287 288
288 void BrowserCompositorMac::SetHasTransparentBackground(bool transparent) { 289 void BrowserCompositorMac::SetHasTransparentBackground(bool transparent) {
289 has_transparent_background_ = transparent; 290 has_transparent_background_ = transparent;
290 if (recyclable_compositor_) { 291 if (recyclable_compositor_) {
291 recyclable_compositor_->compositor()->SetHostHasTransparentBackground( 292 recyclable_compositor_->compositor()->SetHostHasTransparentBackground(
292 has_transparent_background_); 293 has_transparent_background_);
293 } 294 }
294 } 295 }
295 296
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 469
469 const cc::BeginFrameArgs& BrowserCompositorMac::LastUsedBeginFrameArgs() const { 470 const cc::BeginFrameArgs& BrowserCompositorMac::LastUsedBeginFrameArgs() const {
470 return last_begin_frame_args_; 471 return last_begin_frame_args_;
471 } 472 }
472 473
473 void BrowserCompositorMac::OnBeginFrameSourcePausedChanged(bool paused) { 474 void BrowserCompositorMac::OnBeginFrameSourcePausedChanged(bool paused) {
474 // Only used on Android WebView. 475 // Only used on Android WebView.
475 } 476 }
476 477
477 } // namespace content 478 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698