| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/layers/texture_layer_impl.h" | 5 #include "cc/layers/texture_layer_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "cc/output/context_provider.h" | 9 #include "cc/output/context_provider.h" |
| 10 #include "cc/output/output_surface.h" | 10 #include "cc/output/output_surface.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 LayerTestCommon::LayerImplTest impl; | 111 LayerTestCommon::LayerImplTest impl; |
| 112 | 112 |
| 113 gpu::Mailbox mailbox; | 113 gpu::Mailbox mailbox; |
| 114 impl.output_surface()->context_provider()->ContextGL()->GenMailboxCHROMIUM( | 114 impl.output_surface()->context_provider()->ContextGL()->GenMailboxCHROMIUM( |
| 115 mailbox.name); | 115 mailbox.name); |
| 116 TextureMailbox texture_mailbox( | 116 TextureMailbox texture_mailbox( |
| 117 mailbox, | 117 mailbox, |
| 118 gpu::SyncToken(gpu::CommandBufferNamespace::GPU_IO, 0x123, | 118 gpu::SyncToken(gpu::CommandBufferNamespace::GPU_IO, 0x123, |
| 119 gpu::CommandBufferId::FromUnsafeValue(0x234), 0x456), | 119 gpu::CommandBufferId::FromUnsafeValue(0x234), 0x456), |
| 120 GL_TEXTURE_2D, layer_size, gfx::GpuMemoryBufferId(), false, true); | 120 GL_TEXTURE_2D, layer_size, false, true); |
| 121 | 121 |
| 122 TextureLayerImpl* texture_layer_impl = | 122 TextureLayerImpl* texture_layer_impl = |
| 123 impl.AddChildToRoot<TextureLayerImpl>(); | 123 impl.AddChildToRoot<TextureLayerImpl>(); |
| 124 texture_layer_impl->SetBounds(layer_size); | 124 texture_layer_impl->SetBounds(layer_size); |
| 125 texture_layer_impl->SetDrawsContent(true); | 125 texture_layer_impl->SetDrawsContent(true); |
| 126 texture_layer_impl->SetTextureMailbox( | 126 texture_layer_impl->SetTextureMailbox( |
| 127 texture_mailbox, | 127 texture_mailbox, |
| 128 SingleReleaseCallbackImpl::Create(base::Bind(&IgnoreCallback))); | 128 SingleReleaseCallbackImpl::Create(base::Bind(&IgnoreCallback))); |
| 129 | 129 |
| 130 impl.CalcDrawProps(viewport_size); | 130 impl.CalcDrawProps(viewport_size); |
| 131 | 131 |
| 132 { | 132 { |
| 133 gfx::Rect occluded; | 133 gfx::Rect occluded; |
| 134 impl.AppendQuadsWithOcclusion(texture_layer_impl, occluded); | 134 impl.AppendQuadsWithOcclusion(texture_layer_impl, occluded); |
| 135 | 135 |
| 136 EXPECT_EQ(1u, impl.quad_list().size()); | 136 EXPECT_EQ(1u, impl.quad_list().size()); |
| 137 ASSERT_EQ(DrawQuad::Material::TEXTURE_CONTENT, | 137 ASSERT_EQ(DrawQuad::Material::TEXTURE_CONTENT, |
| 138 impl.quad_list().front()->material); | 138 impl.quad_list().front()->material); |
| 139 const TextureDrawQuad* quad = | 139 const TextureDrawQuad* quad = |
| 140 TextureDrawQuad::MaterialCast(impl.quad_list().front()); | 140 TextureDrawQuad::MaterialCast(impl.quad_list().front()); |
| 141 EXPECT_TRUE(quad->secure_output_only); | 141 EXPECT_TRUE(quad->secure_output_only); |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| 145 } // namespace | 145 } // namespace |
| 146 } // namespace cc | 146 } // namespace cc |
| OLD | NEW |