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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 // Make a root frame that embeds the frame coming from the layer compositor | 272 // Make a root frame that embeds the frame coming from the layer compositor |
273 // and positions it based on the provided viewport. | 273 // and positions it based on the provided viewport. |
274 // TODO(danakj): We could apply the transform here instead of passing it to | 274 // TODO(danakj): We could apply the transform here instead of passing it to |
275 // the CompositorFrameSink client too? (We'd have to do the same for | 275 // the CompositorFrameSink client too? (We'd have to do the same for |
276 // hardware frames in SurfacesInstance?) | 276 // hardware frames in SurfacesInstance?) |
277 cc::CompositorFrame embed_frame; | 277 cc::CompositorFrame embed_frame; |
278 embed_frame.render_pass_list.push_back(cc::RenderPass::Create()); | 278 embed_frame.render_pass_list.push_back(cc::RenderPass::Create()); |
279 | 279 |
280 // The embedding RenderPass covers the entire Display's area. | 280 // The embedding RenderPass covers the entire Display's area. |
281 const auto& embed_render_pass = embed_frame.render_pass_list.back(); | 281 const auto& embed_render_pass = embed_frame.render_pass_list.back(); |
282 embed_render_pass->SetAll(1, gfx::Rect(display_size), | 282 embed_render_pass->SetNew(1, gfx::Rect(display_size), |
283 gfx::Rect(display_size), gfx::Transform(), false); | 283 gfx::Rect(display_size), gfx::Transform()); |
| 284 embed_render_pass->has_transparent_background = false; |
284 | 285 |
285 // The RenderPass has a single SurfaceDrawQuad (and SharedQuadState for it). | 286 // The RenderPass has a single SurfaceDrawQuad (and SharedQuadState for it). |
286 auto* shared_quad_state = | 287 auto* shared_quad_state = |
287 embed_render_pass->CreateAndAppendSharedQuadState(); | 288 embed_render_pass->CreateAndAppendSharedQuadState(); |
288 auto* surface_quad = | 289 auto* surface_quad = |
289 embed_render_pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); | 290 embed_render_pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); |
290 shared_quad_state->SetAll( | 291 shared_quad_state->SetAll( |
291 child_transform, child_size, gfx::Rect(child_size), | 292 child_transform, child_size, gfx::Rect(child_size), |
292 gfx::Rect() /* clip_rect */, false /* is_clipped */, 1.f /* opacity */, | 293 gfx::Rect() /* clip_rect */, false /* is_clipped */, 1.f /* opacity */, |
293 SkBlendMode::kSrcOver, 0 /* sorting_context_id */); | 294 SkBlendMode::kSrcOver, 0 /* sorting_context_id */); |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 client_->ReclaimResources(resources); | 470 client_->ReclaimResources(resources); |
470 } | 471 } |
471 | 472 |
472 void SynchronousCompositorFrameSink::SetBeginFrameSource( | 473 void SynchronousCompositorFrameSink::SetBeginFrameSource( |
473 cc::BeginFrameSource* begin_frame_source) { | 474 cc::BeginFrameSource* begin_frame_source) { |
474 // Software output is synchronous and doesn't use a BeginFrameSource. | 475 // Software output is synchronous and doesn't use a BeginFrameSource. |
475 NOTREACHED(); | 476 NOTREACHED(); |
476 } | 477 } |
477 | 478 |
478 } // namespace content | 479 } // namespace content |
OLD | NEW |