| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 gfx::Transform child_transform; | 266 gfx::Transform child_transform; |
| 267 child_transform.Translate( | 267 child_transform.Translate( |
| 268 gfx::Vector2dF(sw_viewport_for_current_draw_.OffsetFromOrigin())); | 268 gfx::Vector2dF(sw_viewport_for_current_draw_.OffsetFromOrigin())); |
| 269 | 269 |
| 270 // Make a root frame that embeds the frame coming from the layer compositor | 270 // Make a root frame that embeds the frame coming from the layer compositor |
| 271 // and positions it based on the provided viewport. | 271 // and positions it based on the provided viewport. |
| 272 // TODO(danakj): We could apply the transform here instead of passing it to | 272 // TODO(danakj): We could apply the transform here instead of passing it to |
| 273 // the CompositorFrameSink client too? (We'd have to do the same for | 273 // the CompositorFrameSink client too? (We'd have to do the same for |
| 274 // hardware frames in SurfacesInstance?) | 274 // hardware frames in SurfacesInstance?) |
| 275 cc::CompositorFrame embed_frame; | 275 cc::CompositorFrame embed_frame; |
| 276 embed_frame.metadata.begin_frame_ack = frame.metadata.begin_frame_ack; |
| 276 embed_frame.render_pass_list.push_back(cc::RenderPass::Create()); | 277 embed_frame.render_pass_list.push_back(cc::RenderPass::Create()); |
| 277 | 278 |
| 278 // The embedding RenderPass covers the entire Display's area. | 279 // The embedding RenderPass covers the entire Display's area. |
| 279 const auto& embed_render_pass = embed_frame.render_pass_list.back(); | 280 const auto& embed_render_pass = embed_frame.render_pass_list.back(); |
| 280 embed_render_pass->SetNew(1, gfx::Rect(display_size), | 281 embed_render_pass->SetNew(1, gfx::Rect(display_size), |
| 281 gfx::Rect(display_size), gfx::Transform()); | 282 gfx::Rect(display_size), gfx::Transform()); |
| 282 embed_render_pass->has_transparent_background = false; | 283 embed_render_pass->has_transparent_background = false; |
| 283 | 284 |
| 284 // The RenderPass has a single SurfaceDrawQuad (and SharedQuadState for it). | 285 // The RenderPass has a single SurfaceDrawQuad (and SharedQuadState for it). |
| 285 auto* shared_quad_state = | 286 auto* shared_quad_state = |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 const cc::ReturnedResourceArray& resources) { | 471 const cc::ReturnedResourceArray& resources) { |
| 471 DCHECK(resources.empty()); | 472 DCHECK(resources.empty()); |
| 472 client_->ReclaimResources(resources); | 473 client_->ReclaimResources(resources); |
| 473 } | 474 } |
| 474 | 475 |
| 475 void SynchronousCompositorFrameSink::WillDrawSurface( | 476 void SynchronousCompositorFrameSink::WillDrawSurface( |
| 476 const cc::LocalSurfaceId& local_surface_id, | 477 const cc::LocalSurfaceId& local_surface_id, |
| 477 const gfx::Rect& damage_rect) {} | 478 const gfx::Rect& damage_rect) {} |
| 478 | 479 |
| 479 } // namespace content | 480 } // namespace content |
| OLD | NEW |