| 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" |
| 11 #include "cc/quads/draw_quad.h" | 11 #include "cc/quads/draw_quad.h" |
| 12 #include "cc/quads/texture_draw_quad.h" |
| 12 #include "cc/test/layer_test_common.h" | 13 #include "cc/test/layer_test_common.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 15 |
| 15 namespace cc { | 16 namespace cc { |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 void IgnoreCallback(const gpu::SyncToken& sync_token, | 19 void IgnoreCallback(const gpu::SyncToken& sync_token, |
| 19 bool lost, | 20 bool lost, |
| 20 BlockingTaskRunner* main_thread_task_runner) {} | 21 BlockingTaskRunner* main_thread_task_runner) {} |
| 21 | 22 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 texture_mailbox, | 127 texture_mailbox, |
| 127 SingleReleaseCallbackImpl::Create(base::Bind(&IgnoreCallback))); | 128 SingleReleaseCallbackImpl::Create(base::Bind(&IgnoreCallback))); |
| 128 | 129 |
| 129 impl.CalcDrawProps(viewport_size); | 130 impl.CalcDrawProps(viewport_size); |
| 130 | 131 |
| 131 { | 132 { |
| 132 gfx::Rect occluded; | 133 gfx::Rect occluded; |
| 133 impl.AppendQuadsWithOcclusion(texture_layer_impl, occluded); | 134 impl.AppendQuadsWithOcclusion(texture_layer_impl, occluded); |
| 134 | 135 |
| 135 EXPECT_EQ(1u, impl.quad_list().size()); | 136 EXPECT_EQ(1u, impl.quad_list().size()); |
| 136 EXPECT_EQ(DrawQuad::Material::SOLID_COLOR, | 137 ASSERT_EQ(DrawQuad::Material::TEXTURE_CONTENT, |
| 137 impl.quad_list().front()->material); | 138 impl.quad_list().front()->material); |
| 138 } | 139 const TextureDrawQuad* quad = |
| 139 | 140 TextureDrawQuad::MaterialCast(impl.quad_list().front()); |
| 140 { | 141 EXPECT_TRUE(quad->secure_output_only); |
| 141 impl.SetOutputIsSecure(true); | |
| 142 gfx::Rect occluded; | |
| 143 impl.AppendQuadsWithOcclusion(texture_layer_impl, occluded); | |
| 144 | |
| 145 EXPECT_EQ(1u, impl.quad_list().size()); | |
| 146 EXPECT_NE(DrawQuad::Material::SOLID_COLOR, | |
| 147 impl.quad_list().front()->material); | |
| 148 } | |
| 149 | |
| 150 { | |
| 151 impl.SetOutputIsSecure(false); | |
| 152 impl.RequestCopyOfOutput(); | |
| 153 gfx::Rect occluded; | |
| 154 impl.AppendQuadsWithOcclusion(texture_layer_impl, occluded); | |
| 155 | |
| 156 EXPECT_EQ(1u, impl.quad_list().size()); | |
| 157 EXPECT_EQ(DrawQuad::Material::SOLID_COLOR, | |
| 158 impl.quad_list().front()->material); | |
| 159 } | 142 } |
| 160 } | 143 } |
| 161 | 144 |
| 162 } // namespace | 145 } // namespace |
| 163 } // namespace cc | 146 } // namespace cc |
| OLD | NEW |