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