| 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 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 private: | 1123 private: |
| 1124 MissingTextureAnimatingLayer(LayerTreeImpl* treeImpl, int id, bool tileMissi
ng, bool skipsDraw, bool animating, ResourceProvider* resourceProvider) | 1124 MissingTextureAnimatingLayer(LayerTreeImpl* treeImpl, int id, bool tileMissi
ng, bool skipsDraw, bool animating, ResourceProvider* resourceProvider) |
| 1125 : DidDrawCheckLayer(treeImpl, id) | 1125 : DidDrawCheckLayer(treeImpl, id) |
| 1126 { | 1126 { |
| 1127 scoped_ptr<LayerTilingData> tilingData = LayerTilingData::create(gfx::Si
ze(10, 10), LayerTilingData::NoBorderTexels); | 1127 scoped_ptr<LayerTilingData> tilingData = LayerTilingData::create(gfx::Si
ze(10, 10), LayerTilingData::NoBorderTexels); |
| 1128 tilingData->setBounds(bounds()); | 1128 tilingData->setBounds(bounds()); |
| 1129 setTilingData(*tilingData.get()); | 1129 setTilingData(*tilingData.get()); |
| 1130 setSkipsDraw(skipsDraw); | 1130 setSkipsDraw(skipsDraw); |
| 1131 if (!tileMissing) { | 1131 if (!tileMissing) { |
| 1132 ResourceProvider::ResourceId resource = resourceProvider->createReso
urce(gfx::Size(), GL_RGBA, ResourceProvider::TextureUsageAny); | 1132 ResourceProvider::ResourceId resource = resourceProvider->createReso
urce(gfx::Size(), GL_RGBA, ResourceProvider::TextureUsageAny); |
| 1133 resourceProvider->allocateForTesting(resource); |
| 1133 pushTileProperties(0, 0, resource, gfx::Rect(), false); | 1134 pushTileProperties(0, 0, resource, gfx::Rect(), false); |
| 1134 } | 1135 } |
| 1135 if (animating) | 1136 if (animating) |
| 1136 addAnimatedTransformToLayer(*this, 10, 3, 0); | 1137 addAnimatedTransformToLayer(*this, 10, 3, 0); |
| 1137 } | 1138 } |
| 1138 }; | 1139 }; |
| 1139 | 1140 |
| 1140 TEST_P(LayerTreeHostImplTest, prepareToDrawFailsWhenAnimationUsesCheckerboard) | 1141 TEST_P(LayerTreeHostImplTest, prepareToDrawFailsWhenAnimationUsesCheckerboard) |
| 1141 { | 1142 { |
| 1142 // When the texture is not missing, we draw as usual. | 1143 // When the texture is not missing, we draw as usual. |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1748 private: | 1749 private: |
| 1749 BlendStateCheckLayer(LayerTreeImpl* treeImpl, int id, ResourceProvider* reso
urceProvider) | 1750 BlendStateCheckLayer(LayerTreeImpl* treeImpl, int id, ResourceProvider* reso
urceProvider) |
| 1750 : LayerImpl(treeImpl, id) | 1751 : LayerImpl(treeImpl, id) |
| 1751 , m_blend(false) | 1752 , m_blend(false) |
| 1752 , m_hasRenderSurface(false) | 1753 , m_hasRenderSurface(false) |
| 1753 , m_quadsAppended(false) | 1754 , m_quadsAppended(false) |
| 1754 , m_quadRect(5, 5, 5, 5) | 1755 , m_quadRect(5, 5, 5, 5) |
| 1755 , m_quadVisibleRect(5, 5, 5, 5) | 1756 , m_quadVisibleRect(5, 5, 5, 5) |
| 1756 , m_resourceId(resourceProvider->createResource(gfx::Size(1, 1), GL_RGBA
, ResourceProvider::TextureUsageAny)) | 1757 , m_resourceId(resourceProvider->createResource(gfx::Size(1, 1), GL_RGBA
, ResourceProvider::TextureUsageAny)) |
| 1757 { | 1758 { |
| 1759 resourceProvider->allocateForTesting(m_resourceId); |
| 1758 setAnchorPoint(gfx::PointF(0, 0)); | 1760 setAnchorPoint(gfx::PointF(0, 0)); |
| 1759 setBounds(gfx::Size(10, 10)); | 1761 setBounds(gfx::Size(10, 10)); |
| 1760 setContentBounds(gfx::Size(10, 10)); | 1762 setContentBounds(gfx::Size(10, 10)); |
| 1761 setDrawsContent(true); | 1763 setDrawsContent(true); |
| 1762 } | 1764 } |
| 1763 | 1765 |
| 1764 bool m_blend; | 1766 bool m_blend; |
| 1765 bool m_hasRenderSurface; | 1767 bool m_hasRenderSurface; |
| 1766 bool m_quadsAppended; | 1768 bool m_quadsAppended; |
| 1767 gfx::Rect m_quadRect; | 1769 gfx::Rect m_quadRect; |
| (...skipping 2644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4412 gfx::Rect noDamage = gfx::Rect(m_hostImpl->deviceViewportSize()); | 4414 gfx::Rect noDamage = gfx::Rect(m_hostImpl->deviceViewportSize()); |
| 4413 drawFrameAndTestDamage(noDamage); | 4415 drawFrameAndTestDamage(noDamage); |
| 4414 } | 4416 } |
| 4415 | 4417 |
| 4416 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, | 4418 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, |
| 4417 LayerTreeHostImplTest, | 4419 LayerTreeHostImplTest, |
| 4418 ::testing::Values(false, true)); | 4420 ::testing::Values(false, true)); |
| 4419 | 4421 |
| 4420 } // namespace | 4422 } // namespace |
| 4421 } // namespace cc | 4423 } // namespace cc |
| OLD | NEW |