| 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/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 "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
| 10 #include "cc/output/compositor_frame_ack.h" | 10 #include "cc/output/compositor_frame_ack.h" |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 float frame_device_scale_factor, | 308 float frame_device_scale_factor, |
| 309 const std::vector<ui::LatencyInfo>& latency_info) { | 309 const std::vector<ui::LatencyInfo>& latency_info) { |
| 310 DCHECK(!frame_data->render_pass_list.empty()); | 310 DCHECK(!frame_data->render_pass_list.empty()); |
| 311 | 311 |
| 312 cc::RenderPass* root_pass = frame_data->render_pass_list.back(); | 312 cc::RenderPass* root_pass = frame_data->render_pass_list.back(); |
| 313 | 313 |
| 314 gfx::Size frame_size = root_pass->output_rect.size(); | 314 gfx::Size frame_size = root_pass->output_rect.size(); |
| 315 gfx::Size frame_size_in_dip = | 315 gfx::Size frame_size_in_dip = |
| 316 gfx::ConvertSizeToDIP(frame_device_scale_factor, frame_size); | 316 gfx::ConvertSizeToDIP(frame_device_scale_factor, frame_size); |
| 317 | 317 |
| 318 gfx::Rect damage_rect = gfx::ToEnclosingRect(root_pass->damage_rect); | 318 gfx::Rect damage_rect = root_pass->GetFullDamageRect(); |
| 319 damage_rect.Intersect(gfx::Rect(frame_size)); | 319 damage_rect.Intersect(gfx::Rect(frame_size)); |
| 320 gfx::Rect damage_rect_in_dip = | 320 gfx::Rect damage_rect_in_dip = |
| 321 gfx::ConvertRectToDIP(frame_device_scale_factor, damage_rect); | 321 gfx::ConvertRectToDIP(frame_device_scale_factor, damage_rect); |
| 322 | 322 |
| 323 if (ShouldSkipFrame(frame_size_in_dip)) { | 323 if (ShouldSkipFrame(frame_size_in_dip)) { |
| 324 cc::CompositorFrameAck ack; | 324 cc::CompositorFrameAck ack; |
| 325 cc::TransferableResource::ReturnResources(frame_data->resource_list, | 325 cc::TransferableResource::ReturnResources(frame_data->resource_list, |
| 326 &ack.resources); | 326 &ack.resources); |
| 327 | 327 |
| 328 skipped_latency_info_list_.insert(skipped_latency_info_list_.end(), | 328 skipped_latency_info_list_.insert(skipped_latency_info_list_.end(), |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 cc::SurfaceManager* manager = factory->GetSurfaceManager(); | 1027 cc::SurfaceManager* manager = factory->GetSurfaceManager(); |
| 1028 new_layer->SetShowSurface( | 1028 new_layer->SetShowSurface( |
| 1029 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), | 1029 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), |
| 1030 base::Bind(&RequireCallback, base::Unretained(manager)), | 1030 base::Bind(&RequireCallback, base::Unretained(manager)), |
| 1031 current_surface_size_, current_scale_factor_, | 1031 current_surface_size_, current_scale_factor_, |
| 1032 current_frame_size_in_dip_); | 1032 current_frame_size_in_dip_); |
| 1033 } | 1033 } |
| 1034 } | 1034 } |
| 1035 | 1035 |
| 1036 } // namespace content | 1036 } // namespace content |
| OLD | NEW |