| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/layer_tree_host_impl.h" | 5 #include "cc/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 2675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2686 : ScrollbarLayerImpl(id) | 2686 : ScrollbarLayerImpl(id) |
| 2687 { | 2687 { |
| 2688 } | 2688 } |
| 2689 }; | 2689 }; |
| 2690 | 2690 |
| 2691 static inline scoped_ptr<RenderPass> createRenderPassWithResource(ResourceProvid
er* provider) | 2691 static inline scoped_ptr<RenderPass> createRenderPassWithResource(ResourceProvid
er* provider) |
| 2692 { | 2692 { |
| 2693 ResourceProvider::ResourceId resourceId = provider->createResource(0, gfx::S
ize(1, 1), GL_RGBA, ResourceProvider::TextureUsageAny); | 2693 ResourceProvider::ResourceId resourceId = provider->createResource(0, gfx::S
ize(1, 1), GL_RGBA, ResourceProvider::TextureUsageAny); |
| 2694 | 2694 |
| 2695 scoped_ptr<TestRenderPass> pass = TestRenderPass::create(RenderPass::Id(1, 1
), gfx::Rect(0, 0, 1, 1), WebTransformationMatrix()); | 2695 scoped_ptr<TestRenderPass> pass = TestRenderPass::create(RenderPass::Id(1, 1
), gfx::Rect(0, 0, 1, 1), WebTransformationMatrix()); |
| 2696 scoped_ptr<SharedQuadState> sharedState = SharedQuadState::create(WebTransfo
rmationMatrix(), gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1), 1, false); | 2696 scoped_ptr<SharedQuadState> sharedState = SharedQuadState::create(WebTransfo
rmationMatrix(), gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1), 1); |
| 2697 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::create(sharedState.get()
, gfx::Rect(0, 0, 1, 1), resourceId, false, gfx::RectF(0, 0, 1, 1), false); | 2697 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::create(sharedState.get()
, gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1), resourceId, false, gfx::RectF(0,
0, 1, 1), false); |
| 2698 | 2698 |
| 2699 pass->appendSharedQuadState(sharedState.Pass()); | 2699 pass->appendSharedQuadState(sharedState.Pass()); |
| 2700 pass->appendQuad(quad.PassAs<DrawQuad>()); | 2700 pass->appendQuad(quad.PassAs<DrawQuad>()); |
| 2701 | 2701 |
| 2702 return pass.PassAs<RenderPass>(); | 2702 return pass.PassAs<RenderPass>(); |
| 2703 } | 2703 } |
| 2704 | 2704 |
| 2705 TEST_P(LayerTreeHostImplTest, dontUseOldResourcesAfterLostContext) | 2705 TEST_P(LayerTreeHostImplTest, dontUseOldResourcesAfterLostContext) |
| 2706 { | 2706 { |
| 2707 int layerId = 1; | 2707 int layerId = 1; |
| (...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4159 LayerTreeSettings m_settings; | 4159 LayerTreeSettings m_settings; |
| 4160 gfx::Size m_viewportSize; | 4160 gfx::Size m_viewportSize; |
| 4161 base::hash_set<RenderPass::Id> m_textures; | 4161 base::hash_set<RenderPass::Id> m_textures; |
| 4162 }; | 4162 }; |
| 4163 | 4163 |
| 4164 static void configureRenderPassTestData(const char* testScript, RenderPassRemova
lTestData& testData, TestRenderer* renderer) | 4164 static void configureRenderPassTestData(const char* testScript, RenderPassRemova
lTestData& testData, TestRenderer* renderer) |
| 4165 { | 4165 { |
| 4166 renderer->clearCachedTextures(); | 4166 renderer->clearCachedTextures(); |
| 4167 | 4167 |
| 4168 // One shared state for all quads - we don't need the correct details | 4168 // One shared state for all quads - we don't need the correct details |
| 4169 testData.sharedQuadState = SharedQuadState::create(WebTransformationMatrix()
, gfx::Rect(), gfx::Rect(), 1.0, true); | 4169 testData.sharedQuadState = SharedQuadState::create(WebTransformationMatrix()
, gfx::Rect(), gfx::Rect(), 1.0); |
| 4170 | 4170 |
| 4171 const char* currentChar = testScript; | 4171 const char* currentChar = testScript; |
| 4172 | 4172 |
| 4173 // Pre-create root pass | 4173 // Pre-create root pass |
| 4174 RenderPass::Id rootRenderPassId = RenderPass::Id(testScript[0], testScript[1
]); | 4174 RenderPass::Id rootRenderPassId = RenderPass::Id(testScript[0], testScript[1
]); |
| 4175 testData.renderPassCache.add(rootRenderPassId, TestRenderPass::create(rootRe
nderPassId, gfx::Rect(), WebTransformationMatrix())); | 4175 testData.renderPassCache.add(rootRenderPassId, TestRenderPass::create(rootRe
nderPassId, gfx::Rect(), WebTransformationMatrix())); |
| 4176 while (*currentChar) { | 4176 while (*currentChar) { |
| 4177 int layerId = *currentChar; | 4177 int layerId = *currentChar; |
| 4178 currentChar++; | 4178 currentChar++; |
| 4179 ASSERT_TRUE(currentChar); | 4179 ASSERT_TRUE(currentChar); |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4448 testCaseIndex++; | 4448 testCaseIndex++; |
| 4449 } | 4449 } |
| 4450 } | 4450 } |
| 4451 | 4451 |
| 4452 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, | 4452 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, |
| 4453 LayerTreeHostImplTest, | 4453 LayerTreeHostImplTest, |
| 4454 ::testing::Values(false, true)); | 4454 ::testing::Values(false, true)); |
| 4455 | 4455 |
| 4456 } // namespace | 4456 } // namespace |
| 4457 } // namespace cc | 4457 } // namespace cc |
| OLD | NEW |