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

Side by Side Diff: content/browser/frame_host/render_widget_host_view_child_frame.cc

Issue 2449853004: Getting rid of DelegatedFrameData (Closed)
Patch Set: nit Created 4 years, 1 month 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/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 <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 uint32_t compositor_frame_sink_id, 373 uint32_t compositor_frame_sink_id,
374 cc::CompositorFrame frame) { 374 cc::CompositorFrame frame) {
375 TRACE_EVENT0("content", 375 TRACE_EVENT0("content",
376 "RenderWidgetHostViewChildFrame::OnSwapCompositorFrame"); 376 "RenderWidgetHostViewChildFrame::OnSwapCompositorFrame");
377 377
378 last_scroll_offset_ = frame.metadata.root_scroll_offset; 378 last_scroll_offset_ = frame.metadata.root_scroll_offset;
379 379
380 if (!frame_connector_) 380 if (!frame_connector_)
381 return; 381 return;
382 382
383 cc::RenderPass* root_pass = 383 cc::RenderPass* root_pass = frame.render_pass_list.back().get();
384 frame.delegated_frame_data->render_pass_list.back().get();
385 384
386 gfx::Size frame_size = root_pass->output_rect.size(); 385 gfx::Size frame_size = root_pass->output_rect.size();
387 float scale_factor = frame.metadata.device_scale_factor; 386 float scale_factor = frame.metadata.device_scale_factor;
388 387
389 // Check whether we need to recreate the cc::Surface, which means the child 388 // Check whether we need to recreate the cc::Surface, which means the child
390 // frame renderer has changed its frame sink, or size, or scale factor. 389 // frame renderer has changed its frame sink, or size, or scale factor.
391 if (compositor_frame_sink_id != last_compositor_frame_sink_id_ || 390 if (compositor_frame_sink_id != last_compositor_frame_sink_id_ ||
392 frame_size != current_surface_size_ || 391 frame_size != current_surface_size_ ||
393 scale_factor != current_surface_scale_factor_) { 392 scale_factor != current_surface_scale_factor_) {
394 ClearCompositorSurfaceIfNecessary(); 393 ClearCompositorSurfaceIfNecessary();
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 733
735 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { 734 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const {
736 return true; 735 return true;
737 } 736 }
738 737
739 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { 738 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const {
740 return cc::SurfaceId(frame_sink_id_, local_frame_id_); 739 return cc::SurfaceId(frame_sink_id_, local_frame_id_);
741 }; 740 };
742 741
743 } // namespace content 742 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698