OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/mus_browser_compositor_output_surface.h" | 5 #include "content/browser/compositor/mus_browser_compositor_output_surface.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
10 #include "cc/output/output_surface_frame.h" | 10 #include "cc/output/output_surface_frame.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 void MusBrowserCompositorOutputSurface::SwapBuffers( | 71 void MusBrowserCompositorOutputSurface::SwapBuffers( |
72 cc::OutputSurfaceFrame frame) { | 72 cc::OutputSurfaceFrame frame) { |
73 const gfx::Rect bounds = ui_window_ ? gfx::Rect(ui_window_->bounds().size()) | 73 const gfx::Rect bounds = ui_window_ ? gfx::Rect(ui_window_->bounds().size()) |
74 : gfx::Rect(window_->bounds().size()); | 74 : gfx::Rect(window_->bounds().size()); |
75 cc::CompositorFrame ui_frame; | 75 cc::CompositorFrame ui_frame; |
76 ui_frame.metadata.latency_info = std::move(frame.latency_info); | 76 ui_frame.metadata.latency_info = std::move(frame.latency_info); |
77 // Reset latency_info to known empty state after moving contents. | 77 // Reset latency_info to known empty state after moving contents. |
78 frame.latency_info.clear(); | 78 frame.latency_info.clear(); |
79 const int render_pass_id = 1; | 79 const int render_pass_id = 1; |
80 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create(); | 80 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create(); |
81 const bool has_transparent_background = true; | 81 pass->SetNew(render_pass_id, bounds, bounds, gfx::Transform()); |
82 pass->SetAll(render_pass_id, bounds, bounds, gfx::Transform(), | |
83 has_transparent_background); | |
84 // The SharedQuadState is owned by the SharedQuadStateList | 82 // The SharedQuadState is owned by the SharedQuadStateList |
85 // shared_quad_state_list. | 83 // shared_quad_state_list. |
86 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); | 84 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); |
87 sqs->SetAll(gfx::Transform(), bounds.size(), bounds, bounds, | 85 sqs->SetAll(gfx::Transform(), bounds.size(), bounds, bounds, |
88 false /* is_clipped */, 1.f /* opacity */, SkBlendMode::kSrc, | 86 false /* is_clipped */, 1.f /* opacity */, SkBlendMode::kSrc, |
89 0 /* sorting_context_id */); | 87 0 /* sorting_context_id */); |
90 | 88 |
91 cc::TransferableResource resource; | 89 cc::TransferableResource resource; |
92 resource.id = AllocateResourceId(); | 90 resource.id = AllocateResourceId(); |
93 resource.format = cc::ResourceFormat::RGBA_8888; | 91 resource.format = cc::ResourceFormat::RGBA_8888; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 204 |
207 const gpu::Mailbox& MusBrowserCompositorOutputSurface::GetMailboxFromResourceId( | 205 const gpu::Mailbox& MusBrowserCompositorOutputSurface::GetMailboxFromResourceId( |
208 uint32_t id) { | 206 uint32_t id) { |
209 DCHECK_LT(id, mailboxes_.size()); | 207 DCHECK_LT(id, mailboxes_.size()); |
210 DCHECK(std::find(free_resource_ids_.begin(), free_resource_ids_.end(), id) == | 208 DCHECK(std::find(free_resource_ids_.begin(), free_resource_ids_.end(), id) == |
211 free_resource_ids_.end()); | 209 free_resource_ids_.end()); |
212 return mailboxes_[id]; | 210 return mailboxes_[id]; |
213 } | 211 } |
214 | 212 |
215 } // namespace content | 213 } // namespace content |
OLD | NEW |