| 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 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1743 m_quadsAppended = true; | 1743 m_quadsAppended = true; |
| 1744 | 1744 |
| 1745 gfx::Rect opaqueRect; | 1745 gfx::Rect opaqueRect; |
| 1746 if (contentsOpaque()) | 1746 if (contentsOpaque()) |
| 1747 opaqueRect = m_quadRect; | 1747 opaqueRect = m_quadRect; |
| 1748 else | 1748 else |
| 1749 opaqueRect = m_opaqueContentRect; | 1749 opaqueRect = m_opaqueContentRect; |
| 1750 | 1750 |
| 1751 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSha
redQuadState()); | 1751 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSha
redQuadState()); |
| 1752 scoped_ptr<TileDrawQuad> testBlendingDrawQuad = TileDrawQuad::Create(); | 1752 scoped_ptr<TileDrawQuad> testBlendingDrawQuad = TileDrawQuad::Create(); |
| 1753 testBlendingDrawQuad->SetNew(sharedQuadState, m_quadRect, opaqueRect, m_
resourceId, gfx::RectF(0, 0, 1, 1), gfx::Size(1, 1), false, false, false, false,
false); | 1753 testBlendingDrawQuad->SetNew(sharedQuadState, m_quadRect, opaqueRect, m_
resourceId, gfx::RectF(0, 0, 1, 1), gfx::Size(1, 1), false); |
| 1754 testBlendingDrawQuad->visible_rect = m_quadVisibleRect; | 1754 testBlendingDrawQuad->visible_rect = m_quadVisibleRect; |
| 1755 EXPECT_EQ(m_blend, testBlendingDrawQuad->ShouldDrawWithBlending()); | 1755 EXPECT_EQ(m_blend, testBlendingDrawQuad->ShouldDrawWithBlending()); |
| 1756 EXPECT_EQ(m_hasRenderSurface, !!renderSurface()); | 1756 EXPECT_EQ(m_hasRenderSurface, !!renderSurface()); |
| 1757 quadSink.append(testBlendingDrawQuad.PassAs<DrawQuad>(), appendQuadsData
); | 1757 quadSink.append(testBlendingDrawQuad.PassAs<DrawQuad>(), appendQuadsData
); |
| 1758 } | 1758 } |
| 1759 | 1759 |
| 1760 void setExpectation(bool blend, bool hasRenderSurface) | 1760 void setExpectation(bool blend, bool hasRenderSurface) |
| 1761 { | 1761 { |
| 1762 m_blend = blend; | 1762 m_blend = blend; |
| 1763 m_hasRenderSurface = hasRenderSurface; | 1763 m_hasRenderSurface = hasRenderSurface; |
| (...skipping 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3745 gfx::Size m_viewportSize; | 3745 gfx::Size m_viewportSize; |
| 3746 base::hash_set<RenderPass::Id> m_textures; | 3746 base::hash_set<RenderPass::Id> m_textures; |
| 3747 }; | 3747 }; |
| 3748 | 3748 |
| 3749 static void configureRenderPassTestData(const char* testScript, RenderPassRemova
lTestData& testData, TestRenderer* renderer) | 3749 static void configureRenderPassTestData(const char* testScript, RenderPassRemova
lTestData& testData, TestRenderer* renderer) |
| 3750 { | 3750 { |
| 3751 renderer->clearCachedTextures(); | 3751 renderer->clearCachedTextures(); |
| 3752 | 3752 |
| 3753 // One shared state for all quads - we don't need the correct details | 3753 // One shared state for all quads - we don't need the correct details |
| 3754 testData.sharedQuadState = SharedQuadState::Create(); | 3754 testData.sharedQuadState = SharedQuadState::Create(); |
| 3755 testData.sharedQuadState->SetAll(gfx::Transform(), gfx::Rect(), gfx::Rect(),
false, 1.0); | 3755 testData.sharedQuadState->SetAll(gfx::Transform(), gfx::Size(), gfx::Rect(),
gfx::Rect(), false, 1.0); |
| 3756 | 3756 |
| 3757 const char* currentChar = testScript; | 3757 const char* currentChar = testScript; |
| 3758 | 3758 |
| 3759 // Pre-create root pass | 3759 // Pre-create root pass |
| 3760 RenderPass::Id rootRenderPassId = RenderPass::Id(testScript[0], testScript[1
]); | 3760 RenderPass::Id rootRenderPassId = RenderPass::Id(testScript[0], testScript[1
]); |
| 3761 scoped_ptr<TestRenderPass> pass = TestRenderPass::Create(); | 3761 scoped_ptr<TestRenderPass> pass = TestRenderPass::Create(); |
| 3762 pass->SetNew(rootRenderPassId, gfx::Rect(), gfx::Rect(), gfx::Transform()); | 3762 pass->SetNew(rootRenderPassId, gfx::Rect(), gfx::Rect(), gfx::Transform()); |
| 3763 testData.renderPassCache.add(rootRenderPassId, pass.Pass()); | 3763 testData.renderPassCache.add(rootRenderPassId, pass.Pass()); |
| 3764 while (*currentChar) { | 3764 while (*currentChar) { |
| 3765 int layerId = *currentChar; | 3765 int layerId = *currentChar; |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4341 EXPECT_EQ(gfx::Rect(0, 0, 100, 100).ToString(), renderPassQuad->rect.ToS
tring()); | 4341 EXPECT_EQ(gfx::Rect(0, 0, 100, 100).ToString(), renderPassQuad->rect.ToS
tring()); |
| 4342 EXPECT_EQ(gfx::RectF(0.f, 0.f, 1.f, 1.f).ToString(), renderPassQuad->mas
k_uv_rect.ToString()); | 4342 EXPECT_EQ(gfx::RectF(0.f, 0.f, 1.f, 1.f).ToString(), renderPassQuad->mas
k_uv_rect.ToString()); |
| 4343 | 4343 |
| 4344 m_hostImpl->drawLayers(frame); | 4344 m_hostImpl->drawLayers(frame); |
| 4345 m_hostImpl->didDrawAllLayers(frame); | 4345 m_hostImpl->didDrawAllLayers(frame); |
| 4346 } | 4346 } |
| 4347 } | 4347 } |
| 4348 | 4348 |
| 4349 } // namespace | 4349 } // namespace |
| 4350 } // namespace cc | 4350 } // namespace cc |
| OLD | NEW |