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

Side by Side Diff: content/browser/compositor/delegated_frame_host.cc

Issue 1229413003: DelegatedFrameHost should handle satisfied sequences in frame metadata. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment stating that |satifies_sequences| is cleared on call to SwapDelegatedFrame. Created 5 years, 5 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/compositor/delegated_frame_host.h" 5 #include "content/browser/compositor/delegated_frame_host.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/time/default_tick_clock.h" 9 #include "base/time/default_tick_clock.h"
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 subscriber_texture->target(), 292 subscriber_texture->target(),
293 subscriber_texture->sync_point())); 293 subscriber_texture->sync_point()));
294 } 294 }
295 RequestCopyOfOutput(request.Pass()); 295 RequestCopyOfOutput(request.Pass());
296 } 296 }
297 297
298 void DelegatedFrameHost::SwapDelegatedFrame( 298 void DelegatedFrameHost::SwapDelegatedFrame(
299 uint32 output_surface_id, 299 uint32 output_surface_id,
300 scoped_ptr<cc::DelegatedFrameData> frame_data, 300 scoped_ptr<cc::DelegatedFrameData> frame_data,
301 float frame_device_scale_factor, 301 float frame_device_scale_factor,
302 const std::vector<ui::LatencyInfo>& latency_info) { 302 const std::vector<ui::LatencyInfo>& latency_info,
303 std::vector<uint32_t>* satisfies_sequences) {
303 DCHECK(!frame_data->render_pass_list.empty()); 304 DCHECK(!frame_data->render_pass_list.empty());
304 305
305 cc::RenderPass* root_pass = frame_data->render_pass_list.back(); 306 cc::RenderPass* root_pass = frame_data->render_pass_list.back();
306 307
307 gfx::Size frame_size = root_pass->output_rect.size(); 308 gfx::Size frame_size = root_pass->output_rect.size();
308 gfx::Size frame_size_in_dip = 309 gfx::Size frame_size_in_dip =
309 gfx::ConvertSizeToDIP(frame_device_scale_factor, frame_size); 310 gfx::ConvertSizeToDIP(frame_device_scale_factor, frame_size);
310 311
311 gfx::Rect damage_rect = gfx::ToEnclosingRect(root_pass->damage_rect); 312 gfx::Rect damage_rect = gfx::ToEnclosingRect(root_pass->damage_rect);
312 damage_rect.Intersect(gfx::Rect(frame_size)); 313 damage_rect.Intersect(gfx::Rect(frame_size));
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 } 394 }
394 scoped_ptr<cc::CompositorFrame> compositor_frame = 395 scoped_ptr<cc::CompositorFrame> compositor_frame =
395 make_scoped_ptr(new cc::CompositorFrame()); 396 make_scoped_ptr(new cc::CompositorFrame());
396 compositor_frame->delegated_frame_data = frame_data.Pass(); 397 compositor_frame->delegated_frame_data = frame_data.Pass();
397 398
398 compositor_frame->metadata.latency_info.swap(skipped_latency_info_list_); 399 compositor_frame->metadata.latency_info.swap(skipped_latency_info_list_);
399 compositor_frame->metadata.latency_info.insert( 400 compositor_frame->metadata.latency_info.insert(
400 compositor_frame->metadata.latency_info.end(), 401 compositor_frame->metadata.latency_info.end(),
401 latency_info.begin(), 402 latency_info.begin(),
402 latency_info.end()); 403 latency_info.end());
404 compositor_frame->metadata.satisfies_sequences.swap(*satisfies_sequences);
403 405
404 gfx::Size desired_size = client_->DelegatedFrameHostDesiredSizeInDIP(); 406 gfx::Size desired_size = client_->DelegatedFrameHostDesiredSizeInDIP();
405 if (desired_size != frame_size_in_dip && !desired_size.IsEmpty()) 407 if (desired_size != frame_size_in_dip && !desired_size.IsEmpty())
406 immediate_ack = true; 408 immediate_ack = true;
407 409
408 cc::SurfaceFactory::DrawCallback ack_callback; 410 cc::SurfaceFactory::DrawCallback ack_callback;
409 if (compositor_ && !immediate_ack) { 411 if (compositor_ && !immediate_ack) {
410 ack_callback = base::Bind(&DelegatedFrameHost::SurfaceDrawn, 412 ack_callback = base::Bind(&DelegatedFrameHost::SurfaceDrawn,
411 AsWeakPtr(), output_surface_id); 413 AsWeakPtr(), output_surface_id);
412 } 414 }
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 cc::SurfaceManager* manager = factory->GetSurfaceManager(); 1020 cc::SurfaceManager* manager = factory->GetSurfaceManager();
1019 new_layer->SetShowSurface( 1021 new_layer->SetShowSurface(
1020 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), 1022 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)),
1021 base::Bind(&RequireCallback, base::Unretained(manager)), 1023 base::Bind(&RequireCallback, base::Unretained(manager)),
1022 current_surface_size_, current_scale_factor_, 1024 current_surface_size_, current_scale_factor_,
1023 current_frame_size_in_dip_); 1025 current_frame_size_in_dip_);
1024 } 1026 }
1025 } 1027 }
1026 1028
1027 } // namespace content 1029 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/compositor/delegated_frame_host.h ('k') | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698