OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/android/synchronous_compositor_frame_sink.h" | 5 #include "content/renderer/android/synchronous_compositor_frame_sink.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 if (in_software_draw_) { | 239 if (in_software_draw_) { |
240 // The frame we send to the client is actually just the metadata. Preserve | 240 // The frame we send to the client is actually just the metadata. Preserve |
241 // the |frame| for the software path below. | 241 // the |frame| for the software path below. |
242 submit_frame.metadata = frame.metadata.Clone(); | 242 submit_frame.metadata = frame.metadata.Clone(); |
243 | 243 |
244 if (!root_local_surface_id_.is_valid()) { | 244 if (!root_local_surface_id_.is_valid()) { |
245 root_local_surface_id_ = local_surface_id_allocator_->GenerateId(); | 245 root_local_surface_id_ = local_surface_id_allocator_->GenerateId(); |
246 child_local_surface_id_ = local_surface_id_allocator_->GenerateId(); | 246 child_local_surface_id_ = local_surface_id_allocator_->GenerateId(); |
247 } | 247 } |
248 | 248 |
249 display_->SetLocalSurfaceId(root_local_surface_id_, | 249 display_->SetLocalSurfaceId(root_local_surface_id_); |
250 frame.metadata.device_scale_factor); | 250 display_->SetDeviceScaleFactor(frame.metadata.device_scale_factor); |
251 | 251 |
252 // The layer compositor should be giving a frame that covers the | 252 // The layer compositor should be giving a frame that covers the |
253 // |sw_viewport_for_current_draw_| but at 0,0. | 253 // |sw_viewport_for_current_draw_| but at 0,0. |
254 gfx::Size child_size = sw_viewport_for_current_draw_.size(); | 254 gfx::Size child_size = sw_viewport_for_current_draw_.size(); |
255 DCHECK(gfx::Rect(child_size) == frame.render_pass_list.back()->output_rect); | 255 DCHECK(gfx::Rect(child_size) == frame.render_pass_list.back()->output_rect); |
256 | 256 |
257 // Make a size that covers from 0,0 and includes the area coming from the | 257 // Make a size that covers from 0,0 and includes the area coming from the |
258 // layer compositor. | 258 // layer compositor. |
259 gfx::Size display_size(sw_viewport_for_current_draw_.right(), | 259 gfx::Size display_size(sw_viewport_for_current_draw_.right(), |
260 sw_viewport_for_current_draw_.bottom()); | 260 sw_viewport_for_current_draw_.bottom()); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 const cc::ReturnedResourceArray& resources) { | 469 const cc::ReturnedResourceArray& resources) { |
470 DCHECK(resources.empty()); | 470 DCHECK(resources.empty()); |
471 client_->ReclaimResources(resources); | 471 client_->ReclaimResources(resources); |
472 } | 472 } |
473 | 473 |
474 void SynchronousCompositorFrameSink::WillDrawSurface( | 474 void SynchronousCompositorFrameSink::WillDrawSurface( |
475 const cc::LocalSurfaceId& local_surface_id, | 475 const cc::LocalSurfaceId& local_surface_id, |
476 const gfx::Rect& damage_rect) {} | 476 const gfx::Rect& damage_rect) {} |
477 | 477 |
478 } // namespace content | 478 } // namespace content |
OLD | NEW |