| 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 2789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2800 tileLayer->setAnchorPoint(gfx::PointF(0, 0)); | 2800 tileLayer->setAnchorPoint(gfx::PointF(0, 0)); |
| 2801 tileLayer->setContentBounds(gfx::Size(10, 10)); | 2801 tileLayer->setContentBounds(gfx::Size(10, 10)); |
| 2802 tileLayer->setDrawsContent(true); | 2802 tileLayer->setDrawsContent(true); |
| 2803 tileLayer->setSkipsDraw(false); | 2803 tileLayer->setSkipsDraw(false); |
| 2804 scoped_ptr<LayerTilingData> tilingData(LayerTilingData::create(gfx::Size(10,
10), LayerTilingData::NoBorderTexels)); | 2804 scoped_ptr<LayerTilingData> tilingData(LayerTilingData::create(gfx::Size(10,
10), LayerTilingData::NoBorderTexels)); |
| 2805 tilingData->setBounds(gfx::Size(10, 10)); | 2805 tilingData->setBounds(gfx::Size(10, 10)); |
| 2806 tileLayer->setTilingData(*tilingData); | 2806 tileLayer->setTilingData(*tilingData); |
| 2807 tileLayer->pushTileProperties(0, 0, 1, gfx::Rect(0, 0, 10, 10), false); | 2807 tileLayer->pushTileProperties(0, 0, 1, gfx::Rect(0, 0, 10, 10), false); |
| 2808 rootLayer->addChild(tileLayer.PassAs<LayerImpl>()); | 2808 rootLayer->addChild(tileLayer.PassAs<LayerImpl>()); |
| 2809 | 2809 |
| 2810 scoped_ptr<TextureLayerImpl> textureLayer = TextureLayerImpl::create(m_hostI
mpl->activeTree(), layerId++); | 2810 scoped_ptr<TextureLayerImpl> textureLayer = TextureLayerImpl::create(m_hostI
mpl->activeTree(), layerId++, false); |
| 2811 textureLayer->setBounds(gfx::Size(10, 10)); | 2811 textureLayer->setBounds(gfx::Size(10, 10)); |
| 2812 textureLayer->setAnchorPoint(gfx::PointF(0, 0)); | 2812 textureLayer->setAnchorPoint(gfx::PointF(0, 0)); |
| 2813 textureLayer->setContentBounds(gfx::Size(10, 10)); | 2813 textureLayer->setContentBounds(gfx::Size(10, 10)); |
| 2814 textureLayer->setDrawsContent(true); | 2814 textureLayer->setDrawsContent(true); |
| 2815 textureLayer->setTextureId(StrictWebGraphicsContext3D::kExternalTextureId); | 2815 textureLayer->setTextureId(StrictWebGraphicsContext3D::kExternalTextureId); |
| 2816 rootLayer->addChild(textureLayer.PassAs<LayerImpl>()); | 2816 rootLayer->addChild(textureLayer.PassAs<LayerImpl>()); |
| 2817 | 2817 |
| 2818 scoped_ptr<TiledLayerImpl> maskLayer = TiledLayerImpl::create(m_hostImpl->ac
tiveTree(), layerId++); | 2818 scoped_ptr<TiledLayerImpl> maskLayer = TiledLayerImpl::create(m_hostImpl->ac
tiveTree(), layerId++); |
| 2819 maskLayer->setBounds(gfx::Size(10, 10)); | 2819 maskLayer->setBounds(gfx::Size(10, 10)); |
| 2820 maskLayer->setAnchorPoint(gfx::PointF(0, 0)); | 2820 maskLayer->setAnchorPoint(gfx::PointF(0, 0)); |
| 2821 maskLayer->setContentBounds(gfx::Size(10, 10)); | 2821 maskLayer->setContentBounds(gfx::Size(10, 10)); |
| 2822 maskLayer->setDrawsContent(true); | 2822 maskLayer->setDrawsContent(true); |
| 2823 maskLayer->setSkipsDraw(false); | 2823 maskLayer->setSkipsDraw(false); |
| 2824 maskLayer->setTilingData(*tilingData); | 2824 maskLayer->setTilingData(*tilingData); |
| 2825 maskLayer->pushTileProperties(0, 0, 1, gfx::Rect(0, 0, 10, 10), false); | 2825 maskLayer->pushTileProperties(0, 0, 1, gfx::Rect(0, 0, 10, 10), false); |
| 2826 | 2826 |
| 2827 scoped_ptr<TextureLayerImpl> textureLayerWithMask = TextureLayerImpl::create
(m_hostImpl->activeTree(), layerId++); | 2827 scoped_ptr<TextureLayerImpl> textureLayerWithMask = TextureLayerImpl::create
(m_hostImpl->activeTree(), layerId++, false); |
| 2828 textureLayerWithMask->setBounds(gfx::Size(10, 10)); | 2828 textureLayerWithMask->setBounds(gfx::Size(10, 10)); |
| 2829 textureLayerWithMask->setAnchorPoint(gfx::PointF(0, 0)); | 2829 textureLayerWithMask->setAnchorPoint(gfx::PointF(0, 0)); |
| 2830 textureLayerWithMask->setContentBounds(gfx::Size(10, 10)); | 2830 textureLayerWithMask->setContentBounds(gfx::Size(10, 10)); |
| 2831 textureLayerWithMask->setDrawsContent(true); | 2831 textureLayerWithMask->setDrawsContent(true); |
| 2832 textureLayerWithMask->setTextureId(StrictWebGraphicsContext3D::kExternalText
ureId); | 2832 textureLayerWithMask->setTextureId(StrictWebGraphicsContext3D::kExternalText
ureId); |
| 2833 textureLayerWithMask->setMaskLayer(maskLayer.PassAs<LayerImpl>()); | 2833 textureLayerWithMask->setMaskLayer(maskLayer.PassAs<LayerImpl>()); |
| 2834 rootLayer->addChild(textureLayerWithMask.PassAs<LayerImpl>()); | 2834 rootLayer->addChild(textureLayerWithMask.PassAs<LayerImpl>()); |
| 2835 | 2835 |
| 2836 FakeVideoFrame videoFrame(VideoFrame::CreateColorFrame(gfx::Size(4, 4), | 2836 FakeVideoFrame videoFrame(VideoFrame::CreateColorFrame(gfx::Size(4, 4), |
| 2837 0x80, 0x80, 0x80, | 2837 0x80, 0x80, 0x80, |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3009 tileLayer->setAnchorPoint(gfx::PointF(0, 0)); | 3009 tileLayer->setAnchorPoint(gfx::PointF(0, 0)); |
| 3010 tileLayer->setContentBounds(gfx::Size(10, 10)); | 3010 tileLayer->setContentBounds(gfx::Size(10, 10)); |
| 3011 tileLayer->setDrawsContent(true); | 3011 tileLayer->setDrawsContent(true); |
| 3012 tileLayer->setSkipsDraw(false); | 3012 tileLayer->setSkipsDraw(false); |
| 3013 scoped_ptr<LayerTilingData> tilingData(LayerTilingData::create(gfx::Size(10,
10), LayerTilingData::NoBorderTexels)); | 3013 scoped_ptr<LayerTilingData> tilingData(LayerTilingData::create(gfx::Size(10,
10), LayerTilingData::NoBorderTexels)); |
| 3014 tilingData->setBounds(gfx::Size(10, 10)); | 3014 tilingData->setBounds(gfx::Size(10, 10)); |
| 3015 tileLayer->setTilingData(*tilingData); | 3015 tileLayer->setTilingData(*tilingData); |
| 3016 tileLayer->pushTileProperties(0, 0, 1, gfx::Rect(0, 0, 10, 10), false); | 3016 tileLayer->pushTileProperties(0, 0, 1, gfx::Rect(0, 0, 10, 10), false); |
| 3017 rootLayer->addChild(tileLayer.PassAs<LayerImpl>()); | 3017 rootLayer->addChild(tileLayer.PassAs<LayerImpl>()); |
| 3018 | 3018 |
| 3019 scoped_ptr<TextureLayerImpl> textureLayer = TextureLayerImpl::create(m_hostI
mpl->activeTree(), 3); | 3019 scoped_ptr<TextureLayerImpl> textureLayer = TextureLayerImpl::create(m_hostI
mpl->activeTree(), 3, false); |
| 3020 textureLayer->setBounds(gfx::Size(10, 10)); | 3020 textureLayer->setBounds(gfx::Size(10, 10)); |
| 3021 textureLayer->setAnchorPoint(gfx::PointF(0, 0)); | 3021 textureLayer->setAnchorPoint(gfx::PointF(0, 0)); |
| 3022 textureLayer->setContentBounds(gfx::Size(10, 10)); | 3022 textureLayer->setContentBounds(gfx::Size(10, 10)); |
| 3023 textureLayer->setDrawsContent(true); | 3023 textureLayer->setDrawsContent(true); |
| 3024 textureLayer->setTextureId(1); | 3024 textureLayer->setTextureId(1); |
| 3025 rootLayer->addChild(textureLayer.PassAs<LayerImpl>()); | 3025 rootLayer->addChild(textureLayer.PassAs<LayerImpl>()); |
| 3026 | 3026 |
| 3027 VideoLayerImpl::FrameUnwrapper unwrapper = | 3027 VideoLayerImpl::FrameUnwrapper unwrapper = |
| 3028 base::Bind(FakeVideoFrame::toVideoFrame); | 3028 base::Bind(FakeVideoFrame::toVideoFrame); |
| 3029 FakeVideoFrameProvider provider; | 3029 FakeVideoFrameProvider provider; |
| (...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4845 gfx::Rect noDamage = gfx::Rect(m_hostImpl->deviceViewportSize()); | 4845 gfx::Rect noDamage = gfx::Rect(m_hostImpl->deviceViewportSize()); |
| 4846 drawFrameAndTestDamage(noDamage); | 4846 drawFrameAndTestDamage(noDamage); |
| 4847 } | 4847 } |
| 4848 | 4848 |
| 4849 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, | 4849 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, |
| 4850 LayerTreeHostImplTest, | 4850 LayerTreeHostImplTest, |
| 4851 ::testing::Values(false, true)); | 4851 ::testing::Values(false, true)); |
| 4852 | 4852 |
| 4853 } // namespace | 4853 } // namespace |
| 4854 } // namespace cc | 4854 } // namespace cc |
| OLD | NEW |