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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 ui_frame.delegated_frame_data = base::MakeUnique<cc::DelegatedFrameData>(); | 75 ui_frame.delegated_frame_data = base::MakeUnique<cc::DelegatedFrameData>(); |
76 const cc::RenderPassId render_pass_id(1, 1); | 76 const cc::RenderPassId render_pass_id(1, 1); |
77 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create(); | 77 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create(); |
78 const bool has_transparent_background = true; | 78 const bool has_transparent_background = true; |
79 pass->SetAll(render_pass_id, bounds, bounds, gfx::Transform(), | 79 pass->SetAll(render_pass_id, bounds, bounds, gfx::Transform(), |
80 has_transparent_background); | 80 has_transparent_background); |
81 // The SharedQuadState is owned by the SharedQuadStateList | 81 // The SharedQuadState is owned by the SharedQuadStateList |
82 // shared_quad_state_list. | 82 // shared_quad_state_list. |
83 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); | 83 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); |
84 sqs->SetAll(gfx::Transform(), bounds.size(), bounds, bounds, | 84 sqs->SetAll(gfx::Transform(), bounds.size(), bounds, bounds, |
85 false /* is_clipped */, 1.f /* opacity */, SkXfermode::kSrc_Mode, | 85 false /* is_clipped */, 1.f /* opacity */, SkBlendMode::kSrc, |
86 0 /* sorting_context_id */); | 86 0 /* sorting_context_id */); |
87 | 87 |
88 cc::TransferableResource resource; | 88 cc::TransferableResource resource; |
89 resource.id = AllocateResourceId(); | 89 resource.id = AllocateResourceId(); |
90 resource.format = cc::ResourceFormat::RGBA_8888; | 90 resource.format = cc::ResourceFormat::RGBA_8888; |
91 resource.filter = GL_LINEAR; | 91 resource.filter = GL_LINEAR; |
92 resource.size = frame.size; | 92 resource.size = frame.size; |
93 | 93 |
94 const gpu::Mailbox& mailbox = GetMailboxFromResourceId(resource.id); | 94 const gpu::Mailbox& mailbox = GetMailboxFromResourceId(resource.id); |
95 DCHECK(!mailbox.IsZero()); | 95 DCHECK(!mailbox.IsZero()); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 const gpu::Mailbox& MusBrowserCompositorOutputSurface::GetMailboxFromResourceId( | 202 const gpu::Mailbox& MusBrowserCompositorOutputSurface::GetMailboxFromResourceId( |
203 uint32_t id) { | 203 uint32_t id) { |
204 DCHECK_LT(id, mailboxes_.size()); | 204 DCHECK_LT(id, mailboxes_.size()); |
205 DCHECK(std::find(free_resource_ids_.begin(), free_resource_ids_.end(), id) == | 205 DCHECK(std::find(free_resource_ids_.begin(), free_resource_ids_.end(), id) == |
206 free_resource_ids_.end()); | 206 free_resource_ids_.end()); |
207 return mailboxes_[id]; | 207 return mailboxes_[id]; |
208 } | 208 } |
209 | 209 |
210 } // namespace content | 210 } // namespace content |
OLD | NEW |