| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "cc/layer_tree_host_impl.h" | 7 #include "cc/layer_tree_host_impl.h" |
| 8 | 8 |
| 9 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 10 #include "base/hash_tables.h" | 11 #include "base/hash_tables.h" |
| 11 #include "cc/delegated_renderer_layer_impl.h" | 12 #include "cc/delegated_renderer_layer_impl.h" |
| 12 #include "cc/gl_renderer.h" | 13 #include "cc/gl_renderer.h" |
| 13 #include "cc/heads_up_display_layer_impl.h" | 14 #include "cc/heads_up_display_layer_impl.h" |
| 14 #include "cc/io_surface_layer_impl.h" | 15 #include "cc/io_surface_layer_impl.h" |
| 15 #include "cc/layer_impl.h" | 16 #include "cc/layer_impl.h" |
| 16 #include "cc/layer_tiling_data.h" | 17 #include "cc/layer_tiling_data.h" |
| 17 #include "cc/quad_sink.h" | 18 #include "cc/quad_sink.h" |
| 18 #include "cc/render_pass_draw_quad.h" | 19 #include "cc/render_pass_draw_quad.h" |
| 19 #include "cc/scrollbar_geometry_fixed_thumb.h" | 20 #include "cc/scrollbar_geometry_fixed_thumb.h" |
| 20 #include "cc/scrollbar_layer_impl.h" | 21 #include "cc/scrollbar_layer_impl.h" |
| 21 #include "cc/settings.h" | 22 #include "cc/settings.h" |
| 22 #include "cc/single_thread_proxy.h" | 23 #include "cc/single_thread_proxy.h" |
| 23 #include "cc/solid_color_draw_quad.h" | 24 #include "cc/solid_color_draw_quad.h" |
| 24 #include "cc/test/animation_test_common.h" | 25 #include "cc/test/animation_test_common.h" |
| 25 #include "cc/test/fake_web_compositor_output_surface.h" | 26 #include "cc/test/fake_web_compositor_output_surface.h" |
| 26 #include "cc/test/fake_web_graphics_context_3d.h" | 27 #include "cc/test/fake_web_graphics_context_3d.h" |
| 27 #include "cc/test/fake_web_scrollbar_theme_geometry.h" | 28 #include "cc/test/fake_web_scrollbar_theme_geometry.h" |
| 28 #include "cc/test/geometry_test_utils.h" | 29 #include "cc/test/geometry_test_utils.h" |
| 29 #include "cc/test/layer_test_common.h" | 30 #include "cc/test/layer_test_common.h" |
| 30 #include "cc/test/render_pass_test_common.h" | 31 #include "cc/test/render_pass_test_common.h" |
| 31 #include "cc/test/test_common.h" | 32 #include "cc/test/test_common.h" |
| 32 #include "cc/texture_draw_quad.h" | 33 #include "cc/texture_draw_quad.h" |
| 33 #include "cc/texture_layer_impl.h" | 34 #include "cc/texture_layer_impl.h" |
| 34 #include "cc/tile_draw_quad.h" | 35 #include "cc/tile_draw_quad.h" |
| 35 #include "cc/tiled_layer_impl.h" | 36 #include "cc/tiled_layer_impl.h" |
| 36 #include "cc/video_layer_impl.h" | 37 #include "cc/video_layer_impl.h" |
| 38 #include "media/base/media.h" |
| 39 #include "media/base/video_frame.h" |
| 37 #include "testing/gmock/include/gmock/gmock.h" | 40 #include "testing/gmock/include/gmock/gmock.h" |
| 38 #include "testing/gtest/include/gtest/gtest.h" | 41 #include "testing/gtest/include/gtest/gtest.h" |
| 39 #include <public/WebVideoFrame.h> | 42 #include <public/WebVideoFrame.h> |
| 40 #include <public/WebVideoFrameProvider.h> | 43 #include <public/WebVideoFrameProvider.h> |
| 41 | 44 |
| 42 using namespace cc; | 45 using namespace cc; |
| 43 using namespace LayerTestCommon; | 46 using namespace LayerTestCommon; |
| 44 using namespace WebKit; | 47 using namespace WebKit; |
| 45 using namespace WebKitTests; | 48 using namespace WebKitTests; |
| 46 | 49 |
| 50 using media::VideoFrame; |
| 47 using ::testing::Mock; | 51 using ::testing::Mock; |
| 48 using ::testing::Return; | 52 using ::testing::Return; |
| 49 using ::testing::AnyNumber; | 53 using ::testing::AnyNumber; |
| 50 using ::testing::AtLeast; | 54 using ::testing::AtLeast; |
| 51 using ::testing::_; | 55 using ::testing::_; |
| 52 | 56 |
| 53 namespace { | 57 namespace { |
| 54 | 58 |
| 55 // This test is parametrized to run all tests with the | 59 // This test is parametrized to run all tests with the |
| 56 // Settings::pageScalePinchZoomEnabled field enabled and disabled. | 60 // Settings::pageScalePinchZoomEnabled field enabled and disabled. |
| 57 class LayerTreeHostImplTest : public testing::TestWithParam<bool>, | 61 class LayerTreeHostImplTest : public testing::TestWithParam<bool>, |
| 58 public LayerTreeHostImplClient { | 62 public LayerTreeHostImplClient { |
| 59 public: | 63 public: |
| 60 LayerTreeHostImplTest() | 64 LayerTreeHostImplTest() |
| 61 : m_onCanDrawStateChangedCalled(false) | 65 : m_onCanDrawStateChangedCalled(false) |
| 62 , m_didRequestCommit(false) | 66 , m_didRequestCommit(false) |
| 63 , m_didRequestRedraw(false) | 67 , m_didRequestRedraw(false) |
| 64 , m_reduceMemoryResult(true) | 68 , m_reduceMemoryResult(true) |
| 65 { | 69 { |
| 70 media::InitializeMediaLibraryForTesting(); |
| 66 } | 71 } |
| 67 | 72 |
| 68 virtual void SetUp() | 73 virtual void SetUp() |
| 69 { | 74 { |
| 70 Settings::setPageScalePinchZoomEnabled(GetParam()); | 75 Settings::setPageScalePinchZoomEnabled(GetParam()); |
| 71 LayerTreeSettings settings; | 76 LayerTreeSettings settings; |
| 72 settings.minimumOcclusionTrackingSize = IntSize(); | 77 settings.minimumOcclusionTrackingSize = IntSize(); |
| 73 | 78 |
| 74 m_hostImpl = LayerTreeHostImpl::create(settings, this); | 79 m_hostImpl = LayerTreeHostImpl::create(settings, this); |
| 75 m_hostImpl->initializeRenderer(createContext()); | 80 m_hostImpl->initializeRenderer(createContext()); |
| (...skipping 2449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2525 virtual void bindTexture(WGC3Denum, WebGLId id) | 2530 virtual void bindTexture(WGC3Denum, WebGLId id) |
| 2526 { | 2531 { |
| 2527 if (id && !ContainsKey(m_allocatedTextureIds, id)) | 2532 if (id && !ContainsKey(m_allocatedTextureIds, id)) |
| 2528 ADD_FAILURE() << "Trying to bind texture id " << id; | 2533 ADD_FAILURE() << "Trying to bind texture id " << id; |
| 2529 } | 2534 } |
| 2530 | 2535 |
| 2531 private: | 2536 private: |
| 2532 base::hash_set<unsigned> m_allocatedTextureIds; | 2537 base::hash_set<unsigned> m_allocatedTextureIds; |
| 2533 }; | 2538 }; |
| 2534 | 2539 |
| 2535 // Fake video frame that represents a 4x4 YUV video frame. | 2540 // Fake WebVideoFrame wrapper of media::VideoFrame. |
| 2536 class FakeVideoFrame: public WebVideoFrame { | 2541 class FakeVideoFrame: public WebVideoFrame { |
| 2537 public: | 2542 public: |
| 2538 FakeVideoFrame() : m_textureId(0) { memset(m_data, 0x80, sizeof(m_data)); } | 2543 explicit FakeVideoFrame(const scoped_refptr<VideoFrame>& frame) : m_frame(fr
ame) { } |
| 2539 virtual ~FakeVideoFrame() { } | 2544 virtual ~FakeVideoFrame() { } |
| 2540 virtual Format format() const { return m_textureId ? FormatNativeTexture : F
ormatYV12; } | |
| 2541 virtual unsigned width() const { return 4; } | |
| 2542 virtual unsigned height() const { return 4; } | |
| 2543 virtual unsigned planes() const { return m_textureId ? 0 : 3; } | |
| 2544 virtual int stride(unsigned plane) const { return 4; } | |
| 2545 virtual const void* data(unsigned plane) const { return m_data; } | |
| 2546 virtual unsigned textureId() const { return m_textureId; } | |
| 2547 virtual unsigned textureTarget() const { return m_textureId ? GL_TEXTURE_2D
: 0; } | |
| 2548 | 2545 |
| 2549 void setTextureId(unsigned id) { m_textureId = id; } | 2546 virtual Format format() const { NOTREACHED(); return FormatInvalid; } |
| 2547 virtual unsigned width() const { NOTREACHED(); return 0; } |
| 2548 virtual unsigned height() const { NOTREACHED(); return 0; } |
| 2549 virtual unsigned planes() const { NOTREACHED(); return 0; } |
| 2550 virtual int stride(unsigned plane) const { NOTREACHED(); return 0; } |
| 2551 virtual const void* data(unsigned plane) const { NOTREACHED(); return NULL;
} |
| 2552 virtual unsigned textureId() const { NOTREACHED(); return 0; } |
| 2553 virtual unsigned textureTarget() const { NOTREACHED(); return 0; } |
| 2554 |
| 2555 static VideoFrame* toVideoFrame(WebVideoFrame* web_video_frame) { |
| 2556 FakeVideoFrame* wrapped_frame = |
| 2557 static_cast<FakeVideoFrame*>(web_video_frame); |
| 2558 if (wrapped_frame) |
| 2559 return wrapped_frame->m_frame.get(); |
| 2560 return NULL; |
| 2561 } |
| 2550 | 2562 |
| 2551 private: | 2563 private: |
| 2552 char m_data[16]; | 2564 scoped_refptr<VideoFrame> m_frame; |
| 2553 unsigned m_textureId; | |
| 2554 }; | 2565 }; |
| 2555 | 2566 |
| 2556 // Fake video frame provider that always provides the same FakeVideoFrame. | 2567 // Fake video frame provider that always provides the same FakeVideoFrame. |
| 2557 class FakeVideoFrameProvider: public WebVideoFrameProvider { | 2568 class FakeVideoFrameProvider: public WebVideoFrameProvider { |
| 2558 public: | 2569 public: |
| 2559 FakeVideoFrameProvider() : m_frame(0), m_client(0) { } | 2570 FakeVideoFrameProvider() : m_frame(0), m_client(0) { } |
| 2560 virtual ~FakeVideoFrameProvider() | 2571 virtual ~FakeVideoFrameProvider() |
| 2561 { | 2572 { |
| 2562 if (m_client) | 2573 if (m_client) |
| 2563 m_client->stopUsingProvider(); | 2574 m_client->stopUsingProvider(); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2688 | 2699 |
| 2689 scoped_ptr<TextureLayerImpl> textureLayerWithMask = TextureLayerImpl::create
(layerId++); | 2700 scoped_ptr<TextureLayerImpl> textureLayerWithMask = TextureLayerImpl::create
(layerId++); |
| 2690 textureLayerWithMask->setBounds(IntSize(10, 10)); | 2701 textureLayerWithMask->setBounds(IntSize(10, 10)); |
| 2691 textureLayerWithMask->setAnchorPoint(FloatPoint(0, 0)); | 2702 textureLayerWithMask->setAnchorPoint(FloatPoint(0, 0)); |
| 2692 textureLayerWithMask->setContentBounds(IntSize(10, 10)); | 2703 textureLayerWithMask->setContentBounds(IntSize(10, 10)); |
| 2693 textureLayerWithMask->setDrawsContent(true); | 2704 textureLayerWithMask->setDrawsContent(true); |
| 2694 textureLayerWithMask->setTextureId(1); | 2705 textureLayerWithMask->setTextureId(1); |
| 2695 textureLayerWithMask->setMaskLayer(maskLayer.PassAs<LayerImpl>()); | 2706 textureLayerWithMask->setMaskLayer(maskLayer.PassAs<LayerImpl>()); |
| 2696 rootLayer->addChild(textureLayerWithMask.PassAs<LayerImpl>()); | 2707 rootLayer->addChild(textureLayerWithMask.PassAs<LayerImpl>()); |
| 2697 | 2708 |
| 2698 FakeVideoFrame videoFrame; | 2709 FakeVideoFrame videoFrame(VideoFrame::CreateColorFrame(gfx::Size(4, 4), |
| 2710 0x80, 0x80, 0x80, |
| 2711 base::TimeDelta())); |
| 2712 VideoLayerImpl::FrameUnwrapper unwrapper = |
| 2713 base::Bind(FakeVideoFrame::toVideoFrame); |
| 2699 FakeVideoFrameProvider provider; | 2714 FakeVideoFrameProvider provider; |
| 2700 provider.setFrame(&videoFrame); | 2715 provider.setFrame(&videoFrame); |
| 2701 scoped_ptr<VideoLayerImpl> videoLayer = VideoLayerImpl::create(layerId++, &p
rovider); | 2716 scoped_ptr<VideoLayerImpl> videoLayer = |
| 2717 VideoLayerImpl::create(layerId++, &provider, unwrapper); |
| 2702 videoLayer->setBounds(IntSize(10, 10)); | 2718 videoLayer->setBounds(IntSize(10, 10)); |
| 2703 videoLayer->setAnchorPoint(FloatPoint(0, 0)); | 2719 videoLayer->setAnchorPoint(FloatPoint(0, 0)); |
| 2704 videoLayer->setContentBounds(IntSize(10, 10)); | 2720 videoLayer->setContentBounds(IntSize(10, 10)); |
| 2705 videoLayer->setDrawsContent(true); | 2721 videoLayer->setDrawsContent(true); |
| 2706 videoLayer->setLayerTreeHostImpl(m_hostImpl.get()); | 2722 videoLayer->setLayerTreeHostImpl(m_hostImpl.get()); |
| 2707 rootLayer->addChild(videoLayer.PassAs<LayerImpl>()); | 2723 rootLayer->addChild(videoLayer.PassAs<LayerImpl>()); |
| 2708 | 2724 |
| 2709 FakeVideoFrame hwVideoFrame; | |
| 2710 FakeVideoFrameProvider hwProvider; | 2725 FakeVideoFrameProvider hwProvider; |
| 2711 hwProvider.setFrame(&hwVideoFrame); | 2726 scoped_ptr<VideoLayerImpl> hwVideoLayer = |
| 2712 scoped_ptr<VideoLayerImpl> hwVideoLayer = VideoLayerImpl::create(layerId++,
&hwProvider); | 2727 VideoLayerImpl::create(layerId++, &hwProvider, unwrapper); |
| 2713 hwVideoLayer->setBounds(IntSize(10, 10)); | 2728 hwVideoLayer->setBounds(IntSize(10, 10)); |
| 2714 hwVideoLayer->setAnchorPoint(FloatPoint(0, 0)); | 2729 hwVideoLayer->setAnchorPoint(FloatPoint(0, 0)); |
| 2715 hwVideoLayer->setContentBounds(IntSize(10, 10)); | 2730 hwVideoLayer->setContentBounds(IntSize(10, 10)); |
| 2716 hwVideoLayer->setDrawsContent(true); | 2731 hwVideoLayer->setDrawsContent(true); |
| 2717 hwVideoLayer->setLayerTreeHostImpl(m_hostImpl.get()); | 2732 hwVideoLayer->setLayerTreeHostImpl(m_hostImpl.get()); |
| 2718 rootLayer->addChild(hwVideoLayer.PassAs<LayerImpl>()); | 2733 rootLayer->addChild(hwVideoLayer.PassAs<LayerImpl>()); |
| 2719 | 2734 |
| 2720 scoped_ptr<IOSurfaceLayerImpl> ioSurfaceLayer = IOSurfaceLayerImpl::create(l
ayerId++); | 2735 scoped_ptr<IOSurfaceLayerImpl> ioSurfaceLayer = IOSurfaceLayerImpl::create(l
ayerId++); |
| 2721 ioSurfaceLayer->setBounds(IntSize(10, 10)); | 2736 ioSurfaceLayer->setBounds(IntSize(10, 10)); |
| 2722 ioSurfaceLayer->setAnchorPoint(FloatPoint(0, 0)); | 2737 ioSurfaceLayer->setAnchorPoint(FloatPoint(0, 0)); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 2749 delegatedRendererLayer->setLayerTreeHostImpl(m_hostImpl.get()); | 2764 delegatedRendererLayer->setLayerTreeHostImpl(m_hostImpl.get()); |
| 2750 ScopedPtrVector<RenderPass> passList; | 2765 ScopedPtrVector<RenderPass> passList; |
| 2751 passList.append(createRenderPassWithResource(m_hostImpl->resourceProvider())
); | 2766 passList.append(createRenderPassWithResource(m_hostImpl->resourceProvider())
); |
| 2752 delegatedRendererLayer->setRenderPasses(passList); | 2767 delegatedRendererLayer->setRenderPasses(passList); |
| 2753 EXPECT_TRUE(passList.isEmpty()); | 2768 EXPECT_TRUE(passList.isEmpty()); |
| 2754 rootLayer->addChild(delegatedRendererLayer.PassAs<LayerImpl>()); | 2769 rootLayer->addChild(delegatedRendererLayer.PassAs<LayerImpl>()); |
| 2755 | 2770 |
| 2756 // Use a context that supports IOSurfaces | 2771 // Use a context that supports IOSurfaces |
| 2757 m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped
_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3DWithIOSurface)).P
assAs<GraphicsContext>()); | 2772 m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped
_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3DWithIOSurface)).P
assAs<GraphicsContext>()); |
| 2758 | 2773 |
| 2759 hwVideoFrame.setTextureId(m_hostImpl->resourceProvider()->graphicsContext3D(
)->createTexture()); | 2774 FakeVideoFrame hwVideoFrame( |
| 2775 VideoFrame::WrapNativeTexture( |
| 2776 m_hostImpl->resourceProvider()->graphicsContext3D()->createTexture()
, |
| 2777 GL_TEXTURE_2D, |
| 2778 gfx::Size(4, 4), gfx::Size(4, 4), base::TimeDelta(), |
| 2779 VideoFrame::ReadPixelsCB(), base::Closure())); |
| 2780 hwProvider.setFrame(&hwVideoFrame); |
| 2760 | 2781 |
| 2761 m_hostImpl->setRootLayer(rootLayer.Pass()); | 2782 m_hostImpl->setRootLayer(rootLayer.Pass()); |
| 2762 | 2783 |
| 2763 LayerTreeHostImpl::FrameData frame; | 2784 LayerTreeHostImpl::FrameData frame; |
| 2764 EXPECT_TRUE(m_hostImpl->prepareToDraw(frame)); | 2785 EXPECT_TRUE(m_hostImpl->prepareToDraw(frame)); |
| 2765 m_hostImpl->drawLayers(frame); | 2786 m_hostImpl->drawLayers(frame); |
| 2766 m_hostImpl->didDrawAllLayers(frame); | 2787 m_hostImpl->didDrawAllLayers(frame); |
| 2767 m_hostImpl->swapBuffers(); | 2788 m_hostImpl->swapBuffers(); |
| 2768 | 2789 |
| 2769 unsigned numResources = m_hostImpl->resourceProvider()->numResources(); | 2790 unsigned numResources = m_hostImpl->resourceProvider()->numResources(); |
| 2770 | 2791 |
| 2771 // Lose the context, replacing it with a StrictWebGraphicsContext3DWithIOSur
face, | 2792 // Lose the context, replacing it with a StrictWebGraphicsContext3DWithIOSur
face, |
| 2772 // that will warn if any resource from the previous context gets used. | 2793 // that will warn if any resource from the previous context gets used. |
| 2773 m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped
_ptr<WebKit::WebGraphicsContext3D>(new StrictWebGraphicsContext3DWithIOSurface))
.PassAs<GraphicsContext>()); | 2794 m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped
_ptr<WebKit::WebGraphicsContext3D>(new StrictWebGraphicsContext3DWithIOSurface))
.PassAs<GraphicsContext>()); |
| 2774 | 2795 |
| 2775 // Create dummy resources so that looking up an old resource will get an | 2796 // Create dummy resources so that looking up an old resource will get an |
| 2776 // invalid texture id mapping. | 2797 // invalid texture id mapping. |
| 2777 for (unsigned i = 0; i < numResources; ++i) | 2798 for (unsigned i = 0; i < numResources; ++i) |
| 2778 m_hostImpl->resourceProvider()->createResourceFromExternalTexture(1); | 2799 m_hostImpl->resourceProvider()->createResourceFromExternalTexture(1); |
| 2779 | 2800 |
| 2780 // The WebVideoFrameProvider is expected to recreate its textures after a | 2801 // The WebVideoFrameProvider is expected to recreate its textures after a |
| 2781 // lost context (or not serve a frame). | 2802 // lost context (or not serve a frame). |
| 2782 hwProvider.setFrame(0); | 2803 hwProvider.setFrame(0); |
| 2783 | 2804 |
| 2784 EXPECT_TRUE(m_hostImpl->prepareToDraw(frame)); | 2805 EXPECT_TRUE(m_hostImpl->prepareToDraw(frame)); |
| 2785 m_hostImpl->drawLayers(frame); | 2806 m_hostImpl->drawLayers(frame); |
| 2786 m_hostImpl->didDrawAllLayers(frame); | 2807 m_hostImpl->didDrawAllLayers(frame); |
| 2787 m_hostImpl->swapBuffers(); | 2808 m_hostImpl->swapBuffers(); |
| 2788 | 2809 |
| 2789 hwVideoFrame.setTextureId(m_hostImpl->resourceProvider()->graphicsContext3D(
)->createTexture()); | 2810 FakeVideoFrame hwVideoFrame2( |
| 2790 hwProvider.setFrame(&hwVideoFrame); | 2811 VideoFrame::WrapNativeTexture( |
| 2812 m_hostImpl->resourceProvider()->graphicsContext3D()->createTexture()
, |
| 2813 GL_TEXTURE_2D, |
| 2814 gfx::Size(4, 4), gfx::Size(4, 4), base::TimeDelta(), |
| 2815 VideoFrame::ReadPixelsCB(), base::Closure())); |
| 2816 hwProvider.setFrame(&hwVideoFrame2); |
| 2791 | 2817 |
| 2792 EXPECT_TRUE(m_hostImpl->prepareToDraw(frame)); | 2818 EXPECT_TRUE(m_hostImpl->prepareToDraw(frame)); |
| 2793 m_hostImpl->drawLayers(frame); | 2819 m_hostImpl->drawLayers(frame); |
| 2794 m_hostImpl->didDrawAllLayers(frame); | 2820 m_hostImpl->didDrawAllLayers(frame); |
| 2795 m_hostImpl->swapBuffers(); | 2821 m_hostImpl->swapBuffers(); |
| 2796 } | 2822 } |
| 2797 | 2823 |
| 2798 // Fake WebGraphicsContext3D that tracks the number of textures in use. | 2824 // Fake WebGraphicsContext3D that tracks the number of textures in use. |
| 2799 class TrackingWebGraphicsContext3D : public FakeWebGraphicsContext3D { | 2825 class TrackingWebGraphicsContext3D : public FakeWebGraphicsContext3D { |
| 2800 public: | 2826 public: |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2855 rootLayer->addChild(tileLayer.PassAs<LayerImpl>()); | 2881 rootLayer->addChild(tileLayer.PassAs<LayerImpl>()); |
| 2856 | 2882 |
| 2857 scoped_ptr<TextureLayerImpl> textureLayer = TextureLayerImpl::create(3); | 2883 scoped_ptr<TextureLayerImpl> textureLayer = TextureLayerImpl::create(3); |
| 2858 textureLayer->setBounds(IntSize(10, 10)); | 2884 textureLayer->setBounds(IntSize(10, 10)); |
| 2859 textureLayer->setAnchorPoint(FloatPoint(0, 0)); | 2885 textureLayer->setAnchorPoint(FloatPoint(0, 0)); |
| 2860 textureLayer->setContentBounds(IntSize(10, 10)); | 2886 textureLayer->setContentBounds(IntSize(10, 10)); |
| 2861 textureLayer->setDrawsContent(true); | 2887 textureLayer->setDrawsContent(true); |
| 2862 textureLayer->setTextureId(1); | 2888 textureLayer->setTextureId(1); |
| 2863 rootLayer->addChild(textureLayer.PassAs<LayerImpl>()); | 2889 rootLayer->addChild(textureLayer.PassAs<LayerImpl>()); |
| 2864 | 2890 |
| 2891 VideoLayerImpl::FrameUnwrapper unwrapper = |
| 2892 base::Bind(FakeVideoFrame::toVideoFrame); |
| 2865 FakeVideoFrameProvider provider; | 2893 FakeVideoFrameProvider provider; |
| 2866 scoped_ptr<VideoLayerImpl> videoLayer = VideoLayerImpl::create(4, &provider)
; | 2894 scoped_ptr<VideoLayerImpl> videoLayer = |
| 2895 VideoLayerImpl::create(4, &provider, unwrapper); |
| 2867 videoLayer->setBounds(IntSize(10, 10)); | 2896 videoLayer->setBounds(IntSize(10, 10)); |
| 2868 videoLayer->setAnchorPoint(FloatPoint(0, 0)); | 2897 videoLayer->setAnchorPoint(FloatPoint(0, 0)); |
| 2869 videoLayer->setContentBounds(IntSize(10, 10)); | 2898 videoLayer->setContentBounds(IntSize(10, 10)); |
| 2870 videoLayer->setDrawsContent(true); | 2899 videoLayer->setDrawsContent(true); |
| 2871 videoLayer->setLayerTreeHostImpl(m_hostImpl.get()); | 2900 videoLayer->setLayerTreeHostImpl(m_hostImpl.get()); |
| 2872 rootLayer->addChild(videoLayer.PassAs<LayerImpl>()); | 2901 rootLayer->addChild(videoLayer.PassAs<LayerImpl>()); |
| 2873 | 2902 |
| 2874 scoped_ptr<IOSurfaceLayerImpl> ioSurfaceLayer = IOSurfaceLayerImpl::create(5
); | 2903 scoped_ptr<IOSurfaceLayerImpl> ioSurfaceLayer = IOSurfaceLayerImpl::create(5
); |
| 2875 ioSurfaceLayer->setBounds(IntSize(10, 10)); | 2904 ioSurfaceLayer->setBounds(IntSize(10, 10)); |
| 2876 ioSurfaceLayer->setAnchorPoint(FloatPoint(0, 0)); | 2905 ioSurfaceLayer->setAnchorPoint(FloatPoint(0, 0)); |
| (...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4375 verifyRenderPassTestData(removeRenderPassesCases[testCaseIndex], testDat
a); | 4404 verifyRenderPassTestData(removeRenderPassesCases[testCaseIndex], testDat
a); |
| 4376 testCaseIndex++; | 4405 testCaseIndex++; |
| 4377 } | 4406 } |
| 4378 } | 4407 } |
| 4379 | 4408 |
| 4380 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, | 4409 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, |
| 4381 LayerTreeHostImplTest, | 4410 LayerTreeHostImplTest, |
| 4382 ::testing::Values(false, true)); | 4411 ::testing::Values(false, true)); |
| 4383 | 4412 |
| 4384 } // namespace | 4413 } // namespace |
| OLD | NEW |